/* ==========================================================================
   CRM.dentist — „Netrukus" landing
   Hand-written CSS. Design tokens copied VERBATIM from
   Design_Lovable/src/styles.css (:root and .dark sets).
   ========================================================================== */

/* --- Self-hosted Inter (GDPR: no third-party font CDN) ------------------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
}

/* --- Design tokens (verbatim copy of the prototype :root) ---------------- */
:root {
  --radius: 0.625rem;

  /* Neutral surgical canvas */
  --background: oklch(0.985 0.002 240);
  --foreground: oklch(0.18 0.01 250);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.004 240);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.01 250);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0.01 250);

  /* Emerald brand */
  --primary: oklch(0.68 0.16 160);
  --primary-foreground: oklch(0.99 0 0);
  --primary-muted: oklch(0.95 0.04 160);

  --secondary: oklch(0.96 0.004 240);
  --secondary-foreground: oklch(0.22 0.012 250);

  --muted: oklch(0.965 0.004 240);
  --muted-foreground: oklch(0.5 0.01 250);

  --accent: oklch(0.95 0.02 200);
  --accent-foreground: oklch(0.22 0.012 250);

  --destructive: oklch(0.62 0.22 27);
  --destructive-foreground: oklch(0.99 0 0);

  --success: oklch(0.68 0.16 160);
  --success-foreground: oklch(0.99 0 0);

  --warning: oklch(0.78 0.16 75);
  --warning-foreground: oklch(0.22 0.012 250);

  --info: oklch(0.62 0.16 250);
  --info-foreground: oklch(0.99 0 0);

  --border: oklch(0.92 0.005 240);
  --border-strong: oklch(0.86 0.008 240);
  --input: oklch(0.92 0.005 240);
  --ring: oklch(0.68 0.16 160);

  /* Derived scales (per prototype @theme) */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);

  --shadow-elevated: 0 1px 2px 0 oklch(0 0 0 / 0.04), 0 1px 3px 0 oklch(0 0 0 / 0.06);
  --shadow-pop: 0 8px 24px -8px oklch(0 0 0 / 0.12), 0 2px 6px -2px oklch(0 0 0 / 0.06);

  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;

  /* Landing-only accessibility derivative.
     --primary (L 0.68) + white text = 2.59:1, below WCAG AA. This darker
     emerald keeps the hue/chroma family and passes: 5.14:1 on white text,
     4.64:1 as text on --primary-muted, 5.29:1 as text on --card. */
  --primary-strong: oklch(0.51 0.13 160);
  --primary-strong-hover: oklch(0.46 0.12 160);
  --primary-text: oklch(0.51 0.13 160);
}

/* Dark theme — verbatim copy of the prototype .dark set, applied via
   prefers-color-scheme (no toggle on the landing). */
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.16 0.01 250);
    --foreground: oklch(0.97 0.003 240);
    --surface: oklch(0.2 0.012 250);
    --surface-2: oklch(0.23 0.014 250);

    --card: oklch(0.21 0.012 250);
    --card-foreground: oklch(0.97 0.003 240);
    --popover: oklch(0.21 0.012 250);
    --popover-foreground: oklch(0.97 0.003 240);

    --primary: oklch(0.72 0.16 160);
    --primary-foreground: oklch(0.16 0.01 250);
    --primary-muted: oklch(0.32 0.06 160);

    --secondary: oklch(0.25 0.012 250);
    --secondary-foreground: oklch(0.97 0.003 240);

    --muted: oklch(0.25 0.012 250);
    --muted-foreground: oklch(0.68 0.012 250);

    --accent: oklch(0.28 0.014 250);
    --accent-foreground: oklch(0.97 0.003 240);

    --destructive: oklch(0.65 0.22 27);
    --destructive-foreground: oklch(0.99 0 0);
    --success: oklch(0.72 0.16 160);
    --success-foreground: oklch(0.16 0.01 250);
    --warning: oklch(0.8 0.16 75);
    --warning-foreground: oklch(0.16 0.01 250);
    --info: oklch(0.68 0.16 250);
    --info-foreground: oklch(0.99 0 0);

    --border: oklch(1 0 0 / 0.08);
    --border-strong: oklch(1 0 0 / 0.14);
    --input: oklch(1 0 0 / 0.1);
    --ring: oklch(0.72 0.16 160);

    /* Dark pairings pass AA with the raw token (8.38:1), so the button can
       use --primary directly. Emerald text lifts slightly for legibility. */
    --primary-strong: var(--primary);
    --primary-strong-hover: oklch(0.77 0.16 160);
    --primary-text: oklch(0.78 0.14 160);

    --shadow-elevated: 0 1px 2px 0 oklch(0 0 0 / 0.3), 0 1px 3px 0 oklch(0 0 0 / 0.35);
    --shadow-pop: 0 8px 24px -8px oklch(0 0 0 / 0.5), 0 2px 6px -2px oklch(0 0 0 / 0.35);
  }
}

