/* ============================================================================
   WeiiGo — Daybreak (Navy & Gold) brand stylesheet  (WYG-322)
   Palette mirrors the app's Colors.xaml + docs/design-system.md.
   ========================================================================== */

/* ── Self-hosted fonts (privacy-friendly; no third-party requests) ─────────── */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/Inter-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/Inter-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/Inter-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/Inter-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-display: swap; src: url('/fonts/Inter-ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url('/fonts/PlayfairDisplay-Bold.ttf') format('truetype'); }

/* ── Design tokens ──────────────────────────────────────────────────────────*/
:root {
  /* Navy */
  --navy: #0B2550;
  --navy-600: #123A74;
  --navy-deep: #071A3C;
  /* Primary action (blue) */
  --blue: #1D4ED8;
  --blue-bright: #5B8DEF;
  --blue-deep: #122C7A;
  --on-primary: #FFFFFF;
  /* Accent gold */
  --gold: #C0902E;
  --gold-bright: #DCB152;
  --gold-soft: #FBF1D9;
  --gold-text: #8C6312;
  --on-accent: #0C2347;
  /* Neutrals / surfaces */
  --paper: #FFFFFF;
  --surface-wash: #F6F8FC;
  --slate: #EEF3FA;
  --slate-2: #E4EBF5;
  --bone: #F1F4F9;
  --ink: #0C2347;        /* primary text (14.98:1) */
  --mist: #5A6B85;       /* secondary text (AA 5.4:1) */
  --text-tertiary: #8A98AD;
  --hairline: #E2E8F2;
  --hairline-strong: #CBD6E6;
  /* Feedback */
  --success: #1F9D57;
  --success-text: #147A43;
  --success-soft: #E3F4EA;
  --danger: #C53A28;
  --danger-text: #B0341F;
  --danger-soft: #FBE7E3;
  --warning-text: #7A5212;
  --warning-soft: #FCEFD0;
  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  /* Spacing / radii / shadow */
  --container: 1140px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11,37,80,.06), 0 1px 3px rgba(11,37,80,.10);
  --shadow: 0 6px 18px rgba(11,37,80,.10);
  --shadow-lg: 0 18px 48px rgba(11,37,80,.16);
  --header-h: 68px;
}

/* ── Reset / base ───────────────────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; color: var(--navy); margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.18rem; color: var(--mist); }
.display { font-family: var(--font-display); }

/* ── Accessibility helpers ──────────────────────────────────────────────────*/
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 2px; border-radius: 4px; }

/* ── Layout primitives ──────────────────────────────────────────────────────*/
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section--wash { background: var(--surface-wash); }
.section--navy { background: var(--navy); color: #EAF0FB; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }
.section__head { max-width: 720px; margin: 0 auto clamp(28px, 4vw, 48px); text-align: center; }
.section__eyebrow { color: var(--gold-text); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; margin-bottom: .5rem; }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.text-center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* ── Buttons ────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; line-height: 1; cursor: pointer;
  padding: 14px 24px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: var(--on-primary); }
