/* ==========================================================================
   ShopReply AI — styles.css
   World-class SaaS design system. Clean HTML/CSS, no frameworks.
   - Light + dark theme (prefers-color-scheme + manual toggle)
   - One primary color (deep teal) + one accent (amber)
   - Text tokens target contrast in both themes; photo backgrounds need rendered checks
   - Locally hosted Inter (variable font), system-font fallback
   - Visible focus, reduced-motion support and reflow at 320px
   ========================================================================== */

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7, U+02CC-02CE, U+02D0-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens: LIGHT (default) ---------- */
:root {
  color-scheme: light;

  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.5vw, 3.25rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Surfaces */
  --color-bg: #ffffff;
  --color-surface: #f6f9fa;
  --color-surface-2: #edf3f5;
  --color-border: #d5e0e4;
  --color-divider: #e3ebee;

  /* Text */
  --color-text: #17242e;            /* 14.0:1 on --color-bg */
  --color-text-muted: #4d5f6b;      /* 6.9:1 on --color-bg */

  /* Brand */
  --color-primary: #0e5a6d;        /* 6.7:1 on white */
  --color-primary-hover: #0a4655;
  --color-accent: #9a5b00;          /* 5.0:1 on white */
  --color-accent-soft: #fdf3e3;
  --color-on-primary: #ffffff;

  /* Hero / footer (dark in both themes) */
  --color-dark: #12242e;
  --color-dark-2: #0c1a22;
  --color-dark-border: #2b4551;
  --color-on-dark: #e8f1f4;         /* 13.8:1 on --color-dark */
  --color-on-dark-muted: #b3c8d1;   /* 7.9:1 on --color-dark */
  --color-on-dark-primary: #7fc5d5; /* links on dark: 7.0:1 on --color-dark */

  /* States */
  --color-error: #b3261e;
  --color-error-bg: #fdeceb;
  --color-success: #1e6b34;
  --color-success-bg: #e9f5ec;
  --color-focus: #0e5a6d;
  --color-focus-dark: #8fd3e3;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(18, 36, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(18, 36, 46, 0.08);
  --shadow-lg: 0 16px 40px rgba(18, 36, 46, 0.14);

  /* Misc */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-full: 9999px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-narrow: 46rem;
  --content-default: 71rem;
}

