/* ==========================================================================
   نوّرات (Nawwarat) — الأنماط العامة
   Shared styles for the landing page (index.html) and terms page (terms.html).
   RTL, mobile-first, high-contrast, large legible type for accessibility.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  /* Palette drawn from the app splash: dusk navy, warm lamp-gold, teal, cream */
  --gold:        #E6A400;   /* primary accent / CTAs — "light" */
  --gold-soft:   #F6C948;
  --gold-deep:   #C98A00;
  --teal:        #16756B;   /* secondary — trust, calm */
  --teal-deep:   #0E5249;
  --teal-tint:   #E3F0ED;
  --navy:        #10233E;   /* dark sections / headings */
  --navy-2:      #17335A;
  --cream:       #FBF6EC;   /* page background */
  --surface:     #FFFFFF;
  --ink:         #1D2A37;   /* body text — high contrast on cream */
  --muted:       #566573;
  --line:        #E7DFCF;   /* warm hairline borders */

  --radius:      18px;
  --radius-lg:   28px;
  --shadow-sm:   0 2px 10px rgba(16, 35, 62, 0.06);
  --shadow-md:   0 10px 30px rgba(16, 35, 62, 0.10);
  --shadow-lg:   0 24px 60px rgba(16, 35, 62, 0.16);

  --maxw:        1160px;

  /* Fluid type scale — generous sizes for elderly / low-vision users */
  --fs-body:     clamp(1.05rem, 0.9rem + 0.6vw, 1.25rem);
  --fs-lead:     clamp(1.2rem, 1rem + 0.9vw, 1.6rem);
  --fs-h2:       clamp(1.7rem, 1.3rem + 2vw, 2.6rem);
  --fs-h1:       clamp(2.1rem, 1.5rem + 3.4vw, 3.8rem);
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Cairo", system-ui, "Segoe UI", Tahoma, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.85;               /* airy leading aids readability in Arabic */
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Tajawal", "Cairo", sans-serif; line-height: 1.3; color: var(--navy); }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
a { color: var(--teal-deep); }

/* Visible focus ring for keyboard users (accessibility) */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link — jump straight to main content */
.skip-link {
  position: absolute; right: 12px; top: -60px;
  background: var(--navy); color: #fff; padding: 10px 18px;
  border-radius: 10px; z-index: 200; transition: top .2s;
  text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---- Layout helpers ----------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(48px, 6vw, 96px); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto clamp(30px, 4vw, 56px); }
.section-head h2 { font-size: var(--fs-h2); margin: 0 0 .5em; }
.section-head p { font-size: var(--fs-lead); color: var(--muted); margin: 0; }
.eyebrow {
  display: inline-block; font-weight: 800; color: var(--gold-deep);
  background: #fff3d6; border: 1px solid #f2dfa6;
  padding: 6px 16px; border-radius: 999px; font-size: .95rem;
  margin-bottom: 16px; letter-spacing: .01em;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font: inherit; font-weight: 800; font-size: 1.15rem;
  padding: 16px 34px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
  min-height: 56px;                /* large hit target */
}
.btn svg { width: 22px; height: 22px; }
.btn-primary { background: var(--gold); color: #3a2900; box-shadow: 0 8px 22px rgba(230,164,0,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(230,164,0,.45); background: var(--gold-soft); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.22); transform: translateY(-2px); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 8px 22px rgba(22,117,107,.30); }
.btn-teal:hover { transform: translateY(-2px); background: var(--teal-deep); }

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 246, 236, 0.88);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-chip { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: #16756B; display: grid; place-items: center; }
.brand-chip svg { width: 28px; height: 28px; }
.brand-name { font-family: "Tajawal", sans-serif; font-weight: 900; font-size: 1.7rem; color: var(--navy); }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.05rem;
  padding: 10px 16px; border-radius: 12px; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--teal-tint); color: var(--teal-deep); }