.btn--primary:hover { background: var(--blue-deep); }
.btn--secondary { background: transparent; color: var(--navy); border-color: var(--hairline-strong); }
.btn--secondary:hover { border-color: var(--navy); background: var(--slate); }
.btn--gold { background: var(--gold); color: var(--on-accent); }
.btn--gold:hover { background: var(--gold-bright); }
.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--on-navy { background: #fff; color: var(--navy); }
.btn--on-navy:hover { background: var(--gold-soft); }
.btn--lg { padding: 16px 30px; font-size: 1.05rem; }
.btn--block { width: 100%; }

/* ── Site header / nav ──────────────────────────────────────────────────────*/
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--hairline); }
.site-header__inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); }
.brand img { height: 34px; width: auto; }
.brand:hover { text-decoration: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a { color: var(--ink); font-weight: 500; padding: 8px 12px; border-radius: var(--radius-sm); }
.nav__links a:hover { background: var(--slate); text-decoration: none; }
.nav__links a.active { color: var(--blue); background: var(--slate); }
.nav__cta { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--hairline-strong);
  background: #fff; border-radius: var(--radius-sm); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ''; display: block; width: 20px; height: 2px; background: var(--navy); position: relative; transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ── Footer ─────────────────────────────────────────────────────────────────*/
.site-footer { background: var(--navy-deep); color: #C7D3E8; padding-block: 56px 32px; }
.site-footer a { color: #C7D3E8; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-col h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-brand img { height: 40px; filter: brightness(0) invert(1); margin-bottom: 14px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; color: #92A3C2; }
.footer-social { display: flex; gap: 12px; }

/* ── Hero ───────────────────────────────────────────────────────────────────*/
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-600) 60%, var(--navy-deep) 100%); color: #EAF0FB; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-block: clamp(56px, 9vw, 110px); }
.hero h1 { color: #fff; }
.hero__lead { font-size: 1.2rem; color: #C8D6F0; max-width: 38ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__visual { position: relative; }
.hero__visual img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.hero__mock { aspect-ratio: 9/16; max-width: 300px; margin-inline: auto; background:
   radial-gradient(120% 120% at 50% 0%, rgba(220,177,82,.25), transparent 60%), rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18); border-radius: 36px; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; color: #cdd9f1; }

/* ── Cards ──────────────────────────────────────────────────────────────────*/
.card { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.card--link { transition: transform .12s ease, box-shadow .15s ease; }
a.card--link:hover, .card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.card__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-text); font-size: 1.4rem; margin-bottom: 16px; }
.card h3 { color: var(--navy); }
.card p { color: var(--mist); margin-bottom: 0; }

/* feature row (alternating) */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.feature-row + .feature-row { margin-top: clamp(40px, 6vw, 80px); }
.feature-row--reverse .feature-row__media { order: -1; }
.feature-row__media { background: var(--slate); border: 1px solid var(--hairline); border-radius: var(--radius-lg); aspect-ratio: 16/10; display: grid; place-items: center; color: var(--text-tertiary); }

/* ── Store badges ───────────────────────────────────────────────────────────*/
.store-badges { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.store-badge { display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 12px;
  background: var(--navy); color: #fff; min-width: 200px; }
.store-badge:hover { background: var(--navy-deep); text-decoration: none; }
.store-badge svg, .store-badge .store-badge__glyph { width: 28px; height: 28px; flex: none; }
.store-badge__sub { font-size: .72rem; line-height: 1; opacity: .85; display: block; }
.store-badge__name { font-size: 1.12rem; font-weight: 700; line-height: 1.15; }
.store-badge--disabled { background: var(--slate-2); color: var(--mist); cursor: default; }
.store-badge--disabled:hover { background: var(--slate-2); }
.store-badge__soon { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--gold-soft); color: var(--gold-text); padding: 2px 6px; border-radius: 5px; margin-left: auto; }
.qr { background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px; width: max-content; }
.qr img, .qr svg { width: 160px; height: 160px; }

/* ── Pricing ────────────────────────────────────────────────────────────────*/
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-sm); position: relative; }
.price-card--featured { border-color: var(--gold); box-shadow: var(--shadow); }
.price-card__flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--gold); color: var(--on-accent); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 5px 14px; border-radius: 999px; }
.price-card__name { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.price-card__price { font-size: 2.4rem; font-weight: 800; color: var(--navy); margin: 8px 0 2px; }
.price-card__price small { font-size: .95rem; font-weight: 500; color: var(--mist); }
.price-card__tagline { color: var(--mist); min-height: 2.6em; }
.price-card ul { list-style: none; margin: 18px 0 24px; padding: 0; flex: 1; }
.price-card li { display: flex; gap: 10px; padding: 7px 0; color: var(--ink); }
.price-card li::before { content: '✓'; color: var(--success-text); font-weight: 800; }

/* ── Forms ──────────────────────────────────────────────────────────────────*/
.form { max-width: 460px; }
.form--wide { max-width: 620px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field .hint { font-size: .85rem; color: var(--mist); margin-top: 4px; }
.input, .textarea, select.input {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--hairline-strong); border-radius: var(--radius-sm); padding: 12px 14px;
}
.input:focus, .textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(91,141,239,.3); }
.textarea { min-height: 130px; resize: vertical; }
.validation-message, .field-error { color: var(--danger-text); font-size: .88rem; margin-top: 4px; display: block; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; }
.alert--error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.alert--success { background: var(--success-soft); border-color: var(--success); color: var(--success-text); }
.alert--info { background: var(--gold-soft); border-color: var(--gold); color: var(--warning-text); }
.auth-card { max-width: 460px; margin: clamp(32px,6vw,72px) auto; }
.auth-card .card { padding: 32px; }
.auth-switch { text-align: center; color: var(--mist); margin-top: 18px; }