/* ---------- Design tokens: DARK ---------- */
[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #0c1a22;
  --color-surface: #12232d;
  --color-surface-2: #16303b;
  --color-border: #2b4551;
  --color-divider: #1c3441;

  --color-text: #dbe7ec;            /* 13.3:1 on --color-bg */
  --color-text-muted: #9fb8c2;      /* 7.0:1 on --color-bg */

  --color-primary: #7fc5d5;         /* 7.0:1 on --color-bg */
  --color-primary-hover: #a8d9e3;
  --color-accent: #e2a75c;          /* 7.2:1 on --color-bg */
  --color-accent-soft: #2d2417;
  --color-on-primary: #0c1a22;

  --color-dark: #101f28;
  --color-dark-2: #0a161d;
  --color-dark-border: #2b4551;
  --color-on-dark: #dbe7ec;
  --color-on-dark-muted: #b3c8d1;   /* lightened: >=4.5:1 also over hero waves */
  --color-on-dark-primary: #7fc5d5;

  --color-error: #f4a29b;
  --color-error-bg: #3a1f1d;
  --color-success: #8fd0a3;
  --color-success-bg: #17301f;
  --color-focus: #8fd3e3;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* No-JS fallback: follow system preference when data-theme is absent */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --color-bg: #0c1a22;
    --color-surface: #12232d;
    --color-surface-2: #16303b;
    --color-border: #2b4551;
    --color-divider: #1c3441;
    --color-text: #dbe7ec;
    --color-text-muted: #9fb8c2;
    --color-primary: #7fc5d5;
    --color-primary-hover: #a8d9e3;
    --color-accent: #e2a75c;
    --color-accent-soft: #2d2417;
    --color-on-primary: #0c1a22;
    --color-dark: #101f28;
    --color-dark-2: #0a161d;
    --color-on-dark: #dbe7ec;
    --color-on-dark-muted: #b3c8d1;   /* lightened: >=4.5:1 also over hero waves */
    --color-on-dark-primary: #7fc5d5;
    --color-error: #f4a29b;
    --color-error-bg: #3a1f1d;
    --color-success: #8fd0a3;
    --color-success-bg: #17301f;
    --color-focus: #8fd3e3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  scroll-padding-bottom: 10rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: 1rem; /* stable 16px base; fluid sizes apply to larger roles */
  overflow-wrap: anywhere;
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

main {
  flex: 1 0 auto;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 700;
}

p,
li,
figcaption {
  text-wrap: pretty;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

ul,
ol {
  padding-left: 1.25rem;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-primary-hover);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--color-surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

/* Visible keyboard focus everywhere — never removed */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.site-footer :focus-visible,
.hero :focus-visible {
  outline-color: var(--color-focus-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -4rem;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  /* Keyboard focus must become visible immediately. */
  transition: none;
}

.skip-link:focus {
  top: 0;
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Opaque background: text never shows through the sticky header
     (WCAG 1.4.3 — content scrolled under the header must not ghost). */
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
}

.header-inner {
  /* Slightly wider than the content column: the header also carries the
     language switcher and the CTA, which don't fit in 71rem. */
  max-width: 82rem;
  margin-inline: auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: var(--text-lg);
  min-height: 48px;
}

.site-nav {
  margin-left: auto;
}

.brand .brand-logo { display:block; width:clamp(10.5rem,18vw,13.75rem); height:auto; }
.brand .brand-logo--dark { display:none; }
[data-theme="dark"] .brand .brand-logo--light { display:none; }
[data-theme="dark"] .brand .brand-logo--dark { display:block; }
.footer-brand { display:inline-block; }
.footer-brand img { display:block; width:13.75rem; max-width:100%; height:auto; }

.nav-list {
  display: flex;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  align-items: center;
}

.nav-list > li {
  position: relative;
}

.nav-list > li > a,
.nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: var(--text-sm);
  min-height: 44px;
  border: 1px solid transparent;
}

.nav-list > li > a:hover,
.nav-drop-toggle:hover,
.nav-list > li > a[aria-current="page"] {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.nav-drop-toggle .chev {
  transition: transform var(--transition);
}

.nav-item.open .nav-drop-toggle .chev {
  transform: rotate(180deg);
}

/* Dropdown panel (desktop) */
.nav-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 17rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  list-style: none;
  z-index: 60;
}

.nav-drop[hidden] {
  display: none;
}

.nav-drop a {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  min-height: 44px;
}

.nav-drop a:hover,
.nav-drop a:focus {
  background: var(--color-surface-2);
  color: var(--color-primary);
}

.nav-drop .drop-desc {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg);
}

.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Mobile menu button */
.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 600;
  min-height: 44px;
  background: var(--color-bg);
  color: var(--color-text);
}

.nav-toggle .bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle .bars span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* ---------- Buttons ---------- */
.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  /* Keep text/background pairs readable throughout a theme change. */
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

[data-theme="dark"] .button--primary,
:root:not([data-theme]) .button--primary {
  /* dark theme: primary is light teal, token --color-on-primary switches to dark text */
}

.button--primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-on-primary);
}

[data-theme="dark"] .button--primary:hover {
  background: #a8d9e3;
  color: #0c1a22;
}

.button--ghost {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.button--ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-primary-hover);
}

.button--ghost-dark {
  border-color: var(--color-focus-dark);
  color: var(--color-focus-dark);
  background: transparent;
}

.button--ghost-dark:hover {
  background: rgba(143, 211, 227, 0.12);
  color: #ffffff;
}

/* Button click ripple (JS adds .is-clicked briefly) */
.button .btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

.button.is-clicked .btn-ripple {
  animation: btn-ripple 450ms ease-out forwards;
}

@keyframes btn-ripple {
  from {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.18;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.header-cta {
  flex: none;
  padding-inline: var(--space-3);
}

/* Too narrow for the header CTA — the hero already shows the same button.
   (Raised from 68rem: the language switcher pills need the extra space.) */
@media (max-width: 85rem) {
  .header-cta {
    display: none;
  }
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-20));
}

.section--alt {
  background: var(--color-surface);
}

.section--dark {
  background: var(--color-dark);
  color: var(--color-on-dark);
}

.section--dark h2,
.section--dark h3 {
  color: var(--color-on-dark);
}

.section--dark p {
  color: var(--color-on-dark-muted);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-10);
}

.section-head h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.section-head p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.section--dark .section-head p {
  color: var(--color-on-dark-muted);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-4);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--space-12), 9vw, var(--space-24));
  background: var(--color-dark);
  color: var(--color-on-dark);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 47rem;
}

