/* The "Pyydä mallisivu" survey (Jussi 3.12.), shared by /aloita/ and the home page first screen. The markup comes from
   tools/aloita/ensiruutu.html (rakenna.py writes it into both pages), the behaviour from /aloita/aloita.js.
   Colours only from /style.css variables (--p 60, --t 30, --k 10). */
/* avoid-ai-design-ignore-file: SD2 -- near-black + orange is the owner's palette O1/O2 (28.11.2026), not a default */
:root { --soft: color-mix(in srgb, var(--t) 84%, var(--p)); }

/* the survey takes the phone's place: the slot goes (lava.js then draws nothing and its loop stops = 3D paused) */
.al-hero.is-open #e3d-slot { display: none; }
.al-hero.is-open .e3d-acts, .al-hero.is-open .e3d-name { visibility: hidden; }
/* the big button: opens the survey in place; the only filled button on the first screen (K5) */
.al-big { min-height: 64px; padding-inline: 30px 14px; font-size: 1.2rem; gap: 18px; }

/* Y1 + Y9 + Y11 inside the card */
.al-card .btn, .al-pick span { touch-action: manipulation; }
.al-card .btn:active, .al-pick label:active span { transform: scale(.97); }
.al-card :focus-visible { outline: 3px solid var(--t); outline-offset: 3px; }

/* the form card */
.al-card { grid-area: stage; align-self: center; position: relative; z-index: 3; width: 100%;
  padding: clamp(18px, 2.4vw, 28px); background: color-mix(in srgb, var(--t) 7%, var(--p)); border: 1px solid color-mix(in srgb, var(--t) 22%, transparent);
  border-radius: var(--r-2); box-shadow: 0 40px 80px -40px var(--p); }
.al-form { gap: 12px; padding: 0; background: none; border: 0; border-radius: 0; }
.al-form .cf span { color: var(--t); font-weight: 600; }
.al-form .cf input, .al-form .cf textarea { background: var(--p); border-color: color-mix(in srgb, var(--t) 34%, transparent); }
.al-form .cf input:hover, .al-form .cf textarea:hover { border-color: color-mix(in srgb, var(--t) 60%, transparent); }
.al-help { margin: -6px 0 0; font-size: .86rem; color: var(--soft); }

/* Y10 the step counter: three lines, done = orange, now = light outline */
.al-steps { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--t) 14%, transparent); }
.al-steps-t { font-size: .95rem; color: var(--soft); }
.al-n { font-variant-numeric: tabular-nums; color: var(--t); margin-right: 6px; }
.al-bars { display: flex; gap: 6px; }
.al-bars i { display: block; width: 28px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--t) 18%, transparent); transition: background-color .3s ease; }
.al-bars i.is-now { background: var(--t); }
.al-bars i.is-done { background: var(--k); }

/* K4 + Y15 visible choices instead of a dropdown: 44 px, chosen = 2 px orange edge, its name in the legend */
.al-pick { border: 0; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.al-pick legend { padding: 0; margin-bottom: 8px; font-size: .9rem; font-weight: 600; color: var(--t); }
.al-pick legend i { font-style: normal; font-weight: 400; color: var(--soft); }
.al-chosen { font-weight: 500; color: var(--soft); }
.al-chosen:not(:empty)::before { content: "· "; }
.al-pick label { cursor: pointer; position: relative; }
.al-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.al-pick span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--t) 30%, transparent);
  color: var(--soft); font-weight: 500; font-size: .95rem; transition: transform 120ms var(--ease-out), border-color .15s ease, color .15s ease, background-color .15s ease; }
.al-pick input:checked + span { border: 2px solid var(--k); padding: 0 13px; color: var(--t); background: color-mix(in srgb, var(--k) 10%, transparent); }
.al-pick input:focus-visible + span { outline: 3px solid var(--t); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .al-pick label:hover span { border-color: color-mix(in srgb, var(--t) 60%, transparent); color: var(--t); } }

.al-form .cf-more { border-bottom: 0; }
.al-form .cf-more summary { padding: 0 32px 0 0; min-height: 44px; font-size: .95rem; font-weight: 600; color: var(--soft); display: flex; align-items: center; }
.al-form .cf-more summary::after { top: 6px; }
.al-form .cf-more[open] { display: grid; gap: 12px; }
.al-form .btn.go { justify-self: stretch; justify-content: space-between; margin-top: 6px; }
.al-form .cf-note { font-size: .84rem; color: var(--soft); }
.al-form .cf-status:empty { display: none; }
.al-form .cf-status.is-err { color: var(--t); border-left: 3px solid var(--t); padding-left: 10px; font-weight: 500; }
.al-form .cf-status.is-err a { color: var(--t); font-weight: 700; }
/* Y15 the error shows only after leaving the field */
.al-form .cf input[aria-invalid="true"] { border: 2px solid var(--t); }

