/* ======================================================================
   Zawj & Zawja — Core stylesheet
   Theme: elegant dark with Islamic-modern palette.
   Mobile-first; uses CSS variables and a 12-col responsive flex/grid.
   ====================================================================== */

:root {
  /* Brand palette */
  --black:        #0a0a0a;
  --black-2:      #141414;
  --black-3:      #1c1c1c;
  --line:         #232323;
  --line-soft:    #1f1f1f;

  --red:          #C8102E;   /* Primary CTA — refined crimson */
  --red-hover:    #a50e26;
  --red-soft:     rgba(200,16,46,.12);

  --green:        #1a8c5a;   /* Islamic green — accent only */
  --green-soft:   rgba(26,140,90,.14);

  --white:        #ffffff;
  --text:         #ececec;
  --text-mute:    #b3b3b3;
  --text-faint:   #7a7a7a;

  --gold:         #d4af37;   /* Verified badge, premium */
  --warn:         #e0a800;
  --danger:       #d63838;
  --success:      #2bb673;

  /* Radii & shadows */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,.5);
  --shadow-glow: 0 0 0 3px rgba(200,16,46,.18);

  /* Type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  /* Container */
  --container: 1180px;

  /* Bottom-nav height (mobile) */
  --bnav-h: 64px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--black); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }

body { min-height: 100vh; line-height: 1.55; }

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--white); }

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

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--white); margin: 0 0 .6em; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw + 1rem, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2vw + 1rem, 2.2rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text-mute); margin: 0 0 1em; }

::selection { background: var(--red); color: var(--white); }

/* ---------- Layout ---------- */

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 18px; }

.section { padding: 56px 0; }
@media (min-width: 768px) { .section { padding: 88px 0; } }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.flex { display: flex; gap: 12px; align-items: center; }
.flex.col { flex-direction: column; align-items: stretch; }
.flex.between { justify-content: space-between; }
.flex.center { justify-content: center; align-items: center; }
.flex.wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-mute { color: var(--text-mute); }
.text-faint { color: var(--text-faint); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-gold { color: var(--gold); }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; } .mt-5 { margin-top: 56px; }

.hidden { display: none !important; }

/* ---------- Navigation ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,10,.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; color: var(--white); font-weight: 600; letter-spacing: -.01em; }
.brand .crescent {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--green));
  box-shadow: inset -8px 0 0 0 var(--black);
  display: inline-block;
}
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--text-mute); font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--white); }
.nav-cta { display: flex; gap: 10px; }
.burger { display: none; background: none; border: 0; color: var(--white); cursor: pointer; padding: 6px; }
@media (max-width: 820px) {
  .nav { display: none; position: fixed; inset: 64px 0 auto 0; background: var(--black-2); padding: 18px; flex-direction: column; align-items: stretch; gap: 14px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav-cta { flex-direction: column; }
  .burger { display: inline-flex; }
}

/* Bottom mobile nav (PWA-style) */
.bottom-nav { display: none; }
@media (max-width: 820px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(10,10,10,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); height: var(--bnav-h); padding-bottom: env(safe-area-inset-bottom);
    justify-content: space-around; align-items: center;
  }
  .bottom-nav a {
    flex: 1; text-align: center; padding: 8px 4px; color: var(--text-faint);
    font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .bottom-nav a.active { color: var(--white); }
  .bottom-nav a svg { width: 22px; height: 22px; }
  body.has-bnav { padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-pill); border: 0;
  background: var(--black-3); color: var(--white); font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: transform .12s ease, background .12s ease, color .12s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--red); }
.btn.primary:hover { background: var(--red-hover); }
.btn.outline { background: transparent; border: 1px solid var(--line); }
.btn.outline:hover { border-color: var(--white); }
.btn.ghost { background: transparent; color: var(--text-mute); }
.btn.ghost:hover { color: var(--white); }
.btn.green { background: var(--green); }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: .85rem; }
.btn.lg { padding: 16px 28px; font-size: 1rem; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; color: var(--text-mute); margin-bottom: 6px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; background: var(--black-3); color: var(--white);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; font: inherit; font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--red); box-shadow: var(--shadow-glow);
}
.input::placeholder { color: var(--text-faint); }
.textarea { resize: vertical; min-height: 90px; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 6px; }
.field-help  { color: var(--text-faint); font-size: .82rem; margin-top: 6px; }

.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { accent-color: var(--red); width: 16px; height: 16px; }

/* ---------- Cards ---------- */

