/* Kotisivu Taito – Asiakaspalaute — combined stylesheet (tokens + styles)
   Fonts are loaded via <link> in the HTML head, not @import, to avoid a
   render-blocking request chain. */

/* KotisivuTaito — Color tokens
 * Brand: confident orange on near-black, with light gray-lavender
 * surfaces and white cards. High contrast, warm + bold. */
:root {
  /* ---- Brand orange (primary) ---- */
  --orange-700: #b85a02;
  --orange-600: #c5610a;   /* pressed */
  --orange-500: #e87502;   /* PRIMARY — buttons, accents, eyebrows */
  --orange-400: #f0860f;   /* hover */
  --orange-300: #f59f3e;
  --orange-200: #fbcd95;
  --orange-100: #fde8d2;
  --orange-50:  #fdf3e8;

  /* ---- Neutral / ink ---- */
  --black:      #000000;   /* hero + footer backgrounds */
  --ink-950:    #0a0b0d;   /* near-black panels */
  --ink-900:    #14161a;
  --ink-800:    #1e2632;   /* primary headings on light */
  --ink-700:    #2b3340;
  --ink-600:    #475063;
  --ink-500:    #5b6470;   /* body text on light */
  --ink-400:    #818b98;
  --ink-300:    #aab2bd;
  --ink-200:    #d4d8df;
  --ink-100:    #e5e8ed;

  /* ---- Surfaces ---- */
  --white:        #ffffff;
  --surface-page: #edeff2;   /* light section background (gray-lavender) */
  --surface-card: #ffffff;   /* white cards */
  --surface-sunken: #e3e6ec; /* recessed panels (e.g. "Nykytilanne") */
  --surface-dark: #000000;   /* dark section background */
  --surface-dark-panel: #0d0f12; /* card on black */

  /* ---- Lines ---- */
  --border-light: #e1e4ea;
  --border-dark:  rgba(255,255,255,0.12);
  --border-dashed-dark: rgba(255,255,255,0.18);

  /* ---- Semantic feedback ---- */
  --success: #1f9d57;
  --success-bg: #e6f5ec;
  --danger:  #d23b3b;
  --danger-bg: #fbeaea;
  --warning: #e8a002;
  --info:    #2b6fd4;

  /* ---- Semantic aliases ---- */
  --color-primary:        var(--orange-500);
  --color-primary-hover:  var(--orange-400);
  --color-primary-active: var(--orange-600);
  --color-on-primary:     var(--white);

  --text-heading:   var(--ink-800);
  --text-body:      var(--ink-500);
  --text-muted:     var(--ink-400);
  --text-eyebrow:   var(--orange-500);
  --text-on-dark:        #ffffff;
  --text-on-dark-muted:  rgba(255,255,255,0.66);
  --text-on-dark-eyebrow: var(--orange-500);

  --bg-page:   var(--surface-page);
  --bg-dark:   var(--surface-dark);
  --bg-card:   var(--surface-card);
}

/* KotisivuTaito — Typography tokens
 * Single family (Poppins) used across the brand: heavy/black for hero
 * display, bold for headings, regular for body, semibold uppercase
 * letterspaced for eyebrows and numbers. */
:root {
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);

  /* Weights */
  --fw-light: 300;    /* @kind font */
  --fw-regular: 400;  /* @kind font */
  --fw-medium: 500;   /* @kind font */
  --fw-semibold: 600; /* @kind font */
  --fw-bold: 700;     /* @kind font */
  --fw-black: 800;    /* @kind font */

  /* Type scale (rem, 16px base) */
  --fs-display:  clamp(2.75rem, 1.6rem + 4.4vw, 4.75rem); /* @kind other */
  --fs-h1:       2.5rem;    /* @kind font */
  --fs-h2:       2rem;      /* @kind font */
  --fs-h3:       1.375rem;  /* @kind font */
  --fs-h4:       1.125rem;  /* @kind font */
  --fs-lead:     1.1875rem; /* @kind font */
  --fs-body:     1rem;      /* @kind font */
  --fs-sm:       0.875rem;  /* @kind font */
  --fs-xs:       0.75rem;   /* @kind font */
  --fs-num:      clamp(3rem, 2rem + 3vw, 4rem); /* @kind other */

  /* Line heights */
  --lh-tight: 1.08;   /* @kind font */
  --lh-snug:  1.2;    /* @kind font */
  --lh-heading: 1.25; /* @kind font */
  --lh-body:  1.65;   /* @kind font */

  /* Letter spacing */
  --ls-display: -0.02em; /* @kind font */
  --ls-heading: -0.01em; /* @kind font */
  --ls-body:    0;       /* @kind font */
  --ls-eyebrow: 0.18em;  /* @kind font */
  --ls-button:  0.01em;  /* @kind font */
}

/* KotisivuTaito — Spacing & layout tokens
 * Generous, airy spacing on an 8px-ish base; large section padding. */
