/* ============================================================
   Nide Solutions — confident modern fintech, dark ink
   Display & headline: Inter Tight · Body: Inter · Mono/labels: JetBrains Mono
   (logo wordmark: Fredoka, subset). Shared across all pages.
   Contrast tuned for WCAG AA (no text token below ~6:1).
   ============================================================ */

:root {
  /* Brand palette (from brand guideline v4) */
  --nide-ink: #0B1424;       /* ink-900 */
  --nide-ink-800: #11203A;
  --nide-ink-700: #1A2D4D;
  --nide-cyan: #1797AB;       /* brand-primary */
  --nide-cyan-500: #2DB1C5;
  --nide-cyan-400: #6BCDDC;   /* eyebrow/accent on dark — higher contrast */
  --nide-leaf: #5AA071;       /* leaf-500 */
  --nide-leaf-600: #3E7A52;
  --nide-danger: #B23A3A;

  /* Surfaces */
  --ink-raise: #101d31;          /* panels / cards */
  --ink-sink: #081020;           /* recessed bands */
  --surface: rgba(255, 255, 255, 0.03);
  --surface-strong: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* Text — all ≥ ~6:1 on ink */
  --text: #FFFFFF;                       /* ~18:1 */
  --text-dim: rgba(255, 255, 255, 0.74); /* ~10:1  body */
  --text-mute: rgba(255, 255, 255, 0.62);/* ~7.5:1 small print */

  /* Type — brand fonts: Inter Tight (display/headlines), Inter (body), JetBrains Mono (labels). */
  --font-hero: 'Inter Tight', system-ui, sans-serif;   /* hero headline (was Fraunces — changed per review for readability) */
  --font-display: 'Inter Tight', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing scale */
  --s1: 8px;  --s2: 16px;  --s3: 24px;  --s4: 40px;
  --s5: 64px; --s6: 96px;  --s7: 140px;

  --radius: 14px;
  --radius-lg: 22px;
  --content: 1080px;
  --measure: 34ch;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--nide-ink);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Atmosphere: a top accent glow + fine grain, fixed behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% -8%, rgba(23, 151, 171, 0.20), transparent 60%),
    radial-gradient(45% 40% at 92% 8%, rgba(90, 160, 113, 0.12), transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout primitives ---------- */
.inner {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--s4);
}

.bleed {
  /* full-width band, inner content still constrained */
  width: 100%;
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-hero);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.display em {
  font-style: normal;
  color: var(--nide-cyan);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nide-cyan-400);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--nide-cyan-400);
}

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

/* ---------- Header ---------- */
.site-header {
  padding: var(--s4) 0 0;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo-svg {
  height: 72px;
  width: auto;
  display: block;
}
.header-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero { padding: var(--s5) 0 var(--s5); }
.hero .inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s6);
  align-items: center;
}
.hero-copy { max-width: 580px; }
.hero h1 {
  font-size: clamp(44px, 6vw, 78px);
  margin: var(--s2) 0 var(--s2);
}
.hero .lead {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-dim);
  font-weight: 400;
  max-width: var(--measure);
}

/* ---------- Signup card ---------- */
.signup-card {
  background: linear-gradient(180deg, var(--ink-raise), var(--ink-sink));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s4);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255,255,255,0.04);
}
.signup-card h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: var(--s1);
}
.signup-card .card-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: var(--s3);
}

.signup { text-align: left; }
.signup fieldset { border: 0; padding: 0; margin: 0; }

/* Honeypot — off-screen, out of tab order, hidden from assistive tech */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* All form text fields share one style so they line up exactly */
input[type="email"],
input[type="text"] {
  width: 100%;
  background: var(--nide-ink);
  border: 1px solid var(--line-strong);
  padding: 14px 15px;
  border-radius: 11px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
}
input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--nide-cyan);
  box-shadow: 0 0 0 3px rgba(23, 151, 171, 0.18);
}
input::placeholder { color: var(--text-mute); }

button {
  font-family: var(--sans);
  background: var(--nide-cyan);
  color: var(--nide-ink);
  border: none;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
button:hover {
  background: #1fb0c6;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(23, 151, 171, 0.6);
}
button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Primary submit — full width, at the foot of the form (after the optional fields,
   so people pass tilitoimisto / järjestelmät / consent before reaching it) */
.submit-row { margin-top: 32px; }   /* breathing room after the consent text */
.submit-row button { width: 100%; padding: 16px; font-size: 16px; }

/* Optional fields — truly hidden (not focusable) until revealed */
.optional-fields {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  margin-top: 0;
  transition: grid-template-rows 0.38s ease, opacity 0.3s ease,
              margin 0.38s ease, visibility 0s linear 0.38s;
}
.optional-fields.revealed {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-top: var(--s2);
  transition: grid-template-rows 0.38s ease, opacity 0.3s ease, margin 0.38s ease;
}
.optional-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}