.nav-cta { margin-inline-start: 8px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: none; border: 2px solid var(--line); border-radius: 12px;
  width: 52px; height: 52px; cursor: pointer; color: var(--navy);
}
.nav-toggle svg { width: 26px; height: 26px; margin: auto; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; overflow: hidden; }
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(30px, 5vw, 72px);
  align-items: center; padding-block: clamp(40px, 6vw, 88px);
}
.hero-copy h1 { font-size: var(--fs-h1); margin: 0 0 .4em; letter-spacing: -0.01em; }
.hero-copy .lead { font-size: var(--fs-lead); color: var(--muted); margin: 0 0 1.6em; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-note { margin-top: 22px; color: var(--muted); font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.hero-note svg { width: 22px; height: 22px; color: var(--teal); flex: 0 0 auto; }

/* Phone-style frame around the splash image */
.hero-visual { display: flex; justify-content: center; }
.phone {
  position: relative; width: min(320px, 78vw);
  border-radius: 44px; padding: 12px;
  background: linear-gradient(160deg, #1b3050, #0d1c33);
  box-shadow: var(--shadow-lg);
}
.phone::before {   /* speaker notch */
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.25); z-index: 2;
}
.phone img { width: 100%; border-radius: 34px; display: block; }

/* Auto-sliding image carousel inside the phone */
.slider { position: relative; width: 100%; border-radius: 34px; overflow: hidden; aspect-ratio: 1170 / 2532; background: #0d1c33; }
.slider .slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 34px; opacity: 0; transition: opacity .9s ease;
}
.slider .slide.is-active { opacity: 1; }
.slider-dots {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 9px; z-index: 3;
}
.slider-dots button {
  width: 9px; height: 9px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.45); transition: width .3s, background .3s;
}
.slider-dots button[aria-selected="true"] { width: 24px; background: var(--gold); }
@media (prefers-reduced-motion: reduce) {
  .slider .slide { transition: none; }
}
.hero-glow {   /* warm radial glow behind the phone */
  position: absolute; inset: -20% 20% auto -10%; height: 420px;
  background: radial-gradient(circle at 60% 40%, rgba(246,201,72,.35), transparent 60%);
  pointer-events: none; z-index: -1;
}

/* ==========================================================================
   Problem / solution
   ========================================================================== */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 48px);
  align-items: stretch;
}
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(26px, 3vw, 40px);
  box-shadow: var(--shadow-sm);
}
.panel h3 { font-size: 1.5rem; margin: 0 0 .5em; display: flex; align-items: center; gap: 12px; }
.panel .ic { width: 40px; height: 40px; flex: 0 0 auto; }
.panel.problem { background: #fff8f2; border-color: #f3e2d3; }
.panel.solution { background: var(--teal-tint); border-color: #cfe6e0; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; }
.check-list svg { width: 26px; height: 26px; color: var(--teal); flex: 0 0 auto; margin-top: 4px; }

/* ==========================================================================
   Features
   ========================================================================== */
.features { background: linear-gradient(180deg, #fff 0%, var(--cream) 100%); }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: #fff3d6; color: var(--gold-deep); margin-bottom: 18px;
}
.feature-icon.teal { background: var(--teal-tint); color: var(--teal-deep); }
.feature-icon svg { width: 34px; height: 34px; }
.feature-card h3 { font-size: 1.35rem; margin: 0 0 .4em; }
.feature-card p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* ==========================================================================
   Audiences — "لمن نوّرات؟"
   ========================================================================== */
.audience { background: var(--navy); color: #eaf1f8; position: relative; overflow: hidden; }
.audience .section-head h2 { color: #fff; }
.audience .section-head p { color: #b9c8da; }
.audience-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px;
}
.audience-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 30px 26px; backdrop-filter: blur(4px);
}
.audience-card .emoji {
  font-size: 2.4rem; line-height: 1; margin-bottom: 14px; display: block;
}
.audience-card h3 { color: #fff; font-size: 1.3rem; margin: 0 0 .4em; }
.audience-card p { color: #c3d1e0; margin: 0; font-size: 1.02rem; }
/* faint geometric pattern echoing the splash */
.audience::after {
  content: ""; position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: radial-gradient(circle, #ffd97a 1.5px, transparent 1.6px);
  background-size: 26px 26px;
}
.audience .container { position: relative; z-index: 1; }

/* ==========================================================================
   How it works — steps
   ========================================================================== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 40px 28px 30px; box-shadow: var(--shadow-sm); text-align: center; }
.step-num {
  counter-increment: step; width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.7rem;
  color: #3a2900; background: var(--gold-soft); box-shadow: 0 6px 16px rgba(230,164,0,.3);
}
.step-num::before { content: counter(step); }
.step h3 { font-size: 1.3rem; margin: 0 0 .4em; }
.step p { margin: 0; color: var(--muted); }
/* connector arrows between steps (RTL: point leftwards) */
.step:not(:first-child)::after {
  content: ""; position: absolute; top: 70px; inset-inline-start: -14px;
  width: 28px; height: 3px; background: var(--line);
}

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: #fff; border-radius: var(--radius-lg); text-align: center;
  padding: clamp(40px, 5vw, 66px); box-shadow: var(--shadow-md);
}
.cta-band h2 { color: #fff; font-size: var(--fs-h2); margin: 0 0 .4em; }
.cta-band p { color: #d5ece7; font-size: var(--fs-lead); margin: 0 0 1.4em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy); color: #c9d6e4; padding-block: 56px 30px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; margin-bottom: 34px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: #a9bacd; max-width: 34ch; margin-top: 14px; }
.footer-col h4 { color: #fff; font-size: 1.15rem; margin: 0 0 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer-col a { color: #c9d6e4; text-decoration: none; }
.footer-col a:hover { color: var(--gold-soft); text-decoration: underline; }
.social { display: flex; gap: 12px; margin-top: 18px; }
.social a {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: #fff; transition: background .15s;
}
.social a:hover { background: var(--gold); color: #3a2900; }
.social svg { width: 22px; height: 22px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between;
  color: #97a9bd; font-size: .98rem;
}
.footer-bottom a { color: #c9d6e4; }

/* ==========================================================================
   Terms page
   ========================================================================== */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff;
  padding-block: clamp(44px, 6vw, 80px); text-align: center;
}
.page-hero h1 { color: #fff; font-size: var(--fs-h1); margin: 0 0 .3em; }
.page-hero p { color: #b9c8da; font-size: var(--fs-lead); margin: 0; }
.legal { max-width: 820px; margin-inline: auto; }
.disclaimer {
  background: #fff8ec; border: 1px solid #f0dcaf; border-inline-start: 6px solid var(--gold);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 40px;
  display: flex; gap: 16px; align-items: flex-start;
}
.disclaimer svg { width: 34px; height: 34px; color: var(--gold-deep); flex: 0 0 auto; }
.disclaimer strong { color: var(--navy); }
.legal-section { margin-bottom: 34px; }
.legal-section h2 {
  font-size: 1.55rem; margin: 0 0 .5em; padding-bottom: 10px;
  border-bottom: 2px solid var(--line); display: flex; align-items: center; gap: 12px;
}
.legal-section h2 .num {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: var(--teal-tint);
  color: var(--teal-deep); display: grid; place-items: center; font-size: 1.15rem; font-weight: 900;
}
.legal-section p, .legal-section li { color: var(--ink); }
.legal-section ul { padding-inline-start: 22px; }
.legal-section li { margin-bottom: 8px; }
.back-link {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 800;
  color: var(--teal-deep); text-decoration: none; margin-top: 20px;
}
.back-link:hover { text-decoration: underline; }
.back-link svg { width: 20px; height: 20px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-note { justify-content: center; }
  .hero-visual { order: -1; }
  .split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step:not(:first-child)::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  /* Collapse nav links into a toggle-able menu */
  .nav-toggle { display: grid; }
  .nav-links {
    position: absolute; inset-inline: 12px; top: 74px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px; box-shadow: var(--shadow-md); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 16px; font-size: 1.15rem; }
  .nav-cta { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