.card {
  background: var(--black-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 22px;
}
.card.pad-sm { padding: 16px; }
.card.pad-lg { padding: 32px; }
.card.hover:hover { border-color: var(--line); }

/* Profile card (used in discovery feeds) */
.profile-card {
  position: relative; aspect-ratio: 3/4; overflow: hidden;
  border-radius: var(--r-lg); background: var(--black-2);
  border: 1px solid var(--line-soft);
}
.profile-card img { width: 100%; height: 100%; object-fit: cover; }
.profile-card .meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.85));
  color: var(--white);
}
.profile-card .meta .name { font-weight: 600; font-size: 1.05rem; }
.profile-card .meta .sub  { font-size: .82rem; color: rgba(255,255,255,.78); }
.profile-card .badge-verified {
  position: absolute; top: 10px; right: 10px; background: var(--gold); color: var(--black);
  border-radius: var(--r-pill); padding: 4px 10px; font-size: .72rem; font-weight: 700;
}
.profile-card .badge-online {
  position: absolute; top: 10px; left: 10px; background: var(--green);
  width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(26,140,90,.35);
}

/* ---------- Hero (landing) ---------- */

.hero {
  position: relative; padding: 64px 0 88px;
  background:
    radial-gradient(800px 400px at 80% -100px, rgba(200,16,46,.18), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, rgba(26,140,90,.14), transparent 60%),
    var(--black);
  overflow: hidden;
}
.hero h1 { margin-bottom: 18px; }
.hero .tagline { color: var(--text-mute); font-size: clamp(1rem, 1.4vw, 1.2rem); max-width: 640px; }
.hero .ar { font-family: 'Amiri', 'Noto Naskh Arabic', serif; font-size: 1.3rem; color: var(--gold); margin-bottom: 18px; opacity: .9; }
.hero .actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .preview {
  margin-top: 56px; display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 640px) { .hero .preview { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Feature blocks ---------- */
.feature { padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line-soft); background: var(--black-2); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature h3 { color: var(--white); margin-bottom: 8px; font-family: var(--font); font-weight: 600; font-size: 1.05rem; }
.feature p  { color: var(--text-mute); font-size: .93rem; margin: 0; }

/* ---------- Footer ---------- */
.footer {
  background: var(--black-2); border-top: 1px solid var(--line-soft);
  padding: 48px 0 28px; color: var(--text-mute);
}
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } }
.footer h4 { color: var(--white); font-family: var(--font); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer a { display: block; padding: 4px 0; color: var(--text-mute); font-size: .9rem; }
.footer a:hover { color: var(--white); }
.footer .legal { border-top: 1px solid var(--line-soft); margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; font-size: .82rem; }
@media (max-width: 600px) { .footer .legal { flex-direction: column; gap: 8px; } }

/* ---------- Alerts / flash ---------- */
.alert {
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--black-2);
}
.alert.success { border-color: rgba(43,182,115,.4); background: rgba(43,182,115,.08); color: #c8f0dc; }
.alert.error   { border-color: rgba(214,56,56,.4); background: rgba(214,56,56,.08); color: #f5c8c8; }
.alert.info    { border-color: rgba(200,16,46,.4); background: rgba(200,16,46,.08); color: #f4cdd4; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: calc(100vh - 80px); display: flex; align-items: center; padding: 40px 0;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(200,16,46,.12), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(26,140,90,.10), transparent 60%);
}
.auth-card { max-width: 460px; margin: 0 auto; width: 100%; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 8px; }
.auth-card .sub { color: var(--text-mute); margin-bottom: 24px; font-size: .95rem; }
.auth-card .alt { text-align: center; margin-top: 18px; color: var(--text-mute); font-size: .9rem; }
.auth-card .alt a { color: var(--red); font-weight: 500; }

/* Strength meter */
.pw-meter { height: 6px; background: var(--black-3); border-radius: var(--r-pill); margin-top: 6px; overflow: hidden; }
.pw-meter > span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--black-3), var(--line), var(--black-3)); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius: var(--r-md); }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Utility */
.divider { height: 1px; background: var(--line-soft); margin: 24px 0; }

/* Install prompt banner */
.install-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70;
  background: var(--black-2); border: 1px solid var(--line);
  padding: 14px 16px; border-radius: var(--r-lg); display: none;
  align-items: center; gap: 12px; box-shadow: var(--shadow-2);
}
.install-banner.show { display: flex; }
.install-banner p { margin: 0; flex: 1; font-size: .9rem; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
