/* ghl-preview v3 - CalcScoutIQ design (Richard, karta #1, 22.07.2026).
   Self-contained: no CDN, no external requests. Safe to embed in an iframe:
   no position:fixed, no vh-based heights, page sizes to its content.

   All colours, fonts and radii live on :root below - edit them here. */

/* ---- Fonts, self-hosted (Google Fonts: Hanken Grotesk + Newsreader) ---- */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/hanken-grotesk-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: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/hanken-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/newsreader-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: 'Newsreader';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/newsreader-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Design tokens (CalcScoutIQ palette) ---- */
:root {
  --bg: #F7F5F0;            /* header / soft panels */
  --ink: #1C1B19;           /* main text */
  --muted: #6B6862;         /* secondary text */
  --faint: #A49F95;         /* legal / footnotes */
  --line: #E4E0D8;          /* borders */
  --card: #FFFFFF;          /* modal background */
  --accent: #22251F;        /* buttons, active states */
  --accent-soft: #EDEBE5;   /* selected card, info box */
  --page: #CFC9BE;          /* page behind the modal */
  --radius-card: 20px;
  --radius-input: 12px;
  --radius-dense: 10px;
  --font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  /* No fixed heights: the page must size to its content inside an iframe. */
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.stage {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

/* ---- Modal card ---- */
.modal {
  background: var(--card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.35);
}

/* ---- Header ---- */
.modal-head { padding: 20px 30px 16px; background: var(--bg); }

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.builder { display: flex; align-items: center; gap: 10px; }
.logo-slot {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #FFFFFF;
  border: 1px dashed #C9C2B6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 8px;
  color: var(--muted);
}
.builder-name {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.close-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.intro h1 {
  font-family: var(--font-serif);
  margin: 0 0 6px;
  font-size: 23px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.12;
}
.intro p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ---- Step progress ---- */
.progress {
  padding: 12px 30px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dots { display: flex; align-items: center; gap: 7px; }
.dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.dot.is-on { background: var(--accent); color: #FFFFFF; }
.dot-line { width: 22px; height: 2px; background: var(--line); }
.dot-line.is-on { background: var(--accent); }
.step-label { font-size: 12.5px; color: var(--ink); font-weight: 700; margin-left: 4px; }

/* ---- Steps ---- */
.steps { padding: 12px 30px 4px; }

.step-intro { font-size: 11px; color: var(--muted); line-height: 1.35; margin-bottom: 10px; }
.step-intro--box {
  background: var(--accent-soft);
  border-radius: var(--radius-input);
  padding: 15px 17px;
  font-size: 13px;
  color: var(--accent);
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 17px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 10px;
}
.step--dense .step-grid { gap: 10px; }
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }

/* ---- Labels, hints ---- */
.f-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.f-sublabel { color: var(--muted); font-weight: 500; }
.f-hint { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.45; }
.f-note { font-size: 11.5px; color: var(--muted); }
.f-unit { color: var(--muted); font-weight: 500; }
.f-links { margin-top: 6px; display: flex; gap: 12px; }
.f-links a { font-size: 11.5px; color: var(--accent); }

/* Message the backend returned for one field. */
.f-error { font-size: 11.5px; color: #B3261E; margin-top: 6px; line-height: 1.4; font-weight: 600; }
.field:has(.f-error:not([hidden])) input,
.field:has(.f-error:not([hidden])) select { border-color: #B3261E; }

/* Loading, warning and error banner above the form. */
.form-status {
  margin: 0 30px 4px;
  padding: 10px 12px;
  border-radius: var(--radius-dense);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
}
.form-status:last-child { margin-bottom: 20px; }
.form-status--error { color: #B3261E; border-color: #E6B4AF; background: #FDF3F2; }
.form-status--warn { color: #8A5A00; border-color: #E8CE95; background: #FDF7E8; }

button[disabled] { opacity: 0.55; cursor: default; }
.step--dense .f-label { font-size: 12px; margin-bottom: 5px; }

/* ---- Inputs ---- */
input[type="text"], input[type="email"], input[type="number"],
input[type="tel"], select {
  width: 100%;
  max-width: 100%;
  padding: 14px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  font-size: 14px;
  color: var(--ink);
  background: #FFFFFF;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.step--dense input[type="text"], .step--dense input[type="email"],
.step--dense input[type="number"], .step--dense input[type="tel"],
.step--dense select {
  padding: 10px 12px;
  border-radius: var(--radius-dense);
  font-size: 13.5px;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B6862' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 37, 31, 0.14);
}
input::placeholder { color: var(--faint); }

/* ---- Cards (finish & fitout) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; }
.cards input { position: absolute; opacity: 0; width: 0; height: 0; }
.card-opt {
  display: block;
  padding: 13px 6px;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.card-main { display: block; }
.card-sub { display: block; font-size: 10.5px; font-weight: 500; }
.cards input:checked + .card-opt {
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  background: var(--accent-soft);
  padding: 12.5px 5.5px; /* compensate the thicker border */
}
.cards input:checked + .card-opt .card-sub { font-weight: 600; }
.cards input:focus-visible + .card-opt { box-shadow: 0 0 0 3px rgba(34, 37, 31, 0.2); }

/* ---- Toggle (No / Yes) ---- */
.toggle {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-dense);
  overflow: hidden;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-opt {
  flex: 1 1 0;
  text-align: center;
  padding: 9px 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.toggle input:checked + .toggle-opt {
  font-weight: 800;
  color: #FFFFFF;
  background: var(--accent);
}
.toggle input:focus-visible + .toggle-opt { box-shadow: inset 0 0 0 3px rgba(34, 37, 31, 0.35); }

/* ---- Counter (minus / plus) ---- */
.counter {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-dense);
  overflow: hidden;
}
.counter-btn {
  width: 38px;
  border: 0;
  padding: 9px 0;
  text-align: center;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg);
  font-family: inherit;
}
.counter-val {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  border: 0 !important;
  border-radius: 0 !important;
  padding: 9px 0 !important;
  -moz-appearance: textfield;
}
.counter-val::-webkit-outer-spin-button, .counter-val::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.counter-val:focus { box-shadow: none; }

/* ---- Form footer ---- */
.form-foot { padding: 12px 30px 14px; border-top: 1px solid var(--line); margin-top: 12px; }
.nav { display: flex; gap: 12px; align-items: center; }
.btn-back {
  padding: 12px 22px;
  border: 1.5px solid var(--line);
  background: #FFFFFF;
  border-radius: var(--radius-input);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  flex: 1;
  padding: 13px 20px;
  border: none;
  background: var(--accent);
  border-radius: var(--radius-input);
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:focus-visible, .btn-back:focus-visible {
  outline: 3px solid rgba(34, 37, 31, 0.35);
  outline-offset: 2px;
}
.legal {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.legal > span:first-child { font-size: 10.5px; color: var(--faint); }
.powered {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--faint);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.powered img { height: 15px; width: auto; display: block; opacity: 0.9; }

/* ---- Thank-you view ---- */
.thanks { text-align: center; padding: 20px 30px 4px; }
.thanks-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.thanks h2 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.thanks-lede { margin: 0 auto 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; max-width: 390px; }
.thanks-next { margin: 0 auto 12px; font-size: 12px; color: var(--muted); line-height: 1.4; max-width: 360px; }

.cta-stack { display: flex; flex-direction: column; gap: 8px; }
.cta-row { display: flex; gap: 8px; }
.cta-card {
  flex: 1;
  background: #FFFFFF;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 28px -14px rgba(34, 37, 31, 0.4), 0 2px 6px rgba(34, 37, 31, 0.06);
  cursor: pointer;
  text-align: left;
}
.cta-img { height: 44px; overflow: hidden; }
.cta-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cta-title {
  padding: 10px 12px 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cta-arrow { color: var(--accent); font-size: 13px; }
.cta-sub { padding: 0 12px 12px; font-size: 10px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-input);
  background: var(--accent);
  cursor: pointer;
}
.cta-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.cta-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cta-bar-text { text-align: left; display: flex; flex-direction: column; gap: 2px; }
.cta-bar-title { font-size: 12.5px; font-weight: 800; color: #FFFFFF; line-height: 1.2; }
.cta-bar-sub { font-size: 10px; font-weight: 500; color: rgba(255, 255, 255, 0.75); }
.cta-note { font-size: 10px; color: var(--faint); margin-top: 10px; }

.thanks-foot {
  padding: 12px 30px 16px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.btn-link {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .modal-head, .progress, .steps, .form-foot, .thanks, .thanks-foot { padding-left: 18px; padding-right: 18px; }
  .intro h1 { font-size: 20px; }
}
@media (max-width: 420px) {
  .step-grid { grid-template-columns: minmax(0, 1fr); }
  .field--full { grid-column: auto; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .cta-row { flex-direction: column; }
}

[hidden] { display: none !important; }