/* --- Base ----------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  /* Hard horizontal clamp on the root — reliable on iOS Safari, where a
     body-only clamp can be ignored for touch panning. clip never creates a
     scroll container, so vertical scrolling and the sticky header keep
     working normally. */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: var(--primary-muted);
  color: var(--foreground);
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: var(--primary-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--primary-text) 40%, transparent);
}
a:hover {
  text-decoration-color: currentColor;
}

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

.tabular {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Header ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.wordmark {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-decoration: none;
}
.wordmark .tld {
  color: var(--primary-text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-muted);
  color: var(--primary-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* --- Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding-block: clamp(4rem, 10vh, 6.5rem) clamp(3rem, 7vh, 5rem);
  text-align: center;
}

/* Soft radial emerald glow behind the hero card (prototype's blurred orbs).
   Pure gradients, deliberately NO filter: blur() — blurred absolutely
   positioned layers inflate WebKit's composited layer bounds on iOS and
   make the page scrollable into blank space. The eased gradient stops give
   the same soft-orb look. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: min(44rem, 90vw);
  height: 30rem;
  top: 2rem;
  left: 50%;
  translate: -50% 0;
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--primary) 11%, transparent) 0%,
    color-mix(in oklab, var(--primary) 7%, transparent) 40%,
    color-mix(in oklab, var(--primary) 3%, transparent) 65%,
    transparent 85%
  );
}
.hero::after {
  width: 22rem;
  height: 18rem;
  top: 16rem;
  left: calc(50% + 14rem);
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--accent) 50%, transparent) 0%,
    color-mix(in oklab, var(--accent) 28%, transparent) 45%,
    transparent 82%
  );
  opacity: 0.6;
}

.hero-inner {
  max-width: 45rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--primary);
}

.hero h1 {
  margin-top: 1.5rem;
  font-size: clamp(2.1rem, 4.5vw + 0.9rem, 3.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero .sub {
  margin-top: 1.25rem;
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1vw + 0.85rem, 1.1875rem);
  line-height: 1.65;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

/* --- Waitlist card ---------------------------------------------------------- */
.signup-card {
  width: 100%;
  max-width: 30rem;
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  text-align: left;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}
.field .optional {
  color: var(--muted-foreground);
  font-weight: 400;
}

.field input[type="email"],
.field input[type="text"] {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.85rem;
  font: inherit;
  /* Keep at 16px minimum: any smaller and iOS Safari auto-zooms the page
     on focus, which then pans sideways and never zooms back cleanly. */
  font-size: 1rem;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
@media (prefers-color-scheme: dark) {
  .field input[type="email"],
  .field input[type="text"] {
    background: var(--surface-2);
  }
}
.field input::placeholder {
  color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
}
.field input:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 25%, transparent);
}
.field input[aria-invalid="true"] {
  border-color: var(--destructive);
}
.field input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 25%, transparent);
}

.consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.consent input[type="checkbox"] {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  accent-color: var(--primary-strong);
}
.consent label {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.field-error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--destructive);
}
.field-error.is-visible {
  display: block;
}

.form-error {
  display: none;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--destructive);
  background: color-mix(in oklab, var(--destructive) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--destructive) 30%, transparent);
  border-radius: var(--radius-md);
}
.form-error.is-visible {
  display: block;
}

/* Honeypot — visually removed, still in the DOM for bots */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 2.9rem;
  padding: 0 1.25rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--primary-foreground);
  background: var(--primary-strong);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-elevated);
  transition: background-color 140ms ease, box-shadow 140ms ease, translate 140ms ease;
}
.btn-primary:hover {
  background: var(--primary-strong-hover);
  box-shadow: var(--shadow-pop);
  translate: 0 -1px;
}
.btn-primary:active {
  translate: 0 0;
  box-shadow: var(--shadow-elevated);
}
.btn-primary:disabled {
  opacity: 0.75;
  cursor: default;
  translate: 0 0;
}
.btn-primary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  flex: none;
  border: 2px solid color-mix(in oklab, var(--primary-foreground) 35%, transparent);
  border-top-color: var(--primary-foreground);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.btn-primary.is-loading .spinner {
  display: inline-block;
}
@keyframes spin {
  to { rotate: 360deg; }
}

.form-note {
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* Success state */
.success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: 0.5rem;
}
.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--primary-muted);
  color: var(--primary-text);
}
.success-card h2 {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.success-card p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

/* --- Features ---------------------------------------------------------------- */
.features {
  padding-block: clamp(2.5rem, 6vh, 4rem) clamp(3rem, 7vh, 4.5rem);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 62rem;
  margin-inline: auto;
}

.feature {
  padding: 1.35rem 1.35rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  transition: border-color 160ms ease, translate 160ms ease, box-shadow 160ms ease;
}
.feature:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-pop);
  translate: 0 -2px;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--primary-muted);
  color: var(--primary-text);
}

.feature h3 {
  margin-top: 0.9rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature p {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* --- Trust line ---------------------------------------------------------------- */
.trust {
  padding-block: 0 clamp(3rem, 7vh, 4.5rem);
  text-align: center;
}
.trust p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.trust .sep {
  margin-inline: 0.6rem;
  color: var(--border-strong);
}

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.site-footer a {
  color: var(--muted-foreground);
}
.site-footer a:hover {
  color: var(--foreground);
}

/* --- Privacy page ---------------------------------------------------------------- */
.prose {
  max-width: 42rem;
  margin-inline: auto;
  padding-block: clamp(3rem, 8vh, 4.5rem);
}
.prose h1 {
  font-size: clamp(1.75rem, 3vw + 0.8rem, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.prose .meta {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.prose h2 {
  margin-top: 2.25rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.prose p, .prose li {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}
.prose ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}
.prose strong {
  color: var(--foreground);
  font-weight: 600;
}
.prose .placeholder {
  background: color-mix(in oklab, var(--warning) 18%, transparent);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.3rem;
}
.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.875rem;
}

/* --- Entry animation (one-time, hero only) ---------------------------------- */
@keyframes rise-in {
  from {
    opacity: 0;
    translate: 0 14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.rise {
  animation: rise-in 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rise-1 { animation-delay: 40ms; }
.rise-2 { animation-delay: 130ms; }
.rise-3 { animation-delay: 220ms; }
.rise-4 { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rise {
    animation: none;
  }
  .feature,
  .btn-primary {
    transition: none;
  }
  .feature:hover,
  .btn-primary:hover {
    translate: 0 0;
  }
  .spinner {
    animation-duration: 1600ms;
  }
}

/* --- Responsive ---------------------------------------------------------------- */
@media (max-width: 56rem) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero::after {
    display: none;
  }
}

@media (max-width: 36rem) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .site-header .container {
    height: 3.5rem;
  }
  .trust .sep {
    display: block;
    visibility: hidden;
    height: 0.25rem;
  }
}
