/**
 * GG DIET marketing site — shared styles for index.html and register.html.
 * Palette mirrors the app (GitHub-dark + brand green) so site and product
 * read as one product. Logical properties are used where possible so the
 * Arabic (RTL) layout mirrors without a separate stylesheet.
 */

:root {
  --bg: #0d1117;
  --bg-soft: #10151d;
  --surface: #161b22;
  --surface-2: #1b2230;
  --border: #263041;
  --text: #e6edf3;
  --muted: #98a4b3;
  --green: #3fb950;
  --green-bright: #56d364;
  --gold: #eac54f;
  --radius: 16px;
  --maxw: 1160px;
}

/* Light theme. Every colour above is a token, so the page flips by redefining
   them. Applied with data-theme="light" on <html>; absent means dark.
   The greens are darkened from the dark-theme values — #3fb950 measures ~2.3:1
   on white, well under AA, so link and button text would be unreadable. */
:root[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-soft: #F6F8FA;
  --surface: #FFFFFF;
  --surface-2: #F0F3F6;
  --border: #D8DEE4;
  --text: #1F2328;
  --muted: #59636E;
  --green: #1A7F37;
  --green-bright: #116329;
  --gold: #7D4E00;
}

/* Filled buttons carry near-black text on the bright dark-mode green; against
   the darker light-mode green that inverts to white. */