.hero h1 {
  font-size: var(--text-2xl);
  color: var(--color-on-dark);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

.hero .hero-sub {
  font-size: var(--text-lg);
  color: var(--color-on-dark-muted);
  margin-bottom: var(--space-8);
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-note {
  margin-top: var(--space-8);
  font-size: var(--text-sm);
  color: var(--color-on-dark-muted);
}

.hero-note strong {
  color: var(--color-on-dark);
}

/* Animated waves at the bottom of the hero */
.hero-waves {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 9rem;
  pointer-events: none;
  z-index: 1;
}

.hero-waves svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
}

.hero-waves .wave-1 {
  opacity: 0.12;
  animation: wave-slide 26s linear infinite;
}

.hero-waves .wave-2 {
  opacity: 0.07;
  animation: wave-slide 38s linear infinite reverse;
}

@keyframes wave-slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Cards: lift + ripple + wave ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-6);
}

.card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 400ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 400ms ease-out;
}

/* Card content stays above the ripple/wave layers */
.card > *:not(.card-ripple):not(.card-wave) {
  position: relative;
  z-index: 2;
}

.card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.card p {
  color: var(--color-text-muted);
}

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-weight: 600;
}

/* Lift on hover (pointer devices only, so touch is not sticky) */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
  }

  /* Keyboard focus: same lift, wave from center */
  .card:focus-within {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
  }
}

/* Ripple element (injected by JS) */
.card .card-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--color-primary) 22%, transparent) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.card.is-rippling .card-ripple {
  animation: card-ripple 550ms ease-out forwards;
}

@keyframes card-ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* Wave line at the bottom of the card (injected by JS) */
.card .card-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 34px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
}

.card .card-wave path {
  fill: none;
  stroke: color-mix(in srgb, var(--color-primary) 40%, transparent);
  stroke-width: 2;
}

.card.is-waving .card-wave {
  animation: wave-slide 2.4s linear infinite;
}

/* Reduced motion: no ripple, no wave, no lift — border + shadow only */
@media (prefers-reduced-motion: reduce) {
  .card:hover,
  .card:focus-within {
    transform: none;
    box-shadow: var(--shadow-md);
  }

  .card.is-rippling .card-ripple {
    animation: none;
  }

  .card.is-waving .card-wave {
    animation: none;
  }
}

/* ---------- Step / icon tiles ---------- */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  flex: none;
}

/* Feature list rows */
.feature-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-4);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.feature-list .check {
  flex: none;
  color: var(--color-success);
  font-weight: 700;
}

/* ---------- Pricing ---------- */
.pricing-wrap {
  overflow-x: auto;
}

.pricing-table {
  min-width: 40rem;
  font-size: var(--text-base);
}

.pricing-table th,
.pricing-table td {
  text-align: left;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  vertical-align: top;
}

.pricing-table thead th {
  background: var(--color-dark);
  color: var(--color-on-dark);
  font-size: var(--text-lg);
}

.pricing-table tbody th {
  background: var(--color-surface);
  font-weight: 600;
  width: 12rem;
}

.pricing-table td {
  background: var(--color-bg);
}

