/* ================================================================
   MyNikkahOnline — Main Stylesheet
   Glassmorphism + Islamic Matrimonial Design System
   ================================================================ */

/* ── Google Fonts (loaded via <link> in base.html) ───────────────────── */

/* ── CSS Custom Properties ───────────────────────────────────────────── */
:root {
  /* Brand colours */
  --maroon:        #8B1A4A;
  --maroon-deep:   #5C1030;
  --maroon-light:  #B5215E;
  --gold:          #C8A84B;
  --gold-light:    #E8C96A;
  --navy:          #1B3A6B;
  --green:         #1A6B3C;
  --cream:         #FDF8F3;
  --white:         #FFFFFF;
  --text:          #1E1E1E;
  --muted:         #6B6B6B;
  --border:        #E8D5C4;

  /* Glassmorphism */
  --glass:         rgba(255, 255, 255, 0.12);
  --glass-border:  rgba(255, 255, 255, 0.20);
  --glass-shadow:  0 8px 32px rgba(0, 0, 0, 0.20);

  /* Hero gradient */
  --gradient-hero: linear-gradient(135deg, #3A0A1E 0%, #8B1A4A 45%, #C8761A 100%);

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  /* Transitions */
  --transition: 0.25s ease;
}

/* ── Reset & Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Lato', 'Segoe UI', Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--maroon); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--maroon-light); }

ul, ol { list-style: none; }

/* ── Typography ──────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--maroon-deep);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }

/* ── Container ───────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navbar ──────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background var(--transition), backdrop-filter var(--transition),
              box-shadow var(--transition), padding var(--transition);
}

.navbar.transparent {
  background: transparent;
}

.navbar.scrolled {
  background: rgba(92, 16, 48, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-logo img {
  height: 48px;
  width: auto;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.nav-link:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.08);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Bell */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all var(--transition);
  line-height: 1;
}
.notification-bell:hover { background: rgba(255, 255, 255, 0.12); color: var(--gold); }
.notification-bell .badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--gold);
  color: var(--maroon-deep);
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50%;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.hamburger:hover { background: rgba(255, 255, 255, 0.1); }
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(92, 16, 48, 0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link {
  font-size: 1.4rem;
  font-family: 'Playfair Display', serif;
  color: white;
  padding: 0.75rem 2rem;
}
.mobile-nav-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background var(--transition);
}
.mobile-nav-close:hover { background: rgba(255, 255, 255, 0.1); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-primary {
  background: var(--gradient-hero);
  color: white;
  border-color: transparent;
}
.btn-primary:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 26, 74, 0.4);
  color: white;
}

.btn-outline {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: white;
  color: white;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--maroon-deep);
  border-color: transparent;
}
.btn-gold:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 168, 75, 0.4);
  color: var(--maroon-deep);
}

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Glassmorphism Card ───────────────────────────────────────────────── */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

/* Light glass (for cream backgrounds) */
.glass-card-light {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(139, 26, 74, 0.08);
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.glass-card-light:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(139, 26, 74, 0.14);
}

/* ── Section Layout ──────────────────────────────────────────────────── */
.section {
  padding: 5rem 0;
}
.section-sm { padding: 3rem 0; }
.section-lg { padding: 7rem 0; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* Gold decorative line */
.section-divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  margin: 1rem auto 1.5rem;
  border-radius: 2px;
}

/* ── Grid Helpers ────────────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Form Styles ─────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.35rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--maroon-deep);
  margin-bottom: 0.4rem;
}
.form-label span.required { color: var(--maroon-light); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(139, 26, 74, 0.12);
}
.form-control.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}
.form-control::placeholder { color: #aaa; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C1030' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.form-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* Password toggle */
.input-group {
  position: relative;
}
.input-group .form-control { padding-right: 2.8rem; }
.input-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.2rem;
  transition: color var(--transition);
}
.input-toggle:hover { color: var(--maroon); }

