/*
  The application's palette (clients/terepes-web/src/theme), so the site and the product look
  like one thing. #009595 is the logo; on a button it fails contrast against white text, which
  is why the button colour is the darker #007c7c - the same choice the web client made.
*/
:root {
  --brand: #009595;
  --primary: #007c7c;
  --primary-hover: #006060;
  --on-primary: #ffffff;
  --ink: #142020;
  --ink-muted: #4d6262;
  --surface: #ffffff;
  --surface-alt: #f1f8f8;
  --surface-strong: #006060;
  --on-strong: #effafa;
  --border: #d8e4e4;
  --error: #b42318;
  --error-surface: #fdecea;
  --warning-surface: #fff6e0;
  --warning-border: #e8c46b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 64, 64, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2bd3d3;
    --primary: #2bd3d3;
    --primary-hover: #63e0e0;
    --on-primary: #0d1616;
    --ink: #e6f2f2;
    --ink-muted: #9fb5b5;
    --surface: #161c1c;
    --surface-alt: #1d2626;
    --surface-strong: #0f3a3a;
    --on-strong: #e6f2f2;
    --border: #314040;
    --error: #ff8a80;
    --error-surface: #3a1c1a;
    --warning-surface: #3a3018;
    --warning-border: #8a6d2a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-hover);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.narrow {
  max-width: 720px;
}

.skip-link {
  position: absolute;
  left: -10000px;
  top: 0;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

/* ---- header and footer ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  color: var(--primary);
}

@media (max-width: 760px) {
  .site-nav__secondary {
    display: none;
  }

  .site-nav {
    gap: 0.9rem;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 2rem 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.social {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 44px: a comfortable tap target on a phone, though the icon itself is 22px. */
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink-muted);
}

.social a:hover,
.social a:focus-visible {
  color: var(--primary);
  background: var(--surface);
}

.social svg {
  display: block;
}

/* ---- buttons ---- */

.button {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}

.button--ghost {
  background: transparent;
  color: var(--primary);
}

.button--ghost:hover {
  background: var(--surface-alt);
  color: var(--primary-hover);
}

.button--small {
  padding: 0.45rem 1.1rem;
  font-size: 0.95rem;
}

.button--block {
  display: block;
  width: 100%;
}

/* ---- sections ---- */

.section {
  padding: 4.5rem 0;
}

.section--alt {
  background: var(--surface-alt);
}

.eyebrow {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--ink-muted);
}

.hero {
  padding: 4rem 0 5rem;
  background: linear-gradient(180deg, var(--surface-alt), var(--surface));
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.75rem;
}

.hero__note {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.mock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  max-width: 380px;
  margin-left: auto;
}

.mock-card__label {
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 0;
}

.mock-card__title {
  font-weight: 700;
  font-size: 1.15rem;
}

.mock-card__progress {
  margin: 1rem 0 0;
  color: var(--primary);
  font-weight: 600;
}

.mock-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mock-steps li {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0 0.6rem 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.mock-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8rem;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 50%;
}

.mock-steps li.is-done::before {
  background: var(--brand);
  border-color: var(--brand);
}

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 0;
  margin: 2rem 0 0;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--on-strong);
  font-weight: 700;
  margin-bottom: 1rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.features article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.features p {
  margin: 0;
  color: var(--ink-muted);
}

.stores {
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.trial-terms {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.checklist li {
  position: relative;
  padding: 0.35rem 0 0.35rem 2rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0.2rem;
  color: var(--brand);
  font-weight: 700;
}

.cta {
  background: var(--surface-strong);
  color: var(--on-strong);
  text-align: center;
}

.cta .button {
  background: var(--on-strong);
  border-color: var(--on-strong);
  color: var(--surface-strong);
}

.cta .button:hover {
  background: transparent;
  color: var(--on-strong);
}

.cta__inner p {
  opacity: 0.9;
}

@media (max-width: 860px) {
  .hero__inner,
  .trial-terms,
  .form-page {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    display: none;
  }

  .steps,
  .features {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (min-width: 861px) and (max-width: 1040px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- the signup form ---- */

.form-page {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: start;
}

.next-steps {
  padding-left: 1.25rem;
}

.next-steps li {
  margin-bottom: 0.5rem;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 1.25rem;
  }
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.1rem;
}

.field label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
}

.field input:focus-visible {
  border-color: var(--brand);
}

.field input.input-validation-error {
  border-color: var(--error);
}

.field__hint {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.field__error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.field__error:empty {
  display: none;
}

.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.7rem;
  align-items: start;
}

.field--check input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.3rem;
}

.field--check label {
  font-weight: 400;
}

.field--check .field__error {
  grid-column: 1 / -1;
}

/* The honeypot: off-screen, not display:none - some scripts skip fields that are not rendered. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice--error {
  background: var(--error-surface);
  border-color: var(--error);
}

.notice--error:empty,
.notice--error.validation-summary-valid {
  display: none;
}

.notice--warning {
  background: var(--warning-surface);
  border-color: var(--warning-border);
}

.prose {
  max-width: 720px;
}

/* The legal texts: long, numbered, read top to bottom - spacing between sections does the work
   a table of contents would otherwise have to. */
.prose h2 {
  margin-top: 2.25rem;
}

.prose h3 {
  margin-top: 1.5rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose .doc-meta {
  color: var(--ink-muted);
}

.prose .table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--surface-alt);
}