:root {
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Section rhythm */
  --section-pad-y: clamp(64px, 8vw, 128px);
  --container-max: 1200px;
  --container-pad: clamp(20px, 5vw, 64px);

  /* Radii — brand uses big soft rounding on cards + pill buttons */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;   /* default card */
  --radius-xl:   28px;   /* large feature card */
  --radius-2xl:  36px;
  --radius-pill: 999px;  /* buttons, chips */
  --radius-full: 50%;    /* icon circles, avatars */
}

/* KotisivuTaito — Effects: shadows, blobs, transitions
 * Cards float on soft, diffuse shadows. Dark sections carry organic
 * black "blob" gradients. Interactions are calm fades + small lifts. */
:root {
  /* Shadows (light surfaces) */
  --shadow-xs:  0 1px 2px rgba(20,22,26,0.06);
  --shadow-sm:  0 4px 12px rgba(20,22,26,0.06);
  --shadow-md:  0 12px 30px rgba(20,22,26,0.08);   /* default card */
  --shadow-lg:  0 24px 60px rgba(20,22,26,0.12);   /* hovered / feature card */
  --shadow-orange: 0 12px 28px rgba(232,117,2,0.32); /* orange button/CTA */

  /* Focus ring */
  --ring: 0 0 0 3px rgba(232,117,2,0.35);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);   /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* @kind other */
  --dur-fast: 140ms;  /* @kind other */
  --dur-base: 220ms;  /* @kind other */
  --dur-slow: 420ms;  /* @kind other */
  --transition-base: all var(--dur-base) var(--ease-out); /* @kind other */

  /* Hover lift */
  --lift: translateY(-4px); /* @kind other */

  /* Organic dark background — layered radial "blobs" on near-black.
     Apply with: background: var(--bg-blob-dark); background-color:#000; */
  --bg-blob-dark:
    radial-gradient(60% 80% at 18% 18%, #1a1c20 0%, rgba(10,11,13,0) 60%),
    radial-gradient(50% 70% at 82% 30%, #17181b 0%, rgba(10,11,13,0) 58%),
    radial-gradient(70% 90% at 70% 92%, #141518 0%, rgba(10,11,13,0) 60%);

  /* Orange feature panel sometimes carries a soft inner highlight */
  --bg-orange-panel: radial-gradient(120% 120% at 0% 0%, #f0860f 0%, #e87502 55%, #d86c02 100%);
}

/* ============================================================
   Kotisivu Taito – Asiakaspalaute
   Built on the KotisivuTaito Design System tokens.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-eyebrow);
}

/* ---------- Top bar ---------- */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  padding-block: var(--space-6);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-orange-panel);
  color: #fff;
  font-weight: var(--fw-black);
  font-size: 1.25rem;
  box-shadow: var(--shadow-orange);
}
.brand__text { line-height: 1.05; }
.brand__name {
  font-weight: var(--fw-black);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: #fff;
}
.brand__name .accent { color: var(--orange-500); }
.brand__sub {
  font-size: 0.625rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}
.brand__logo { height: 42px; width: auto; }
.ty__logo { height: 44px; width: auto; margin: 0 auto var(--space-6); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background-color: var(--black);
  background-image: var(--bg-blob-dark);
  color: var(--text-on-dark);
  padding-top: clamp(120px, 16vw, 180px);
  padding-bottom: clamp(140px, 20vw, 260px);
  overflow: hidden;
}
.hero__inner { max-width: 760px; }
.hero h1 {
  font-weight: var(--fw-black);
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  margin-top: var(--space-4);
}
.hero h1 .accent { color: var(--orange-500); }
.hero__lead {
  margin-top: var(--space-6);
  font-size: var(--fs-lead);
  color: var(--text-on-dark-muted);
  max-width: 620px;
}
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.trust__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-dark);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.85);
}
.trust__chip svg { width: 16px; height: 16px; color: var(--orange-500); }

/* ---------- Form card ---------- */
.form-wrap {
  position: relative;
  z-index: 5;
  margin-top: clamp(-120px, -14vw, -180px);
  padding-bottom: var(--section-pad-y);
}
.card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 5vw, 64px);
}
.card__head { margin-bottom: var(--space-10); }
.card__head h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: var(--text-heading);
  letter-spacing: var(--ls-heading);
  margin-top: var(--space-2);
}
.card__head p { margin-top: var(--space-3); color: var(--text-body); max-width: 640px; }

/* ---------- Alert (server error) ---------- */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
  font-size: var(--fs-sm);
}
.alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.alert--error { background: var(--danger-bg); color: #a12626; }
.alert--error svg { color: var(--danger); }

/* ---------- Field group / numbered questions ---------- */
.qgroup {
  padding-block: var(--space-8);
  border-top: 1px solid var(--border-light);
}
.qgroup:first-of-type { border-top: 0; padding-top: 0; }
.qhead {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-5);
}
.qnum {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: var(--orange-500);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-orange);
}
.qlabel {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  color: var(--text-heading);
  line-height: var(--lh-snug);
}
.qlabel .req { color: var(--orange-500); margin-left: 2px; }
.qhelp {
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.qbody { padding-left: calc(38px + var(--space-4)); }
@media (max-width: 560px) { .qbody { padding-left: 0; } }

/* ---------- Text inputs ---------- */
.field { display: grid; gap: var(--space-2); }
.field + .field { margin-top: var(--space-5); }
.input {
  width: 100%;
  padding: 14px 16px;
  font-size: var(--fs-body);
  color: var(--text-heading);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}
.input::placeholder { color: var(--ink-300); }
.input:hover { border-color: var(--ink-200); }
.input:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: var(--ring);
}
textarea.input { min-height: 130px; resize: vertical; line-height: var(--lh-body); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-2 .field + .field { margin-top: 0; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; gap: var(--space-5); } }