/* ── Toast Notifications ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  border-left: 4px solid var(--maroon);
  animation: slideIn 0.3s ease forwards;
  position: relative;
  overflow: hidden;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: #dc2626; }
.toast.warning { border-left-color: var(--gold); }
.toast.info    { border-left-color: var(--navy); }

.toast-icon { font-size: 1.2rem; margin-top: 0.05rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.875rem; color: var(--text); }
.toast-message { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; padding: 0 0.2rem;
  line-height: 1; transition: color var(--transition);
}
.toast-close:hover { color: var(--text); }
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: var(--maroon);
  animation: toastProgress 4s linear forwards;
}
.toast.success .toast-progress { background: var(--green); }
.toast.error   .toast-progress { background: #dc2626; }
.toast.warning .toast-progress { background: var(--gold); }
.toast.info    .toast-progress { background: var(--navy); }

@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0);    opacity: 1; max-height: 200px; margin-bottom: 0.75rem; }
  to   { transform: translateX(110%); opacity: 0; max-height: 0;     margin-bottom: 0; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}
.toast.removing { animation: slideOut 0.35s ease forwards; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  background: var(--maroon-deep);
  color: rgba(255, 255, 255, 0.82);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand img { height: 50px; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; color: rgba(255, 255, 255, 0.65); max-width: 280px; }

.footer-col h4 {
  color: var(--gold);
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col ul li a {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--gold-light); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.75rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-disclaimer {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-style: italic;
}

/* ── Badges / Pills ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold    { background: rgba(200, 168, 75, 0.15); color: var(--gold); }
.badge-green   { background: rgba(26, 107, 60, 0.12);  color: var(--green); }
.badge-maroon  { background: rgba(139, 26, 74, 0.12);  color: var(--maroon); }
.badge-navy    { background: rgba(27, 58, 107, 0.12);  color: var(--navy); }

/* ── Alert Banners ───────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.alert-success { background: rgba(26, 107, 60, 0.1);  border: 1px solid rgba(26, 107, 60, 0.3); color: var(--green); }
.alert-error   { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.3); color: #dc2626; }
.alert-warning { background: rgba(200, 168, 75, 0.12); border: 1px solid rgba(200, 168, 75, 0.35); color: #8a6c00; }
.alert-info    { background: rgba(27, 58, 107, 0.08); border: 1px solid rgba(27, 58, 107, 0.25); color: var(--navy); }

/* ── OTP Input ───────────────────────────────────────────────────────── */
.otp-group {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
}
.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--maroon-deep);
}
.otp-input:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(139, 26, 74, 0.15);
}
.otp-input.filled { border-color: var(--maroon); background: rgba(139, 26, 74, 0.04); }

/* ── Auth Page Layout ────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  padding: 2.5rem;
  position: relative;
}
.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-card-header .auth-logo { height: 48px; margin: 0 auto 1.25rem; }
.auth-card-header h1 { font-size: 1.7rem; color: var(--maroon-deep); margin-bottom: 0.4rem; }
.auth-card-header p { color: var(--muted); font-size: 0.9rem; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-footer-text a { color: var(--maroon); font-weight: 600; }
.auth-footer-text a:hover { color: var(--maroon-light); }

/* ── Loading spinner ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1em; height: 1em;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility classes ─────────────────────────────────────────────────── */
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--muted); }
.text-gold     { color: var(--gold); }
.text-maroon   { color: var(--maroon); }
.text-white    { color: white; }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.78rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex     { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1      { gap: 0.5rem; }
.gap-2      { gap: 1rem; }

.w-full     { width: 100%; }
.sr-only    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Hide navbar entirely (used on registration page) */
.navbar.hidden { display: none; }

/* ── Mobile breakpoint ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-nav   { display: none; }
  .hamburger    { display: flex; }
  .auth-card    { padding: 1.75rem 1.25rem; }
  .section      { padding: 3.5rem 0; }
  .footer-grid  { gap: 1.5rem; }
  h1 { font-size: 2rem; }
}
