/*
 * Landing page cuvo.ch. Same look as the app (frontend/src/styles.css): petrol scale, surfaces,
 * Inter, .btn / .btn-primary / .btn-secondary, entity colors from utils/entity-colors.ts.
 * Mobile first like the app: base rules are for phones, wider screens via min-width.
 * Plain CSS (no build step); light and dark follow the system setting.
 */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-display: swap; src: url('/fonts/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  --primary-400: #4f9aa7;
  --primary-500: #2b7886;
  --primary-600: #0b5562;
  --primary-700: #094753;
  --primary-800: #073a44;
  --link: var(--primary-600);

  --surface: #ffffff;
  --surface-secondary: #f8fafc;
  --surface-tertiary: #f1f5f9;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  /* Entity tags (bg, text, border), as in the review view. */
  --person: #dbeafe; --person-text: #1e40af; --person-border: #bfdbfe;
  --org: #d1fae5; --org-text: #065f46; --org-border: #a7f3d0;
  --address: #ede9fe; --address-text: #5b21b6; --address-border: #ddd6fe;
  --date: #fef3c7; --date-text: #92400e; --date-border: #fde68a;
  --number: #fce7f3; --number-text: #9d174d; --number-border: #fbcfe8;

  /* .alert-warning of the app. */
  --warning-bg: #fffbeb; --warning-border: #fde68a; --warning-text: #92400e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0f172a;
    --surface-secondary: #1e293b;
    --surface-tertiary: #334155;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    /* Lighter petrol on dark surfaces, as in the app. */
    --primary-400: #6fb0bb;
    --primary-500: #4f9aa7;
    --link: var(--primary-400);

    --person: rgb(30 64 175 / 0.4); --person-text: #dbeafe; --person-border: #1d4ed8;
    --org: rgb(6 95 70 / 0.4); --org-text: #d1fae5; --org-border: #047857;
    --address: rgb(91 33 182 / 0.4); --address-text: #ede9fe; --address-border: #6d28d9;
    --date: rgb(146 64 14 / 0.4); --date-text: #fef3c7; --date-border: #b45309;
    --number: rgb(157 23 77 / 0.4); --number-text: #fce7f3; --number-border: #be185d;

    --warning-bg: #451a03; --warning-border: #92400e; --warning-text: #fde68a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}
h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--link); }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 48rem; }

.skip-link { position: absolute; left: -999px; top: 0.5rem; }
.skip-link:focus { left: 1rem; z-index: 100; background: var(--surface); padding: 0.5rem 1rem; border-radius: 0.5rem; }

/* Buttons: identical to the app's .btn classes. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  padding: 0.625rem 1rem; border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 500; line-height: 1.25rem; white-space: nowrap;
  text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s;
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; line-height: 1rem; }
.btn-primary { background: var(--primary-600); color: #ffffff; border: 1px solid transparent; }
.btn-primary:hover { background: var(--primary-700); }
.btn-primary:active { background: var(--primary-800); }
a.btn-primary, a.btn-primary:hover { color: #ffffff; }
.btn-secondary { border: 1px solid var(--border); color: var(--text-secondary); background: transparent; }
.btn-secondary:hover { background: var(--surface-tertiary); }
.btn:focus-visible, .nav a:focus-visible, .lang-switch a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary-500); outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 0.75rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo { height: 1.25rem; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: block; } }
.badge {
  font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary); border: 1px solid var(--border); border-radius: 0.375rem; padding: 0.125rem 0.375rem;
}
.nav { display: none; }
.nav a { color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; font-weight: 500; }
.nav a:hover { color: var(--text-primary); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.lang-switch { display: flex; gap: 0.125rem; font-size: 0.75rem; font-weight: 600; }
.lang-switch a, .lang-switch span { padding: 0.25rem 0.375rem; border-radius: 0.375rem; text-decoration: none; }
.lang-switch a { color: var(--text-tertiary); }
.lang-switch a:hover { color: var(--text-primary); background: var(--surface-tertiary); }
.lang-switch span { color: var(--text-primary); }

/* Hero */
.hero { padding: 2.5rem 0 3rem; }
.hero-grid { display: grid; gap: 2rem; }
.eyebrow { color: var(--link); font-weight: 600; font-size: 0.875rem; margin-bottom: 0.75rem; }
.lead { margin-top: 1rem; font-size: 1.0625rem; color: var(--text-secondary); max-width: 38rem; }
/* Mobile: full-width buttons stacked, main action last (like the app's .action-bar). */
.cta { display: flex; flex-direction: column-reverse; gap: 0.75rem; margin-top: 1.75rem; }
.note { margin-top: 1rem; font-size: 0.875rem; color: var(--text-tertiary); }