.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* System picker as pills */
.checkbox-group { display: flex; flex-wrap: wrap; gap: var(--s1); }
.checkbox-group label { cursor: pointer; }
.checkbox-group input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.checkbox-group span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-dim);
  transition: all 0.16s ease;
}
/* checkmark glyph so selection isn't conveyed by color alone (1.4.1) */
.checkbox-group span::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: all 0.16s ease;
}
.checkbox-group label:hover span {
  border-color: var(--nide-cyan);
  color: var(--text);
}
.checkbox-group input:checked + span {
  background: rgba(23, 151, 171, 0.18);
  border-color: var(--nide-cyan);
  color: var(--text);
}
.checkbox-group input:checked + span::before {
  content: "✓";
  font-size: 10px;
  font-weight: 700;
  color: var(--nide-ink);
  background: var(--nide-cyan);
  border-color: var(--nide-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.checkbox-group input:focus-visible + span {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.muu-input { display: none; margin-top: var(--s1); }
.muu-input.visible { display: block; }

/* Consent */
.consent-row { display: flex; align-items: flex-start; gap: 12px; }
.consent-row input[type="checkbox"] {
  accent-color: var(--nide-cyan);
  width: 22px; height: 22px;
  margin-top: 1px; flex-shrink: 0; cursor: pointer;
}
.consent-row label {
  font-size: 13.5px;
  color: var(--text-mute);
  line-height: 1.5;
  cursor: pointer;
}
.consent-row label a { color: var(--nide-cyan); text-decoration: underline; text-underline-offset: 2px; }
.consent-row label a:hover { color: #1fb0c6; }

.microcopy {
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: center;
  margin-top: var(--s2);
}

/* Trust row */
.trust-row {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s3);
  flex-wrap: nowrap;       /* keep the three badges on one line */
}
.trust-badge {
  font-size: 12.5px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.trust-badge svg { flex-shrink: 0; }

/* ---------- Value section ---------- */
.value { padding: var(--s5) 0; border-top: 1px solid var(--line); }
.value .section-eyebrow { margin-bottom: var(--s3); }
.pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}
.pillar-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s4);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.pillar-item:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}
.pillar-num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--nide-cyan-500);
  display: block;
  margin-bottom: var(--s3);
}
.pillar-item:nth-child(2) .pillar-num { color: var(--nide-leaf); }
.pillar-label {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: var(--s1);
}
.pillar-text { font-size: 16px; color: var(--text-dim); }

/* ---------- Accent statement band (high contrast block) ---------- */
.statement {
  background: var(--nide-cyan);
  color: var(--nide-ink);
}
.statement .inner { padding-top: var(--s5); padding-bottom: var(--s5); }
.statement p {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(30px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 22ch;
}
.statement .statement-sub {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;            /* solid ink (~5.3:1 on cyan) — AA safe */
  margin-top: var(--s3);
  color: var(--nide-ink);
  letter-spacing: 0;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: var(--s4) 0;
}
footer .inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
}
.footer-copy { font-size: 13px; color: var(--text-mute); }
footer a {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}
footer a:hover { color: var(--text); border-color: var(--nide-cyan); }

/* ============================================================
   Legal page (tietosuoja.html)
   ============================================================ */
.legal { padding: var(--s6) 0 var(--s7); }
.legal .inner { max-width: 720px; }
.legal h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: var(--s1);
}
.legal .subtitle { color: var(--text-mute); font-size: 14px; margin-bottom: var(--s5); }
.legal h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--nide-leaf);
  margin-top: var(--s4);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.legal p, .legal li { font-size: 16px; color: var(--text-dim); margin-bottom: var(--s1); }
.legal ul { padding-left: 22px; }
.legal a { color: var(--nide-cyan); }
.legal hr { border: none; border-top: 1px solid var(--line); margin: var(--s5) 0; }
.legal .back {
  display: inline-block;
  margin-top: var(--s5);
  color: var(--text-mute);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}
.legal .back:hover { color: var(--text); }

/* ============================================================
   Thanks page (kiitos.html)
   ============================================================ */
.thanks {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s4);
}
.thanks .eyebrow { justify-content: center; margin-bottom: var(--s3); }
.thanks h1 {
  font-family: var(--font-hero);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(36px, 6vw, 60px);
  letter-spacing: -0.025em;
  margin-bottom: var(--s2);
}
.thanks p { color: var(--text-dim); font-size: 19px; }
.thanks p a { display: inline; margin-top: 0; }   /* inline links inside copy (e.g. mailto on the error page) */
.thanks a {
  color: var(--nide-cyan);
  text-decoration: none;
  display: inline-block;
  margin-top: var(--s4);
  border-bottom: 1px solid var(--nide-cyan);
  padding-bottom: 2px;
}
.thanks a:hover { color: #1fb0c6; }

/* ============================================================
   Entrance motion (one orchestrated load)
   ============================================================ */
.rise { opacity: 0; animation: rise 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; } /* Out-Quart per brand guide */
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.25s; }
.d4 { animation-delay: 0.35s; }
.d5 { animation-delay: 0.45s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root { --s6: 72px; --s7: 96px; }
  .hero .inner { grid-template-columns: 1fr; gap: var(--s5); }
  .hero-copy { max-width: none; }
  .inner { padding: 0 var(--s3); }
}
@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; }
  .site-header .inner { justify-content: center; }
  .header-tag { display: none; }
  .brand-logo-svg { height: 60px; }
  footer .inner { justify-content: center; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
}