/* ── FAQ accordion (native <details>) ───────────────────────────────────────*/
.faq { max-width: 760px; margin-inline: auto; }
.faq details { border: 1px solid var(--hairline); border-radius: var(--radius); background: #fff; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; padding: 18px 20px; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; color: var(--gold-text); line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 20px 18px; color: var(--mist); }

/* ── Cookie consent ─────────────────────────────────────────────────────────*/
.cookie-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200; max-width: 640px; margin-inline: auto;
  background: #fff; border: 1px solid var(--hairline-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cookie-consent p { margin: 0; flex: 1 1 280px; color: var(--ink); font-size: .92rem; }
.cookie-consent .actions { display: flex; gap: 10px; margin-left: auto; }

/* ── Legal / prose ──────────────────────────────────────────────────────────*/
.prose { max-width: 760px; margin-inline: auto; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; color: var(--ink); }
.prose li { margin-bottom: .4em; }
.prose .updated { color: var(--mist); font-size: .9rem; }
.toc { background: var(--surface-wash); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 22px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 6px; }

/* page hero (compact, for inner pages) */
.page-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-600) 100%); color: #EAF0FB; padding-block: clamp(40px,7vw,80px); }
.page-hero h1 { color: #fff; }
.page-hero p { color: #C8D6F0; max-width: 60ch; margin-inline: auto; }

.trust-strip { display: flex; flex-wrap: wrap; gap: 28px 48px; justify-content: center; align-items: center; color: var(--mist); }
.trust-strip strong { color: var(--navy); font-size: 1.6rem; display: block; }

/* ── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__visual { order: -1; }
  .feature-row, .feature-row--reverse .feature-row__media { grid-template-columns: 1fr; order: 0; }
  .grid--3, .grid--4, .price-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; background: #fff; border-bottom: 1px solid var(--hairline);
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px 20px 20px; margin: 0;
    transform: translateY(-12px); opacity: 0; visibility: hidden; pointer-events: none; transition: .18s ease; box-shadow: var(--shadow); }
  /* visibility:hidden when closed also removes the links from the tab order on mobile (a11y). */
  .nav.is-open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__links a { padding: 12px; }
  .nav__cta { flex-direction: column; align-items: stretch; margin: 12px 0 0; }
  .nav__cta .btn { width: 100%; }
}
@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4, .price-grid, .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero__cta .btn, .store-badge { width: 100%; }
}

/* ── Reduced motion ─────────────────────────────────────────────────────────*/
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── Blazor framework UI (error + reconnect) ────────────────────────────────*/
#blazor-error-ui {
  color: #fff; background: var(--danger); position: fixed; bottom: 0; left: 0; right: 0;
  box-shadow: 0 -1px 2px rgba(0,0,0,.2); padding: 12px 20px; display: none; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 10px; }
#blazor-error-ui .reload { color: #fff; text-decoration: underline; }
.blazor-error-boundary { background: var(--danger-soft); padding: 16px; border-radius: var(--radius-sm); color: var(--danger-text); }
