/* The installer, on top of home.css (colours, type, buttons, forms). */

.installer { max-width: 688px; padding-top: 20px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.installer h1 { font-size: 46px; margin-bottom: 12px; }
.installer h2 { font-size: 26px; }
.installer .lead { font-size: 18px; margin-bottom: 26px; }
.installer section { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px 28px; margin-bottom: 18px;
  box-shadow: 0 24px 50px -30px rgba(40, 28, 10, .35); animation: arrive .35s ease both; }
.installer footer { max-width: none; text-align: left; margin-top: 20px; }
.installer section > :last-child { margin-bottom: 0; }
@keyframes arrive { from { transform: translateY(8px); } }

/* before you start */
.latest { display: flex; gap: 4px 14px; flex-wrap: wrap; justify-content: space-between; margin: 0 0 4px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--soft); font-size: 15px; }
.latest a { font-size: 14px; color: var(--muted); }
#latest-firmware { margin: 8px 0 0; }
.ready { list-style: none; margin: 14px 0 20px; padding: 0; }
.ready li { padding: 10px 0; }
.ready li + li { border-top: 1px solid var(--line); }

/* choices and facts */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; margin: 0 0 14px; min-width: 0; }
legend { padding: 0 6px; font-weight: 600; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.choice > span { min-width: 0; flex: 1; }
.choice input[type=checkbox], .choice input[type=radio] { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--ink); }
.choice select, .choice input[type=url] { display: block; width: 100%; margin-top: 6px; font: inherit; color: var(--ink); background: var(--paper);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.choice select:disabled, .choice input[type=url]:disabled { opacity: .5; }
#name-row { margin-left: 30px; }
#key-row { margin-left: 30px; }
.field .small { display: block; margin-top: 4px; }
#relay-status.ok { color: var(--good); }
#relay-status.bad { color: var(--bad); }
.status, .addon { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; }
.status { background: var(--soft); }
.status > b { display: block; font-size: 17px; }
.status ul { margin: 8px 0 0; padding-left: 20px; }
.status ul:empty, .status p:empty, .addon p:empty { display: none; }
.status p, .addon p { margin: 6px 0 0; }
.status.update { border: 2px solid var(--ink); }
.status.ok > b { color: var(--good); }
.addon.caution { border-color: var(--bad); }
.addon.caution #mod-note { color: var(--bad); }
.addon b { overflow-wrap: anywhere; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 19px; letter-spacing: .02em; background: var(--soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; text-align: center; overflow-wrap: anywhere; }

.progress { list-style: none; padding: 0; margin: 0; }
.progress li { padding: 6px 0 6px 28px; position: relative; overflow-wrap: anywhere; }
.progress li::before { position: absolute; left: 0; content: "→"; color: var(--muted); }
.progress li.ok::before { content: "✓"; color: var(--good); }
.progress li.bad::before { content: "✕"; color: var(--bad); }
.progress li:has(button)::before { content: ""; }

/* what's next */
.next-title { margin-top: 30px; }
.next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.next li { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.next svg { width: 46px; height: 46px; padding: 12px; border-radius: 10px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  background: color-mix(in srgb, var(--muted) 14%, transparent); }
.next p { margin: 2px 0 0; }
.next a.button { padding: 8px 18px; font-size: 15px; }
.next li:not(:has(a.button)) > div { grid-column: 2 / -1; }

/* ------------------------------------------------------------------ the small Kobo */

.stage { --level: 0; flex: none; width: 84px; height: auto; overflow: hidden; }
.stage * { transform-box: view-box; }
.stage path, .s-battery rect:first-child { fill: none; stroke: #2a2a2a; stroke-linecap: round; stroke-linejoin: round; }
.s-shell { fill: #37383b; stroke: #55565a; }
.s-screen { fill: #f7f5ef; }
.stage .s-cord { stroke: var(--muted); stroke-width: 4; }
.s-plug { fill: var(--muted); }
.s-tip { fill: color-mix(in srgb, var(--muted) 55%, var(--soft)); }
.s-battery path, .s-battery rect:first-child { stroke-width: 1; }
.s-charge { fill: #2a2a2a; transform: scaleX(.3); transform-origin: 70px 18px; transition: transform .8s ease; }
.stage:not([data-scene="before"]) .s-charge { transform: none; }
.stage .s-page { stroke: #bdbab2; stroke-width: 2.5; }
.stage .s-ask path { stroke: #2a2a2a; stroke-width: 2.2; }
.s-ask rect { fill: #2a2a2a; }
.stage .s-ask .s-ask-word { stroke: #f7f5ef; }
.s-bar rect:first-child { fill: none; stroke: #2a2a2a; stroke-width: 1.2; }
.s-bar-fill { fill: #2a2a2a; transform: scaleX(var(--level)); transform-origin: 27px 56px; transition: transform .5s ease; }
.stage .s-code { stroke: #2a2a2a; stroke-width: 4; stroke-linecap: butt; }
.stage .s-tick { stroke: #2a2a2a; stroke-width: 5; stroke-dasharray: 40; stroke-dashoffset: 40; }
.stage .s-cross { stroke: #2a2a2a; stroke-width: 4; }

/* what's on its screen */
.s-page, .s-ask, .s-bar, .s-code, .s-tick, .s-cross { opacity: 0; transition: opacity .3s; }
.stage:is([data-scene="before"], [data-scene="options"]) .s-page, .stage[data-scene="connect"] .s-ask, .stage[data-scene="install"] .s-bar,
.stage[data-scene="recovery"] .s-code, .stage[data-scene="done"] .s-tick, .stage[data-scene="unsupported"] .s-cross { opacity: 1; }
.stage.worried :is(.s-page, .s-ask, .s-bar, .s-code, .s-tick) { opacity: 0 !important; }
.stage.worried .s-cross { opacity: 1; }
.stage[data-scene="done"] .s-tick { stroke-dashoffset: 0; transition: opacity .3s, stroke-dashoffset .6s .2s ease; }

/* the cable goes in, and comes out again at the end */
.s-cable { transition: transform .9s cubic-bezier(.5, 0, .2, 1); }
.stage:is([data-scene="before"], [data-scene="unsupported"]) .s-cable { transform: translateY(16px); }
.stage[data-scene="done"] .s-cable { transform: translateY(60px); }

@media (max-width: 560px) {
  .top { gap: 16px; }
  .stage { width: 60px; }
  .installer h1 { font-size: 32px; }
  .installer .lead { font-size: 16px; }
  .installer section { padding: 20px 16px 22px; border-radius: 14px; }
  .steps li:not(.current) span { display: none; }
  .steps li.current { flex: 3; }
  .next li { grid-template-columns: 40px minmax(0, 1fr); }
  .next svg { width: 40px; height: 40px; padding: 10px; align-self: start; }
  .next a.button { grid-column: 2; justify-self: start; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .installer section, .stage, .stage * { animation: none !important; transition: none !important; }
}
