*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #d00000;
  --red-dark: #a30000;
  --white: #ffffff;
  --black: #1a1a1a;
  --gray-light: rgba(255,255,255,0.15);
  --gray-mid: rgba(0,0,0,0.35);
  --error: #ff4444;
  --success: #22c55e;
  --text-dark: #1a1a1a;
  --field-border: rgba(0,0,0,0.55);
}

html, body {
  height: 100%;
  font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: #c06820;
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ── LOADING SCREEN ── */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #c8472a 0%, #e07020 40%, #f0a030 70%, #e08030 100%);
  z-index: 9999;
  gap: 20px;
}

.motul-logo-small {
  background: var(--red);
  color: var(--white);
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  padding: 10px 28px;
  letter-spacing: 2px;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── APP WRAPPER ── */
.app {
  min-height: 100vh;
  position: relative;
  background-image: url('https://images.pexels.com/photos/1172253/pexels-photo-1172253.jpeg?auto=compress&cs=tinysrgb&w=800');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(180, 60, 30, 0.45) 0%,
    rgba(220, 100, 30, 0.3) 30%,
    rgba(240, 140, 40, 0.2) 60%,
    rgba(180, 100, 20, 0.15) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── CONTENT ── */
.content-wrapper {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 120px 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── MOTUL LOGO ── */
.logo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 24px 0 32px;
}

.motul-logo {
  background: var(--red);
  color: var(--white);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  font-style: italic;
  padding: 12px 40px;
  letter-spacing: 3px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  text-align: center;
}

/* ── FORM CONTAINER ── */
.form-container {
  width: 100%;
  padding: 0 20px;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── FIELD GROUP ── */
.field-group {
  width: 100%;
  margin-bottom: 8px;
  position: relative;
}

.field-group input[type="text"],
.field-group input[type="tel"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  padding: 14px 4px 10px;
  caret-color: var(--red);
  letter-spacing: 0.3px;
}

.field-group input::placeholder {
  color: var(--text-dark);
  font-weight: 700;
  opacity: 1;
}

.field-group input:focus::placeholder {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.field-underline {
  height: 2px;
  background: var(--field-border);
  width: 100%;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.field-group:focus-within .field-underline {
  background: var(--red);
}

/* ── SELECT ── */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper select {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  padding: 14px 36px 10px 4px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select-wrapper select option {
  background: #fff;
  color: var(--text-dark);
  font-weight: 500;
}

.select-wrapper select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.select-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-60%);
  font-size: 1.4rem;
  color: var(--text-dark);
  pointer-events: none;
  font-weight: 700;
}

/* ── UPI GROUP ── */
.upi-group {
  margin-bottom: 4px;
}

.invoice-group {
  margin-bottom: 8px;
}

.file-upload-label {
  display: inline-block;
  background: var(--white);
  border-radius: 20px;
  padding: 10px 14px;
  cursor: pointer;
}

.upload-text {
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.invoice-preview {
  display: none;
  margin-top: 10px;
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
}

.field-group input[type="file"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  padding: 14px 4px 10px;
}

.field-group input[type="file"]::file-selector-button {
  background: var(--white);
  border: none;
  border-radius: 20px;
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  margin-right: 10px;
  cursor: pointer;
}

.upload-status {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  min-height: 14px;
  padding: 0 4px;
}

.upload-status.failed {
  color: var(--error);
}

/* ── VERIFY ROW ── */
.verify-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-left: 4px;
}

.verify-btn {
  background: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-dark);
  padding: 12px 32px;
  cursor: pointer;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  min-width: 120px;
}

.verify-btn:hover:not(:disabled) {
  background: #f0f0f0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
}

.verify-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.verify-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.verify-status {
  font-size: 0.85rem;
  font-weight: 700;
}

.verify-status.verified {
  color: var(--success);
}

.verify-status.failed {
  color: var(--error);
}

/* ── CHECKBOX ── */
.checkbox-group {
  margin: 8px 0 24px;
  padding-left: 4px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--text-dark);
  background: rgba(255,255,255,0.7);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background: var(--red);
  border-color: var(--red);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 12px;
  border: 3px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(40deg);
}

.checkbox-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

/* ── ERROR MESSAGES ── */
.error-msg {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--error);
  min-height: 16px;
  padding: 2px 4px 6px;
}

/* ── SUBMIT ROW ── */
.submit-row {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 20px 20px;
  background: linear-gradient(to top, rgba(180, 100, 20, 0.9) 0%, transparent 100%);
  z-index: 100;
  display: flex;
  justify-content: center;
}

.submit-btn {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border: none;
  border-radius: 50px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s, opacity 0.2s;
}

.submit-btn:not(:disabled):hover {
  background: #f5f5f5;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

.submit-btn:not(:disabled):active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 2px;
  margin-left: 8px;
}

.submit-arrow {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.submit-btn.loading .submit-text::after {
  content: '...';
  animation: dots 1s steps(4) infinite;
}

@keyframes dots {
  0%, 100% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ── ALERT MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
}

.modal-box {
  background: var(--white);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-message {
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 24px;
  font-weight: 500;
}

.modal-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s;
}

.modal-btn:hover {
  background: var(--red-dark);
}

/* ── FIELD VALID STATE ── */
.field-group.valid .field-underline {
  background: var(--success);
}

/* ── RESPONSIVE ── */
@media (min-width: 480px) {
  .content-wrapper {
    padding-bottom: 120px;
  }

  .form-container {
    padding: 0 32px;
  }

  .logo-container {
    padding: 32px 0 40px;
  }
}

@media (min-width: 768px) {
  .app {
    background-position: center center;
  }

  .content-wrapper {
    padding-top: 20px;
  }

  .submit-row {
    position: fixed;
    bottom: 20px;
    padding: 0 20px;
  }
}