:root[data-theme="light"] .plan .tag { color: #FFFFFF; }
:root[data-theme="light"] .btn-primary { color: #FFFFFF; box-shadow: 0 6px 20px rgba(26,127,55,.22); }
:root[data-theme="light"] .btn-primary:hover { box-shadow: 0 10px 28px rgba(26,127,55,.3); }
:root[data-theme="light"] .bill-switch button.active { background: var(--green); color: #FFFFFF; }
:root[data-theme="light"] header { background: rgba(255,255,255,.82); }
:root[data-theme="light"] .brand .logo { color: #FFFFFF; }
/* The hero glow is tuned for a dark backdrop and reads as a smudge on white. */
:root[data-theme="light"] .hero::before { opacity: .35; }
:root[data-theme="light"] .mock { box-shadow: 0 20px 50px rgba(31,35,40,.12); }
:root[data-theme="light"] .float-tag { box-shadow: 0 12px 30px rgba(31,35,40,.15); }
:root[data-theme="light"] .flag { color: #6b4b00; }

/* Theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; font-size: 15px; line-height: 1;
  transition: border-color .18s, background .18s;
}
.theme-toggle:hover { border-color: var(--green); background: var(--surface-2); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, .brand-mark { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.02em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  font-family: 'Noto Sans Arabic', 'Space Grotesk', sans-serif; letter-spacing: 0;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }
.accent { color: var(--green-bright); }
.gold { color: var(--gold); }

/* ---------- Nav ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(13, 17, 23, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; flex-shrink: 0; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--green), #2ea043);
  display: grid; place-items: center; color: #04130a; font-weight: 800;
  font-family: 'Space Grotesk'; box-shadow: 0 4px 16px rgba(63,185,80,.35);
  flex-shrink: 0;
}
.brand-mark { font-size: 18px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a.link { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a.link:hover { color: var(--text); }

/* ---------- Segmented switches (lang / currency / billing) ---------- */
.switch {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.switch button {
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: none; border: 0; border-radius: 6px; padding: 6px 11px; cursor: pointer;
  transition: background .18s, color .18s; white-space: nowrap;
}
.switch button:hover { color: var(--text); }
.switch button.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.bill-switch button.active { background: var(--green); color: #04130a; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 15px; border-radius: 10px; padding: 11px 20px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn-primary { background: var(--green); color: #04130a; box-shadow: 0 6px 20px rgba(63,185,80,.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(63,185,80,.4); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: #3a475c; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 88px 0 64px; }
.hero::before {
  content: ''; position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 620px;
  background: radial-gradient(circle at center, rgba(63,185,80,.18), transparent 62%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 22px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 10px var(--green-bright); flex-shrink: 0; }
.hero h1 { font-size: 56px; line-height: 1.05; font-weight: 700; margin-bottom: 20px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--green-bright), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lede { font-size: 19px; color: var(--muted); max-width: 520px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.subnote { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

/* ---------- App mock ---------- */
.mock {
  position: relative; background: linear-gradient(160deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: 22px; padding: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.mock-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mock-top .u { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.mock-top .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#3fb950,#2ea043); flex-shrink: 0; }
.mock-kcal { font-size: 13px; color: var(--muted); }
.ring-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; display: flex; align-items: center; gap: 22px; margin-bottom: 14px;
}
.ring { position: relative; width: 108px; height: 108px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-size: 24px; font-family: 'Space Grotesk'; }
.ring .val span { font-size: 11px; color: var(--muted); display: block; }
.macros { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.macro .lbl { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.bar { height: 7px; border-radius: 4px; background: #0d1117; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; }
.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.mini .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mini .v { font-size: 20px; font-weight: 700; font-family: 'Space Grotesk'; margin-top: 6px; }
.flag {
  margin-top: 14px; background: rgba(234,197,79,.08); border: 1px solid rgba(234,197,79,.3);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #f2d98a;
  display: flex; gap: 10px; align-items: flex-start;
}
.float-tag {
  position: absolute; inset-inline-end: -14px; top: 44px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.5);
  display: flex; align-items: center; gap: 9px; animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-9px);} }
.float-tag .cam { width: 26px; height: 26px; border-radius: 7px; background: rgba(63,185,80,.15); display: grid; place-items: center; flex-shrink: 0; }

/* ---------- Section shells ---------- */
section.block { padding: 84px 0; }
section.band { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow { color: var(--green-bright); font-weight: 600; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: 38px; line-height: 1.12; margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 17px; }

.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 34px 0; }
.stat { text-align: center; }
.stat b { display: block; font-family: 'Space Grotesk'; font-size: 30px; }
.stat span { color: var(--muted); font-size: 14px; }

.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  transition: transform .2s, border-color .2s, background .2s;
}
.card:hover { transform: translateY(-4px); border-color: #38455a; background: var(--surface-2); }
.card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; font-size: 22px; background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.22); }
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14.5px; }

.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; counter-reset: s; }
.step { position: relative; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before {
  counter-increment: s; content: counter(s); position: absolute; top: 24px; inset-inline-end: 24px;
  font-family: 'Space Grotesk'; font-size: 44px; font-weight: 700; color: rgba(63,185,80,.18);
}
.step h3 { font-size: 18px; margin: 12px 0 8px; }
.step p { color: var(--muted); font-size: 14.5px; }
.step .ic { font-size: 26px; }

.companion { background: linear-gradient(135deg, var(--surface), var(--bg-soft)); border: 1px solid var(--border); border-radius: 22px; padding: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.companion h2 { font-size: 30px; margin-bottom: 14px; }
.companion p { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.snap-demo { display: flex; align-items: center; justify-content: center; gap: 16px; }
.snap-photo { width: 150px; height: 150px; border-radius: 16px; background: linear-gradient(135deg,#2a3342,#1b2230); border: 1px solid var(--border); display: grid; place-items: center; font-size: 48px; flex-shrink: 0; }
.snap-arrow { font-size: 26px; color: var(--green-bright); }
html[dir="rtl"] .snap-arrow { transform: scaleX(-1); }
.snap-out { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; min-width: 150px; }
.snap-out .big { font-family: 'Space Grotesk'; font-size: 26px; font-weight: 700; }
.snap-out .big small { font-size: 13px; }
.snap-out small { color: var(--muted); }
.snap-out .li { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; gap: 12px; }

/* ---------- Pricing ---------- */
.price-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 34px; flex-wrap: wrap; }
.price-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; max-width: 780px; margin: 0 auto; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px; position: relative; }
.plan.pro { border-color: rgba(234,197,79,.4); background: linear-gradient(180deg, rgba(234,197,79,.05), var(--surface)); }
.plan .tag { position: absolute; top: 22px; inset-inline-end: 22px; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; background: var(--gold); color: #1a1300; }
.plan h3 { font-size: 22px; margin-bottom: 6px; }
.plan .amt { font-family: 'Space Grotesk'; font-size: 40px; font-weight: 700; margin: 8px 0 4px; }
.plan .amt small { font-size: 15px; color: var(--muted); font-weight: 500; font-family: 'Inter'; }
.plan .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-bottom: 26px; }
.plan li { display: flex; gap: 10px; font-size: 14.5px; color: #cdd6e0; }
.plan li .ck { color: var(--green-bright); flex-shrink: 0; }
.plan.pro li .ck { color: var(--gold); }
.plan .btn { width: 100%; }
.price-note { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 22px; }

.cta-band { text-align: center; background: linear-gradient(135deg, rgba(63,185,80,.12), rgba(234,197,79,.06)); border: 1px solid var(--border); border-radius: 24px; padding: 56px 32px; }
.cta-band h2 { font-size: 36px; margin-bottom: 14px; }
.cta-band p { color: var(--muted); font-size: 17px; max-width: 520px; margin: 0 auto 28px; }

footer.site { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.foot .muted { color: var(--muted); font-size: 13.5px; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--muted); font-size: 14px; }
.foot-links a:hover { color: var(--text); }

/* ---------- Register page ---------- */
.auth-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; gap: 16px; flex-wrap: wrap; }
.back-link { color: var(--muted); font-size: 14.5px; }
.back-link:hover { color: var(--text); }

.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 40px; }
.stepper .s { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.stepper .s .n {
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 700;
}
.stepper .s.active { color: var(--text); }
.stepper .s.active .n { background: var(--green); border-color: var(--green); color: #04130a; }
.stepper .s.done .n { background: rgba(63,185,80,.15); border-color: var(--green); color: var(--green-bright); }
.stepper .sep { width: 46px; height: 1px; background: var(--border); }

.auth-card { max-width: 460px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 34px; }
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-card .lede { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 7px; color: #cdd6e0; }
.field input[type="text"], .field input[type="email"], .field input[type="password"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 15px;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(63,185,80,.15); }
.field input.bad { border-color: #f47067; }
.err { color: #f47067; font-size: 12.5px; margin-top: 6px; min-height: 16px; }

.strength { display: flex; gap: 5px; margin-top: 8px; align-items: center; }
.strength .seg { height: 4px; flex: 1; border-radius: 2px; background: var(--border); transition: background .2s; }
.strength .txt { font-size: 12px; color: var(--muted); min-width: 52px; text-align: end; }

.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 22px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; }
.check label { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.auth-card .btn { width: 100%; }
.alt { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.alt a { color: var(--green-bright); font-weight: 600; }

.done-card { max-width: 520px; margin: 0 auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 44px 34px; }
.done-card .tick { width: 62px; height: 62px; border-radius: 50%; background: rgba(63,185,80,.15); border: 1px solid var(--green); display: grid; place-items: center; font-size: 30px; margin: 0 auto 20px; }
.done-card h2 { font-size: 26px; margin-bottom: 10px; }
.done-card p { color: var(--muted); margin-bottom: 26px; }
.unlock { text-align: start; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 26px; }
.unlock ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; }
.unlock li { font-size: 14px; color: #cdd6e0; }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 42px; }
  .features, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); gap: 28px 16px; }
  .companion, .price-grid { grid-template-columns: 1fr; }
  .companion { padding: 30px; }
  .nav-links a.link { display: none; }
  .nav { gap: 10px; }
}
/* Below ~430px the header still overflowed: the brand, the four-way language
   switch and the "Get started" button together measured ~418px against a 375px
   viewport, which scrolled the whole page sideways. Let the header wrap onto a
   second row and let the switch shrink instead. */
@media (max-width: 480px) {
  .nav { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 8px; row-gap: 10px; }
  .nav-links { flex: 1 1 100%; justify-content: space-between; gap: 8px; }
  .nav .btn-primary { padding-inline: 14px; font-size: 14px; }
  .lang-switch .lang-opt { padding-inline: 8px; }
}

/* Touch targets. The segmented switches were 27px tall — usable with a mouse,
   fiddly with a thumb, and these are how a visitor picks their currency before
   buying. Only raised on touch devices so the desktop density is unchanged. */
@media (hover: none) and (pointer: coarse) {
  .switch button { min-height: 40px; padding-inline: 12px; }
  /* Padding, not display — setting display here would resurrect the nav links
     that the 900px breakpoint deliberately hides on small screens. */
  .nav-links a.link { padding-block: 9px; }
  .btn { min-height: 44px; }
  /* A 16px checkbox is a hard target for a thumb, and this one gates signup.
     The label is already clickable via for=, so this just widens the box. */
  .check input[type="checkbox"] { width: 22px; height: 22px; }
  .check label { padding-block: 6px; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 34px; }
  .section-head h2, .cta-band h2 { font-size: 28px; }
  .snap-demo { flex-direction: column; }
  html[dir="rtl"] .snap-arrow, .snap-arrow { transform: rotate(90deg); }
  .stepper .sep { width: 20px; }
  .stepper .s span:not(.n) { display: none; }
  .switch button { padding: 6px 9px; font-size: 12px; }
  .auth-card { padding: 24px; }
}

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

/* Free-plan footnote: the asterisked AI rows depend on the user's own Gemini
   key, so the caveat has to be visible on the card, not buried in docs. */
.plan-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: -4px 0 18px;
}

/* The mock's ring track and macro bars were hardcoded to the dark page colour and
   read as black holes on white. Theme them from the token instead. */
:root[data-theme="light"] .bar { background: #E4E8ED; }
:root[data-theme="light"] .ring-track { stroke: #E4E8ED; }