.al-done { padding: 4px 0 6px; }
.al-done h2 { font-family: var(--disp); font-size: clamp(1.8rem, 3vw, 2.4rem); font-stretch: 108%; font-weight: 800; letter-spacing: -.02em; }
.al-done p { margin-top: 12px; color: var(--soft); max-width: none; }
.al-done .al-done-next { color: var(--t); font-weight: 600; }
.al-done:focus { outline: none; }
.al-done .al-done-to { color: var(--t); }
.al-done .al-done-to b { font-weight: 700; overflow-wrap: anywhere; }
.al-done-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.al-done-acts .btn { min-height: 48px; padding: 0 18px; color: var(--t); border-color: color-mix(in srgb, var(--t) 45%, transparent); touch-action: manipulation; }
.al-done-acts .btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .al-done-acts .btn:hover { border-color: var(--t); background: color-mix(in srgb, var(--t) 8%, transparent); } }
@media (max-width: 900px) { .al-done-acts .btn { flex: 1 1 100%; justify-content: center; } }
@media (prefers-reduced-motion: no-preference) { .al-done:not([hidden]) { animation: al-in .4s var(--ease-out) both; } @keyframes al-in { from { opacity: 0; transform: translateY(8px); } } }

/* Y11 the fields get the same 3 px ring as everything else (style.css gives them a 2 px shadow) */
.al-form .cf input:focus-visible, .al-form .cf textarea:focus-visible { outline: 3px solid var(--t); outline-offset: 3px; box-shadow: none; border-color: var(--t); }
.al-form[hidden], .al-done[hidden] { display: none; }

/* ---- the survey (Jussi 3.12.): one question at a time, only with JS; without JS the whole form shows at once ---- */
.js .al-card:not(.is-open) { display: none; }
.js .al-q:not(.is-on) { display: none; }
html:not(.js) .al-back, html:not(.js) .al-next { display: none; }
.al-q { display: grid; gap: 12px; outline: none; }
.al-q.al-pick { display: flex; }
.js .al-q.al-pick:not(.is-on) { display: none; }
.al-qt, .al-pick legend.al-qt { font-family: var(--disp); font-size: clamp(1.3rem, 1.9vw, 1.6rem); font-weight: 750; font-stretch: 104%; line-height: 1.15; letter-spacing: -.012em; color: var(--t); margin-bottom: 14px; }
.al-qt i { font: 400 .95rem/1.3 var(--font); color: var(--soft); font-style: normal; letter-spacing: 0; }
.al-form .cf span.al-qt { font-family: var(--disp); font-size: clamp(1.3rem, 1.9vw, 1.6rem); font-weight: 750; line-height: 1.15; margin-bottom: 6px; }
.al-q .cf input { min-height: 54px; font-size: 1.1rem; }
.al-nav { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.al-nav .al-back { min-height: 52px; padding: 0 18px; color: var(--t); border-color: color-mix(in srgb, var(--t) 45%, transparent); }
.al-nav .btn.go { margin: 0 0 0 auto; min-height: 52px; flex: 0 1 auto; justify-content: space-between; gap: 14px; }
.al-nav [hidden] { display: none; }
.al-q .cf-note { margin-top: 4px; }
.al-card.is-sent .al-steps-t .al-n { color: var(--k); }
@media (prefers-reduced-motion: no-preference) {
  .al-card.is-open { animation: al-in .45s cubic-bezier(.23, 1, .32, 1) both; }
  .al-q.is-on { animation: al-q .3s cubic-bezier(.23, 1, .32, 1) both; }
  @keyframes al-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
  @keyframes al-q { from { opacity: 0; transform: translateX(14px); } }
}
@media (max-width: 900px) {
  .al-nav { flex-wrap: wrap; }
  .al-nav .btn.go { flex: 1 1 auto; }
  .al-nav .al-send { flex: 1 0 100%; order: -1; margin: 0; }
}
/* home page: the card takes the phone's column */
.al-home .al-card { grid-column: 2; grid-row: 1; max-width: 560px; justify-self: end; }
@media (max-width: 900px) {
  .al-card { grid-area: auto; order: 5; }
  .al-hero.is-open .e3d-acts, .al-hero.is-open .e3d-name { display: none; }
  .al-home .al-card { grid-column: auto; grid-row: auto; max-width: none; margin-top: 14px; }
  .al-big { width: 100%; max-width: 460px; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .al-card .btn, .al-pick span, .al-bars i { transition: none; }
  .al-card .btn:active, .al-pick label:active span { transform: none; }
}

/* jury 3.12.: the card scrolls to 16 px under the edge; on a phone the open survey takes the stage alone
   (the lead line and the ribbon would sit under the stage's still frame) */
.al-card { scroll-margin-top: 16px; }
@media (max-width: 900px) {
  .al-hero.is-open .lead, .al-hero.is-open .e3d-ribbon { display: none; }
  .al-hero.is-open { padding-bottom: 28px; }
  .al-card { margin-top: 20px; }
}

/* J449: the optional coupon code (prefilled IT-NN from the notice-board QR): a plain field, smaller than the step question */
.al-form .cf.al-cpf { margin-top: 14px; }
.al-form .cf span.al-cpf-t { font-family: var(--font); font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.al-q .cf.al-cpf input { min-height: 48px; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; font-variant-numeric: tabular-nums; max-width: 16ch; }
.al-q .cf.al-cpf input::placeholder { text-transform: none; letter-spacing: 0; }