.pricing-table .price {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

.pricing-notes {
  margin-top: var(--space-6);
  color: var(--color-text-muted);
}

.pricing-notes ul {
  margin-top: var(--space-2);
}

/* ---------- Demo / video ---------- */
.demo-box {
  background: var(--color-dark-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  min-height: 18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8);
}

.demo-box p {
  color: var(--color-on-dark-muted);
  max-width: 30rem;
}

.demo-box strong {
  color: var(--color-on-dark);
}

/* ---------- FAQ ---------- */
.faq {
  max-width: var(--content-narrow);
}

.faq details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  margin-bottom: var(--space-3);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  font-size: 1.5em;
  font-weight: 400;
  line-height: 1;
  color: var(--color-primary);
  flex: none;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details[open] summary {
  border-bottom: 1px solid var(--color-border);
}

.faq .answer {
  padding: var(--space-4) var(--space-5) var(--space-5);
  color: var(--color-text-muted);
}

.faq .answer a {
  color: var(--color-primary);
}

/* ---------- Forms ---------- */
.form {
  max-width: var(--content-narrow);
}

.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.field .req {
  color: var(--color-error);
  font-weight: 700;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-color: var(--color-primary);
}

/* Honeypot: hidden from all users, including screen readers */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Status messages (announced via aria-live in HTML) */
.status {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  font-weight: 500;
  border: 1px solid transparent;
}

.status--success {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.status--error {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
}

.status strong {
  font-weight: 700;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-on-dark-muted);
  padding-block: var(--space-12) var(--space-8);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.footer-grid h2 {
  font-size: var(--text-base);
  color: var(--color-on-dark);
  margin-bottom: var(--space-4);
}

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

.footer-grid li {
  margin-bottom: var(--space-2);
}

.footer-grid a {
  color: var(--color-on-dark-primary);
  text-decoration: none;
  display: inline-block;
  padding-block: var(--space-1);
  min-height: 24px;
}

.footer-grid a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-legal {
  border-top: 1px solid rgba(179, 200, 209, 0.3);
  padding-top: var(--space-6);
  font-size: var(--text-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
}

.footer-legal p {
  max-width: none;
}

/* ---------- Legal pages (prose) ---------- */
.prose {
  max-width: var(--content-narrow);
}

.prose h1 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.prose .meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-10);
}

.prose h2 {
  font-size: var(--text-lg);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}

.prose h3 {
  font-size: var(--text-base);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.prose p,
.prose li {
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose .placeholder-note {
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-4) var(--space-5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-6);
}

/* ---------- 404 ---------- */
.error-page {
  text-align: center;
  padding-block: var(--space-20);
}

.error-page h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.error-page p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

.error-page .hero-actions {
  justify-content: center;
}

/* ---------- Scroll reveal (JS adds html.io + .is-visible) ---------- */
html.io .reveal {
  /* Text stays readable throughout motion, including keyboard focus. */
  opacity: 1;
  transform: translateY(14px);
  transition: transform 500ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

html.io .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.io .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 62rem) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    margin-left: 0;
    order: 4;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    border-top: 1px solid var(--color-divider);
    padding-top: var(--space-2);
  }

  .nav-list > li > a,
  .nav-drop-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  /* In the mobile menu the industries links are always visible */
  .nav-drop-toggle {
    display: none;
  }

  .nav-drop {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    padding: 0;
    min-width: 0;
  }

  .nav-drop[hidden] {
    display: block;
  }

  .nav-drop a {
    padding-left: var(--space-8);
  }

  .header-cta {
    order: 3;
  }

  .theme-toggle {
    order: 2;
  }

  .brand {
    order: 1;
  }
}

@media (max-width: 30rem) {
  .hero-actions .button {
    width: 100%;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-waves .wave-1,
  .hero-waves .wave-2 {
    animation: none;
  }
}

/* ---------- Media: industry images & demo videos ---------- */
.industry-figure {
  margin: 0 0 var(--space-10);
}

.industry-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.demo-video {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-dark);
}

.demo-transcript {
  margin-top: var(--space-8);
}

.hero-actions--center {
  justify-content: center;
}

.result-inner {
  max-width: var(--content-narrow);
}

/* ---------- PWA install (app.html, homepage section) ---------- */
.button.install-jump {
  margin-inline-start: var(--space-3);
  margin-block-start: var(--space-2);
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.app-install-help {
  text-align: start;
}

.app-install-help summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: var(--space-3);
}

@media (max-width: 48rem) {
  .button.install-jump { margin-inline-start: 0; }
}

