/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #fff5f8;
  color: #2d2d2d;
  min-height: 100vh;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #8b0033 0%, #b5004e 50%, #e8005a 100%);
  padding: 60px 20px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mandala {
  position: absolute;
  font-size: 180px;
  opacity: 0.07;
  color: #fff;
  top: -30px;
  pointer-events: none;
}
.mandala-left  { left: -40px; transform: rotate(-20deg); }
.mandala-right { right: -40px; transform: rotate(20deg); }
.logo {
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.tagline {
  color: rgba(255,255,255,0.9);
  font-size: 1.15rem;
  margin-top: 10px;
}
.sub-tagline {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* ── How It Works ─────────────────────────────────────────────────────────── */
.how-it-works {
  max-width: 860px;
  margin: 40px auto;
  text-align: center;
  padding: 0 20px;
}
.how-it-works h2 {
  font-size: 1.5rem;
  color: #b5004e;
  margin-bottom: 28px;
}
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.step {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  width: 200px;
  box-shadow: 0 4px 16px rgba(181,0,78,0.1);
  transition: transform 0.2s;
}
.step:hover { transform: translateY(-4px); }
.step-icon { font-size: 2rem; margin-bottom: 10px; }
.step h3 { font-size: 1rem; color: #b5004e; margin-bottom: 6px; }
.step p  { font-size: 0.82rem; color: #6b7280; line-height: 1.5; }
.step-arrow { font-size: 1.8rem; color: #c9a84c; font-weight: 700; }

/* ── Form Section ─────────────────────────────────────────────────────────── */
.form-section {
  max-width: 1000px;
  margin: 0 auto 50px;
  padding: 0 20px;
}
.form-grid {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.card {
  flex: 1;
  min-width: 280px;
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.09);
}
.card-title {
  font-size: 1.2rem;
  margin-bottom: 22px;
  text-align: center;
}
.groom-title { color: #1a73e8; }
.bride-title  { color: #b5004e; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  font-size: 0.95rem;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}
.field input:focus {
  outline: none;
  border-color: #b5004e;
  box-shadow: 0 0 0 3px rgba(181,0,78,0.12);
  background: #fff;
}
.groom-card .field input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.12); }

/* ── Submit ───────────────────────────────────────────────────────────────── */
.submit-wrap { text-align: center; margin-top: 32px; }
.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 48px;
  background: linear-gradient(135deg, #b5004e, #e8005a);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 6px 20px rgba(181,0,78,0.35);
}
.submit-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(181,0,78,0.45); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.loader {
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── OTP Section ──────────────────────────────────────────────────────────── */
.otp-section {
  max-width: 480px;
  margin: 0 auto 50px;
  padding: 0 20px;
}
.otp-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(181,0,78,0.13);
  text-align: center;
  border-top: 5px solid #b5004e;
}
.otp-icon { font-size: 3rem; margin-bottom: 14px; }
.otp-card h2 { font-size: 1.4rem; color: #1f2937; margin-bottom: 10px; }
.otp-msg {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 28px;
}
.otp-inputs { margin-bottom: 16px; }
.otp-inputs input {
  width: 100%;
  padding: 16px 20px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 14px;
  text-align: center;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  color: #b5004e;
  background: #fff5f8;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-inputs input:focus {
  outline: none;
  border-color: #b5004e;
  box-shadow: 0 0 0 4px rgba(181,0,78,0.12);
}
.otp-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  color: #dc2626;
  font-size: 0.88rem;
  margin-bottom: 16px;
  text-align: left;
}
.otp-actions { margin-bottom: 20px; }
.otp-actions .submit-btn { width: 100%; justify-content: center; }
.otp-resend { font-size: 0.85rem; color: #9ca3af; }
.resend-link {
  background: none;
  border: none;
  color: #b5004e;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0;
}
.resend-link:disabled { color: #d1d5db; cursor: not-allowed; text-decoration: none; }
.resend-timer { color: #9ca3af; margin-left: 4px; font-size: 0.82rem; }

/* ── Results Section ──────────────────────────────────────────────────────── */
.results-section {
  max-width: 900px;
  margin: 0 auto 60px;
  padding: 0 20px;
}
.results-title {
  text-align: center;
  font-size: 1.7rem;
  color: #b5004e;
  margin-bottom: 28px;
}

/* Email Banner */
.email-banner {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  border-radius: 10px;
  padding: 14px 20px;
  color: #065f46;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
}

/* Score Ring */
.score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.score-ring {
  position: relative;
  width: 160px;
  height: 160px;
}
.ring-svg { width: 100%; height: 100%; }
.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-num {
  font-size: 2.6rem;
  font-weight: 800;
  color: #b5004e;
  line-height: 1;
}
.score-denom { font-size: 0.9rem; color: #9ca3af; }
.compat-badge {
  padding: 10px 32px;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: #b5004e;
  letter-spacing: 0.5px;
}

/* Dosha Warning */
.dosha-warn {
  background: #fef2f2;
  border-left: 5px solid #ef4444;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #7f1d1d;
  line-height: 1.6;
}

/* Nakshatra Grid */
.nakshatra-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.nakshatra-card {
  flex: 1;
  min-width: 220px;
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.08);
}
.nakshatra-card h3 { font-size: 1rem; margin-bottom: 8px; }
.nakshatra-card p  { font-size: 0.9rem; color: #555; margin: 4px 0; }
.groom-nk { border-left: 5px solid #1a73e8; }
.groom-nk h3 { color: #1a73e8; }
.bride-nk  { border-left: 5px solid #b5004e; }
.bride-nk h3  { color: #b5004e; }

/* Guna Table */
.breakdown-title {
  text-align: center;
  font-size: 1.2rem;
  color: #b5004e;
  margin-bottom: 16px;
}
.guna-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}
.guna-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.guna-table thead tr { background: #b5004e; color: #fff; }
.guna-table th, .guna-table td { padding: 12px 16px; text-align: left; font-size: 0.9rem; }
.guna-table th { font-weight: 700; }
.guna-table tbody tr:nth-child(even) { background: #fdf2f8; }
.guna-table tbody tr:hover { background: #fce7f3; }
.score-bar-cell { width: 160px; }
.score-bar-bg {
  background: #f3f4f6;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-top: 5px;
}
.score-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s ease;
}
.total-row { background: #fff0f5 !important; font-weight: 800; font-size: 1rem; }

.match-id {
  text-align: center;
  margin-top: 20px;
  color: #9ca3af;
  font-size: 0.82rem;
}
.match-id code {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: #6b7280;
}

/* ── City Autocomplete ─────────────────────────────────────────────────── */
.city-autocomplete { position: relative; }
.city-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid #e2d5da;
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 220px; overflow-y: auto;
  z-index: 100; list-style: none; margin: 2px 0; padding: 4px 0;
}
.city-dropdown li {
  padding: 10px 14px; cursor: pointer; font-size: 0.88rem; color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.city-dropdown li:last-child { border-bottom: none; }
.city-dropdown li:hover { background: #fdf2f7; color: #b5004e; }

/* ── Mangal Dosha warning ──────────────────────────────────────────────── */
.mangal-warn { background: #fff7ed; border-color: #f97316; color: #9a3412; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: #1f0010;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 30px 20px;
  font-size: 0.88rem;
  line-height: 1.8;
}
.footer strong { color: #f9a8d4; }

/* ── Optional label ───────────────────────────────────────────────────────── */
.optional {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.78rem;
}

/* ── Responsive: Tablet (≤768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid { gap: 18px; }
  .card { padding: 24px 20px; }
  .results-section { padding: 0 14px; }
  .nakshatra-grid { flex-direction: column; }
  .nakshatra-card { min-width: unset; width: 100%; }
  .score-ring { width: 140px; height: 140px; }
  .score-num { font-size: 2.2rem; }
}

/* ── Responsive: Mobile (≤640px) ─────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Hero */
  .hero { padding: 40px 16px 34px; }
  .logo { font-size: 1.7rem; }
  .tagline { font-size: 1rem; }
  .sub-tagline { font-size: 0.8rem; }

  /* How It Works */
  .how-it-works { margin: 28px auto; }
  .how-it-works h2 { font-size: 1.2rem; margin-bottom: 18px; }
  .step-arrow { display: none; }
  .steps { flex-direction: column; align-items: center; gap: 12px; }
  .step { width: 100%; max-width: 300px; padding: 16px 20px; }

  /* Form */
  .form-section { padding: 0 14px; margin-bottom: 32px; }
  .form-grid { flex-direction: column; gap: 16px; }
  .card { padding: 22px 16px; border-radius: 14px; min-width: unset; }
  .card-title { font-size: 1.05rem; margin-bottom: 16px; }
  .field { margin-bottom: 14px; }
  .field input { padding: 10px 12px; font-size: 0.9rem; }

  /* Submit button */
  .submit-wrap { margin-top: 24px; }
  .submit-btn { padding: 14px 28px; font-size: 0.95rem; width: 100%; justify-content: center; }

  /* OTP */
  .otp-section { padding: 0 14px; }
  .otp-card { padding: 28px 18px; border-radius: 14px; }
  .otp-icon { font-size: 2.4rem; }
  .otp-card h2 { font-size: 1.2rem; }
  .otp-inputs input { font-size: 1.6rem; letter-spacing: 10px; padding: 14px 12px; }

  /* Results */
  .results-section { padding: 0 14px; margin-bottom: 40px; }
  .results-title { font-size: 1.3rem; margin-bottom: 20px; }
  .score-ring { width: 130px; height: 130px; }
  .score-num { font-size: 2rem; }
  .compat-badge { font-size: 0.95rem; padding: 8px 22px; }
  .nakshatra-grid { flex-direction: column; gap: 12px; margin-bottom: 24px; }
  .nakshatra-card { min-width: unset; width: 100%; }
  .breakdown-title { font-size: 1rem; }
  .guna-table th, .guna-table td { padding: 10px 10px; font-size: 0.82rem; }
  .email-banner { font-size: 0.85rem; padding: 12px 14px; }
  .dosha-warn { font-size: 0.85rem; padding: 12px 14px; }

  /* Footer */
  .footer { padding: 24px 16px; font-size: 0.82rem; }
}
