/* ==========================================================================
   MyBerniaga — site styles
   Tokens mirror the app's own palette (lib/core/theme/app_palette.dart) so
   the site and the product read as one brand. Same rule as the app: surfaces
   are told apart by their own value plus a hairline border, never by shadow.
   ========================================================================== */

:root {
  /* Brand */
  --primary: #0a5dc2;
  --primary-light: #2563eb;
  --accent: #0f766e;
  --accent-bright: #14b8a6;
  --accent-mint: #00d4aa;

  /* Ground + surfaces */
  --bg: #f4f7fc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8fafd;
  --surface-hover: #edf2f9;

  /* Borders */
  --border: #dce3ed;
  --border-subtle: #ebeff6;

  /* Ink */
  --text: #0b132b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;

  /* Status */
  --success: #15803d;
  --warning: #b45309;
  --alert: #dc2626;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --maxw: 1120px;
  --nav-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --primary: #0a5dc2;
    --primary-light: #3b82f6;
    --accent: #00d4aa;
    --accent-bright: #5eead4;
    --bg: #0b132b;
    --bg-alt: #1c2541;
    --surface: #16203c;
    --surface-alt: #1e2a48;
    --surface-hover: #27355a;
    --border: #2e3c60;
    --border-subtle: #212d4c;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-accent: #0b132b;
    --success: #00d4aa;
    --warning: #f59e0b;
    --alert: #ff4757;
  }
}

:root[data-theme='dark'] {
  --primary: #0a5dc2;
  --primary-light: #3b82f6;
  --accent: #00d4aa;
  --accent-bright: #5eead4;
  --bg: #0b132b;
  --bg-alt: #1c2541;
  --surface: #16203c;
  --surface-alt: #1e2a48;
  --surface-hover: #27355a;
  --border: #2e3c60;
  --border-subtle: #212d4c;
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-on-accent: #0b132b;
  --success: #00d4aa;
  --warning: #f59e0b;
  --alert: #ff4757;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 62ch;
}

.center {
  text-align: center;
}

.center .lede {
  margin-left: auto;
  margin-right: auto;
}

section {
  padding: clamp(56px, 8vw, 104px) 0;
}

/* --------------------------------------------------------------------------
   Brand wordmark — the app's logo, in markup
   -------------------------------------------------------------------------- */

.wordmark {
  display: inline-flex;
  align-items: flex-end;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  color: var(--text);
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark .my {
  color: var(--primary-light);
}

.wordmark .dot {
  width: 0.3em;
  height: 0.3em;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 0.12em;
  margin-bottom: 0.15em;
}

.wordmark-lockup {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.wordmark-lockup:hover {
  text-decoration: none;
}

.wordmark-by {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav .wordmark {
  font-size: 1.32rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  display: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: var(--accent-bright);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-hover);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.center .btn-row {
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 88px);
  overflow: hidden;
}

/* Two soft brand-coloured washes. Purely decorative, and behind everything. */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  width: 520px;
  height: 520px;
  background: var(--accent);
  top: -220px;
  right: -120px;
}

.hero::after {
  width: 460px;
  height: 460px;
  background: var(--primary-light);
  bottom: -260px;
  left: -160px;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero h1 .accent {
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.badge .pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-note {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Phone mockup — a drawn stand-in for a screenshot
   -------------------------------------------------------------------------- */

.mock {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 22px;
  padding: 14px;
  max-width: 380px;
  margin-left: auto;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 12px;
}

.mock-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  display: block;
}

.mock-screen {
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.mock-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 9px;
}

.mock-row:last-child {
  margin-bottom: 0;
}

.mock-emoji {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.mock-text {
  flex: 1;
  min-width: 0;
}

.mock-title {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mock-price {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  flex: 0 0 auto;
}

.mock-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-weight: 800;
}

.mock-total .amt {
  color: var(--accent);
  font-size: 1.2rem;
}

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

.grid {
  display: grid;
  gap: 18px;
  margin-top: 44px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  margin-bottom: 16px;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

/* Numbered steps */
.steps {
  counter-reset: step;
}

.step-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

/* Mode strip */
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 40px;
}

.mode {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
}

.mode .tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.mode ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.mode li {
  margin-bottom: 5px;
}

/* Split feature band */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  align-items: center;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.checklist li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.checklist svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--accent);
  margin-top: 2px;
}

/* CTA band */
.cta {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(32px, 5vw, 56px);
  text-align: center;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq {
  max-width: 780px;
  margin: 40px auto 0;
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}

summary {
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-muted);
  flex: 0 0 auto;
  line-height: 1;
}

details[open] summary::after {
  content: '\2013';
}

details .body {
  padding: 0 20px 18px;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

details .body p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Legal / document pages
   -------------------------------------------------------------------------- */

.doc-head {
  padding: clamp(40px, 6vw, 68px) 0 28px;
  border-bottom: 1px solid var(--border);
}

.doc-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin-bottom: 10px;
}

.doc-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.doc {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 52px;
  align-items: start;
  padding: 44px 0 88px;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 18px;
}

.toc strong {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.toc a:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}

.prose {
  max-width: 74ch;
  min-width: 0;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 40px;
  padding-top: 4px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.02rem;
  margin-top: 26px;
}

.prose p,
.prose li {
  color: var(--text-secondary);
  font-size: 0.97rem;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--text);
}

.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 22px 0;
}

.note.warn {
  border-left-color: var(--warning);
}

.note p:last-child {
  margin-bottom: 0;
}

/* Data table */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 22px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

td {
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Forms (account deletion request)
   -------------------------------------------------------------------------- */

.form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(22px, 4vw, 34px);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.field .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

input[type='text'],
input[type='email'],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
}

textarea {
  resize: vertical;
  min-height: 108px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.check input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.form-error {
  color: var(--alert);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 10px;
  display: none;
}

.form-error.show {
  display: block;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 52px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
}

.footer .wordmark {
  font-size: 1.3rem;
}

.footer-about {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 14px;
  max-width: 34ch;
}

.footer h4 {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 700;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: 9px;
}

.footer li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer li a:hover {
  color: var(--text);
}

.footer-base {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .hero .wrap,
  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .mock {
    margin: 0 auto;
  }

  .grid-3,
  .modes {
    grid-template-columns: repeat(2, 1fr);
  }

  .doc {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .toc {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 20px;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-grid;
    margin-left: auto;
  }

  .nav-theme {
    order: 3;
  }

  .grid-3,
  .grid-2,
  .modes {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  section {
    padding: 52px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