/* ---------- Star rating ---------- */
.stars {
  display: inline-flex;
  gap: var(--space-2);
  direction: rtl; /* enables :hover cascade to preceding stars */
}
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  cursor: pointer;
  color: var(--ink-200);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.stars label svg { width: 40px; height: 40px; }
.stars label:hover { transform: translateY(-2px); }
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label { color: var(--orange-500); }
.stars label.filled { color: var(--orange-500); }
.stars-caption {
  margin-top: var(--space-3);
  font-weight: var(--fw-semibold);
  color: var(--text-heading);
  min-height: 1.4em;
}
.stars-caption small { color: var(--text-muted); font-weight: var(--fw-regular); }

/* ---------- Option cards (radio) ---------- */
.options { display: grid; gap: var(--space-3); }
.options.cols-1 { grid-template-columns: 1fr; }
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #fff;
  transition: var(--transition-base);
}
.opt:hover { border-color: var(--orange-300); background: var(--orange-50); }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt__dot {
  flex: none;
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--ink-200);
  display: grid;
  place-items: center;
  transition: var(--transition-base);
}
.opt__dot::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--orange-500);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-out);
}
.opt__label { font-weight: var(--fw-medium); color: var(--text-heading); }
.opt:has(input:checked) {
  border-color: var(--orange-500);
  background: var(--orange-50);
  box-shadow: 0 0 0 1px var(--orange-500) inset;
}
.opt:has(input:checked) .opt__dot { border-color: var(--orange-500); }
.opt:has(input:checked) .opt__dot::after { transform: scale(1); }
.opt:has(input:focus-visible) { box-shadow: var(--ring); }

/* ---------- NPS scale 0–10 ---------- */
.nps {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: var(--space-2);
}
.nps label {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #fff;
  font-weight: var(--fw-semibold);
  color: var(--text-heading);
  transition: var(--transition-base);
  user-select: none;
}
.nps label:hover { border-color: var(--orange-300); background: var(--orange-50); transform: translateY(-2px); }
.nps input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nps label:has(input:checked) {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #fff;
  box-shadow: var(--shadow-orange);
}
.nps label:has(input:focus-visible) { box-shadow: var(--ring); }
.nps-ends {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
@media (max-width: 560px) {
  .nps { grid-template-columns: repeat(6, 1fr); }
  .nps label { font-size: var(--fs-sm); }
}

/* ---------- Field-level error ---------- */
.err-text {
  display: none;
  font-size: var(--fs-sm);
  color: var(--danger);
  margin-top: var(--space-1);
}
.qgroup.has-error .err-text { display: block; }
.qgroup.has-error .input { border-color: var(--danger); }
.qgroup.has-error .qnum { background: var(--danger); box-shadow: none; }

/* ---------- Honeypot ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Submit ---------- */
.actions {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 16px 32px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--orange-500);
  color: var(--color-on-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-button);
  box-shadow: var(--shadow-orange);
  transition: var(--transition-base);
}
.btn:hover { background: var(--orange-400); transform: var(--lift); }
.btn:active { background: var(--orange-600); transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-orange); }
.btn svg { width: 20px; height: 20px; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }
.actions__note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.actions__note svg { width: 16px; height: 16px; color: var(--success); }

/* ---------- Footer ---------- */
.footer {
  background-color: var(--black);
  background-image: var(--bg-blob-dark);
  color: var(--text-on-dark-muted);
  padding-block: var(--space-16);
}
.footer .container { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: space-between; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { color: var(--orange-500); }
.footer__links { display: flex; gap: var(--space-6); font-size: var(--fs-sm); }
.footer__copy { font-size: var(--fs-sm); }

/* ============================================================
   Thank-you page
   ============================================================ */
.ty {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background-color: var(--black);
  background-image: var(--bg-blob-dark);
  color: var(--text-on-dark);
  padding: var(--space-10);
  text-align: center;
}
.ty__card { max-width: 620px; }
.ty__badge {
  width: 96px; height: 96px;
  margin: 0 auto var(--space-8);
  border-radius: var(--radius-full);
  display: grid; place-items: center;
  background: var(--bg-orange-panel);
  box-shadow: var(--shadow-orange);
  animation: pop var(--dur-slow) var(--ease-out) both;
}
.ty__badge svg { width: 48px; height: 48px; color: #fff; }
.ty h1 {
  font-size: var(--fs-display);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}
.ty p {
  margin-top: var(--space-6);
  font-size: var(--fs-lead);
  color: var(--text-on-dark-muted);
}
.ty .btn { margin-top: var(--space-10); }
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ty__badge { animation: none; }
  html { scroll-behavior: auto; }
}