.example {
  margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 0.75rem;
  background: var(--surface-secondary); display: grid; gap: 0.75rem;
}
.example-block { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1rem; }
.example-label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.example-text { font-size: 0.9375rem; line-height: 1.9; overflow-wrap: anywhere; }
.example-arrow { text-align: center; color: var(--text-tertiary); }
.example mark { border-radius: 0.25rem; padding: 0.0625rem 0.25rem; border: 1px solid; }
.t-person { background: var(--person); color: var(--person-text); border-color: var(--person-border); }
.t-org { background: var(--org); color: var(--org-text); border-color: var(--org-border); }
.t-address { background: var(--address); color: var(--address-text); border-color: var(--address-border); }
.t-date { background: var(--date); color: var(--date-text); border-color: var(--date-border); }
.t-number { background: var(--number); color: var(--number-text); border-color: var(--number-border); }
.ph { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; font-weight: 600; color: var(--link); }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--surface-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-lead { color: var(--text-secondary); max-width: 44rem; margin-bottom: 1.5rem; }

.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.steps li { border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; background: var(--surface); }
.steps p { margin-top: 0.5rem; color: var(--text-secondary); font-size: 0.9375rem; }
.step-number {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: 9999px; background: var(--primary-600); color: #ffffff; font-weight: 600; font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.cards { display: grid; gap: 1rem; }
.card { border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; background: var(--surface); }
.card p { margin-top: 0.5rem; color: var(--text-secondary); font-size: 0.9375rem; }
.card ul, .price-card ul { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--text-secondary); font-size: 0.9375rem; }
.card li + li, .price-card li + li { margin-top: 0.25rem; }

.callout {
  margin-top: 1.5rem; padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem;
  border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-text);
}

/* Pricing */
.pricing { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.price-card { border: 2px solid var(--primary-600); border-radius: 0.75rem; padding: 1.5rem; background: var(--surface); display: flex; flex-direction: column; }
@media (prefers-color-scheme: dark) { .price-card { border-color: var(--primary-500); } }
.price-card .btn { margin-top: 1.5rem; }
.price-tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); }
.price { font-size: 2rem; font-weight: 800; margin-top: 0.25rem; }
.price-info p { margin-top: 0.5rem; color: var(--text-secondary); max-width: 36rem; }

/* FAQ */
details { border-bottom: 1px solid var(--border); padding: 1rem 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 0.75rem; color: var(--text-secondary); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; font-size: 0.875rem; color: var(--text-tertiary); }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { color: var(--text-primary); }

/* --- Larger screens ---------------------------------------------------------------------- */

@media (min-width: 480px) {
  .cta { flex-direction: row; }
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  .logo { height: 1.5rem; }
  .steps, .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 900px) {
  .nav { display: flex; gap: 1.5rem; margin-left: 1.5rem; }
  .hero { padding: 5rem 0 6rem; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: center; }
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }
  .lead { font-size: 1.125rem; }
  .section { padding: 4.5rem 0; }
  .pricing { grid-template-columns: 22rem 1fr; gap: 3rem; align-items: start; }
}

@media (min-width: 1024px) {
  .steps, .cards { grid-template-columns: repeat(4, 1fr); }
  .cards-3 { grid-template-columns: repeat(3, 1fr); }
}