.app-install-box {
  display: flex;
  gap: var(--space-10);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.app-install-main {
  text-align: center;
  max-width: 40ch;
}

.app-install-main .install-btn {
  margin-bottom: var(--space-3);
}

.install-hint {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

.app-qr {
  text-align: center;
  flex: none;
  width: 20rem;
  max-width: 100%;
}

.app-qr img {
  width: 220px;
  height: auto;
  margin-inline: auto;
  background: #ffffff; /* QR needs a white plate in both themes to stay scannable */
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.app-qr-caption {
  max-width: min(36ch, 100%);
  margin: var(--space-3) auto 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.app-qr--center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-qr-caption a,
.app-note a {
  color: var(--color-primary);
}

.inline-icon {
  vertical-align: -0.2em;
}

.app-note {
  max-width: 75ch;
  margin-top: var(--space-6);
  color: var(--color-text-muted);
}

.install-steps {
  padding-left: 1.25rem;
  margin: 0 0 var(--space-3);
}

.install-steps li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

/* Homepage install section: QR only on wider screens, button on phones */
.install-section .app-qr {
  display: none;
}

@media (min-width: 48rem) {
  .install-section .app-qr {
    display: block;
  }
}

/* Offline notice for forms (shown when submitting without a connection) */
.form-offline-note {
  color: var(--color-error);
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}

/* ---------- Payment buttons (Stripe) ---------- */
.pricing-cta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

@media (max-width: 48rem) {
  .pricing-cta {
    grid-template-columns: 1fr;
  }
}

.plan-cta {
  text-align: center;
}

.plan-cta .button {
  width: 100%;
  max-width: 16rem;
}

.stripe-note {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.pricing-cancel-note {
  text-align: center;
  margin-top: var(--space-6);
  color: var(--color-text-muted);
}

/* Payment note in the contact form (shown after clicking Get started) */
.payment-note {
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
}

/* Required checkbox row (terms acceptance) */
.field--check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.field--check input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  margin-top: 0.125rem;
  accent-color: var(--color-primary);
}

.field--check label {
  line-height: 1.5;
}

/* Price line inside industry plan cards */
.price-line {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

/* Prominent email limit under the price (pricing table + plan cards) */
.price-mails {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-2);
}

.table-note {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* "What counts as an email?" / overage explanations under the pricing table */
.pricing-explain {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--color-surface, var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.pricing-explain h3 {
  font-size: var(--text-lg);
  margin: var(--space-4) 0 var(--space-2);
}

.pricing-explain h3:first-child {
  margin-top: 0;
}

.pricing-explain p {
  margin: 0 0 var(--space-2);
}

/* Plan calculator */
.plan-calc {
  margin-top: var(--space-6);
  padding: var(--space-6);
  background: var(--color-surface, var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.plan-calc h3 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-4);
}

.calc-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}

.calc-form .field {
  flex: 1 1 16rem;
  margin: 0;
}

.calc-result {
  margin: var(--space-4) 0 0;
  font-weight: 600;
  color: var(--color-text);
}

/* The hidden attribute must always win over author display rules */
[hidden] { display: none !important; }

/* Mobile menu: industries links stay visible inside the open menu */
@media (max-width: 62rem) {
  .site-nav .nav-drop[hidden] { display: block !important; }
}

/* Footer QR code (hidden on phones — the install button is there instead) */
.footer-qr {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}

.footer-qr:hover {
  color: var(--color-primary);
}

.footer-qr img {
  width: 72px;
  height: 72px;
  background: #ffffff; /* white plate so the QR stays scannable in both themes */
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  flex: none;
}

@media (max-width: 48rem) {
  .footer-qr {
    display: none;
  }
}

/* Light theme: form control borders need 3:1 against white (WCAG 1.4.11) */
[data-theme="light"] .field input,
[data-theme="light"] .field textarea,
[data-theme="light"] .field select,
:root:not([data-theme]) .field input,
:root:not([data-theme]) .field textarea,
:root:not([data-theme]) .field select {
  border-color: #6e838c; /* 4.0:1 on white — WCAG 1.4.11 non-text contrast */
}

/* ===== Language switcher ===== */
.lang-nav {
  flex: none;
}
.lang-list {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.lang-list a {
  display: inline-block;
  min-width: 2.4rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.lang-list a:hover,
.lang-list a:focus-visible {
  border-color: var(--color-primary);
}
.lang-list a[aria-current="page"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

/* Legal pages: language-version note */
.lang-note {
  border-left: 4px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.lang-note a {
  color: var(--color-primary-strong, var(--color-primary));
  font-weight: 600;
}

/* Discreet Spanish suggestion on EN pages (dismissible) */
.lang-hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(92vw, 34rem);
  padding: 0.7rem 1.1rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgb(0 0 0 / 0.14);
  font-size: 0.95rem;
}
.lang-hint a {
  color: var(--color-primary-strong, var(--color-primary));
  font-weight: 700;
  text-decoration: underline;
}
.lang-hint button {
  border: none;
  background: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
  cursor: pointer;
}

@media (max-width: 48rem) {
  /* Keep hero button labels clear of the fixed chat launcher (bottom-right):
     extra right padding inside the button shifts the centered label left. */
  .hero-actions .button {
    padding-right: 4.5rem;
  }

  .lang-nav {
    order: 5;
  }
  .lang-list a {
    min-width: 2.2rem;
    padding: 0.3rem 0.4rem;
  }
}
