/* The doors (A2, 2026-11; slice S4b1): every way into an account is ONE door, the board Doors
   (.scratch/ui_wave1/project/Doors.dc.html, DOR-1…14b). templates/base_auth.html is the shell (mirror
   ground, the brand top left, the other door top right, the foot); templates/accounts/door.html lays
   the door out: the plain name on top, at most one line under it, the learner's own 200px pearl on
   the thread, the lines you write on under it, and the GO on the thread to the right. Only the words
   and the pearl's state change: fog = locked, the ring (RING-3) blue while you write, gold once
   accepted, pomegranate when refused; the thread turns gold when you are let in.
   The two doors inside the app (placement/bot_check.html, accounts/email_confirm.html) draw the same
   stage inside base.html. Behaviour: static/js/a2/doors.js. Board-local classes carry the do-
   prefix; kit classes (.tb .qa .gh .go .fin .gb .grow) come from a2.css. Flat (no nesting). */

/* -- the stage ------------------------------------------------------------------------------------- */

.do{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh;color:var(--ink)}
.do-tb{flex:none}
/* THE WAY HOME (owner TW-40, 2026-11-14: "this page still has the old polygoft logo"): on the learner host the
   band's left end is the renewed app's one home button (templates/a2/home.html; its look and press are the
   shell's, static/css/a2/chrome.css and static/js/a2/dock.js, which base_auth.html links). It sits where it sits
   on every renewed page (the corner's --af-wm-edge and --af-wm-size), but in the band rather than on the
   viewport: absolute, not fixed, so it leaves with the band when a door scrolls, as the brand did. The other
   door's words share its centre line. (The office's login keeps the brand link, .af-auth-brand below.) */
.do-tb{align-items:flex-start;padding-top:calc(var(--af-wm-edge) + (var(--af-wm-size) - 44px) / 2)}
.do-tb .a2-home{position:absolute}
.do .af-auth-brand{position:static;display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none}
.do .af-auth-brand svg{display:block;flex:none}
.do-mk{width:42px;height:42px;border-radius:10px}
.do-wd{display:flex;color:var(--ink)}
.do-tb .qa{font-size:16px}
.do-m{position:relative;flex:1 0 auto;display:flex;flex-direction:column}
/* A door inside the app (base.html): the leave word rides the top band beside the brand mark, centred
   on it (the window menu's account row; the measure of a2.css's lifted back link); the corner chrome
   is base.html's own. */
.do-bk{position:relative;z-index:6;flex:none;display:flex;align-items:flex-start;min-height:76px;padding:calc(var(--af-wm-edge) + (var(--af-wm-size) - 48px) / 2) 0 0 calc(var(--af-wm-edge) + var(--af-wm-size) + 14px)}
body:has(.af-wm-home:hover) .do-bk .a2-back{opacity:0}

/* -- the name and the one line ---------------------------------------------------------------------- */

.do-q{flex:none;min-height:224px;padding:20px 24px 0;text-align:center;transition:opacity .28s}
.do-k{margin:0 0 12px;font:700 12px/1 var(--fd);letter-spacing:.18em;text-transform:uppercase;color:rgba(21,23,30,.64)}
.do-q h1{margin:0;font:800 clamp(38px,4vw + 14px,72px)/1 var(--fd);letter-spacing:-.02em;text-wrap:balance}
/* a word the heading must not fold at its hyphen ("7-day" in the guest's sign-up name) */
.do-nw{white-space:nowrap}
.do-sub{margin:14px auto 0;max-width:820px;font:500 21px/1.4 var(--fb);color:var(--mut);text-wrap:pretty}
.do-sub b,.do-sub strong{color:var(--ink);font-weight:700}
.do-sub.do-msg{color:var(--blue);font-weight:700}
.do-sub.do-msg-bad{color:var(--pom)}
.do-nt{margin:10px auto 0;max-width:700px;font:600 18px/1.4 var(--fb);color:rgba(21,23,30,.72)}

/* -- the pearl on the thread, and the GO seated on it ------------------------------------------------ */

.do-row{position:relative;flex:none;height:200px}
/* A2 (2026-11): in the source the lines come before the GO (the keyboard's order); the thread row is drawn above them. */
.do-sec{display:flex;flex-direction:column;flex:none;align-self:stretch}
.do-sec > .do-row,.do-sec > .ac-dr{order:-1}
.do-row::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;margin-bottom:-1px;background:rgba(21,23,30,.2);transition:background .5s}
.do.gilt .do-row::after{background:rgb(196,130,10)}
.do-p{position:absolute;z-index:4;left:50%;bottom:0;width:200px;height:200px;margin-left:-100px;transition:opacity .3s}
.do-p canvas{display:block;width:100%;height:100%;border-radius:50%;filter:drop-shadow(0 22px 20px rgba(21,23,30,.28))}
.do-p.do-shk{animation:a2-shake .36s ease-in-out 2}
.do-p.do-gn{opacity:0;pointer-events:none}
.do-p[hidden]{display:none}
/* RING-3: eight arcs round the pearl. The whole ring's state is its data-ring; doors.js fills arcs
   one by one (sgo) while a password or a name is written. */
.do-rg{position:absolute;left:-11%;top:-11%;width:122%;height:122%;overflow:visible}
.do-rg path{fill:none;stroke:rgba(21,23,30,.14);stroke-width:5;stroke-linecap:round;transition:stroke .22s}
.do-rg[data-ring="none"]{display:none}
.do-rg path.sgo{stroke:#1C39BB}
.do-rg path.sok,.do-rg[data-ring="gold"] path{stroke:#E8A21A}
.do-rg path.sbad,.do-rg[data-ring="bad"] path{stroke:#C4304A}
/* DOR-12: where the pearl was, an empty seat. */
.do-seat{position:absolute;left:50%;bottom:0;width:200px;height:200px;margin-left:-100px;border-radius:50%;overflow:visible;animation:a2-seat 2.4s ease-in-out infinite}
.do-seat circle{fill:none;stroke:rgba(21,23,30,.32);stroke-width:2;stroke-dasharray:5 9;stroke-linecap:round}
.do-seat[hidden]{display:none}

/* The GO on the thread at 95%: grey and still until the lines are ready (.wait, a seed pearl), blue
   when they are; wordless except where it commits ("Accept", "Sign out"); a refused one stays grey
   with its reason as its title; a wait (the lockout's clock) closes a blue ring round it. */
.do-go{position:absolute;z-index:5;left:calc(95% - 32px);bottom:0;width:0;height:0;transition:opacity .3s}
.do-go .go{position:absolute;left:-32px;bottom:-4px;margin:0;background:none}
.do-go .go::before{display:none}
.do-go .go[aria-disabled="true"]{cursor:default}
.do-go > b{position:absolute;right:-32px;bottom:78px;font:800 20px/1 var(--fd);white-space:nowrap;color:var(--blue);transition:color .3s}
.do-go.do-gwt > b{color:var(--faint)}
.do-tm{position:absolute;left:-42px;bottom:-14px;width:84px;height:84px;overflow:visible;pointer-events:none;transform:rotate(-90deg)}
.do-tm circle{fill:none;stroke:#1C39BB;stroke-width:3;stroke-linecap:round;stroke-dasharray:239;stroke-dashoffset:239;transition-property:stroke-dashoffset;transition-timing-function:linear}
.do-tm.run circle{stroke-dashoffset:0}
.do-tm.do-tdn{opacity:0;transition:opacity .5s .3s}
.do-go[hidden]{display:none}

/* -- the lines you write on ------------------------------------------------------------------------ */

.do-in{flex:none;width:480px;max-width:calc(100% - 32px);margin:30px auto 0;text-align:center}
.do-f{margin:0}
.do-fl{position:relative}
.do-fl + .do-fl{margin-top:10px}
/* The form's own inputs (Django widgets carry .af-input: these rules outrank alyfa.css's) drawn as
   the kit's writing line (.fin), centred, 30px. */
.do-in input.af-input,.do-in input.do-fin,.do .af-username-auth input.af-username-input{display:block;width:100%;height:auto;height:calc(1lh + 20px);border:0;border-bottom:2px solid var(--line2);border-radius:0;background:none;box-shadow:none;padding:8px 44px 10px;font:800 30px/1.2 var(--fd);color:var(--ink);text-align:center;outline:none;caret-color:var(--blue);transition:border-color .2s}
.do-in input.af-input::placeholder,.do-in input.do-fin::placeholder{color:rgba(21,23,30,.36);font-weight:600}
.do-in input.af-input:focus,.do-in input.do-fin:focus,.do .af-username-auth input.af-username-input:focus{border-color:var(--blue);box-shadow:none;background:none}
.do-in input.af-input:hover{border-color:var(--line2)}
.do-in input.af-input:focus-visible,.do-in input.do-fin:focus-visible{outline:none}
.do-in input.do-ok{border-color:var(--gold)}
.do-in input[aria-invalid="true"],.do-in .do-bad input{border-color:#C4304A;background:none}
.do-in .do-sl input{border-color:var(--slate)}
.do-in input[type="password"]{letter-spacing:.12em}
.do-in input.do-code{letter-spacing:.3em;font-variant-numeric:tabular-nums}
.do-in input.do-code::placeholder{letter-spacing:0}
.do-in input[type="password"]::placeholder{letter-spacing:0}
/* The second password line (a form's "confirm" field) is filled from the first by doors.js and
   then visually hidden; with no script it shows as a plain second line. */
.do-twin{margin-top:10px}
.do-eye{position:absolute;right:0;top:9px;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:#686E81}
.do-eye:hover{background:rgba(21,23,30,.07);color:#15171E}
.do-eye svg{width:20px;height:20px}
.do-eye .do-eye-off{display:none}
.do-eye[aria-pressed="true"] .do-eye-on{display:none}
.do-eye[aria-pressed="true"] .do-eye-off{display:block}
.do-eye[hidden]{display:none}

/* the one status line under the lines: a hint, a refusal (pomegranate), a not-quite (slate) */
.do-ht{min-height:22px;margin:12px 0 0;font:700 16px/1.4 var(--fb);color:var(--mut);transition:color .2s;text-wrap:pretty}
.do-ht:empty{min-height:0;margin-top:0}
.do-ht.do-hg{color:var(--blue)}
.do-ht.do-hb{color:#C4304A}
.do-ht.do-ho{color:var(--goldD)}
.do-ht.do-hs{color:var(--slate)}
.do-ht + .do-ht{margin-top:4px}

/* the side ways under the lines (plain words), Google, a stand-alone small form */
.do-lk{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px 26px;margin-top:8px}
.do-lk form{display:contents}
.do-gg{display:inline-flex;align-items:center;gap:10px;margin-top:14px}
.do-gg svg{width:18px;height:18px;flex:none}
.do-lk + .do-gg{margin-top:10px}

/* the username box (components/username_field.html, shared with Settings) on the door: its own mark
   gives way to the ring round the pearl; its refusal sentence sits under the line. */
.do .af-username-auth .af-username-box{position:relative}
.do .af-username-auth .af-username-mark{display:none}
.do .af-username-auth[data-state="bad"] input.af-username-input{border-color:#C4304A;background:none}
.do .af-username-auth[data-state="ok"] input.af-username-input:focus{border-color:var(--gold);box-shadow:none}
.do .af-username-auth .af-username-msg{display:block;min-height:22px;margin-top:12px;padding:0;font:700 16px/1.4 var(--fb);color:#C4304A}

/* DOR-13: Google's own box (the bot check) sits where the lines would be. */
.do-cap{display:flex;justify-content:center;min-height:78px;margin:6px auto 0}

/* -- the foot -------------------------------------------------------------------------------------- */

.do-ft{flex:none;margin-top:auto;padding:28px 24px 18px;text-align:center}
.do-fd{display:flex;justify-content:center;gap:22px}
.do-fd .qa{height:40px;font-size:15px}
.do-lg{margin:0 auto;max-width:820px;font:500 14px/1.5 var(--fb);color:#686E81}
.do-lg a{color:#686E81;font-weight:700;text-decoration:none;box-shadow:inset 0 -1.5px 0 rgba(21,23,30,.25)}
.do-lg a:hover{color:var(--ink);box-shadow:inset 0 -2px 0 var(--ink)}
.do-lg + .do-lg{margin-top:2px;font-size:13px}

/* -- a page that still fills the old block (the staff code, the office's two pages): a white card on
   the same stage until its own slice renews it -------------------------------------------------- */

.do-legacy{display:flex;justify-content:center;padding:24px 16px}
.do-legacy .af-auth-card{box-shadow:0 0 0 1px var(--line),0 30px 60px -36px rgba(10,14,40,.45);font-family:var(--fb)}

/* -- leaving: the words fade as the door opens (sign-in submitted) -------------------------------- */

.do.leaving .do-q,.do.leaving .do-in{opacity:.55;transition:opacity .4s}
/* ROLL-2 (board Onboard toTrial, F3 2026-11-13): the username step's GO pressed, the pearl rolls off the
   right edge (static/js/a2/doors.js); the words slide away left and the GO steps out of its path. */
.do.do-rolling .do-q,.do.do-rolling .do-in{opacity:0;transform:translateX(-170px);transition:opacity .4s,transform .5s cubic-bezier(.5,0,.8,.4)}
.do.do-rolling .do-go{opacity:0;pointer-events:none}
.do.do-rolling .do-row{transform-origin:50% 100%}

/* -- in between (700–1100px): the structure stays --------------------------------------------------- */

@media (max-width:1099px){
  .do-go{left:calc(100% - 72px)}
}
@media (max-height:819px) and (min-width:700px) and (orientation:landscape),(max-height:819px) and (min-width:1200px){
  .do-q{min-height:196px;padding-top:8px}
  .do-row{height:176px}
  .do-p,.do-seat{width:176px;height:176px;margin-left:-88px}
  .do-in{margin-top:24px}
}

/* -- below 700px: one column; the pearl 132px; the GO leaves the thread for the bottom dock ---------- */

@media (max-width:699px),(orientation:portrait) and (max-width:1199px){
  .do-tb{height:64px;padding:calc(var(--af-wm-edge) + (var(--af-wm-size) - 44px) / 2) 16px 0;gap:12px}
  .do-mk{width:36px;height:36px;border-radius:9px}
  .do-wd svg{width:85px;height:24px}
  .do-tb .qa{height:44px;font-size:15px;white-space:normal;text-align:right;line-height:1.15}
  .do-bk{min-height:64px}
  .do-q{min-height:0;padding:20px 16px 0}
  .do-q h1{font-size:38px}
  .do-sub{margin-top:10px;font-size:18px}
  .do-nt{font-size:16px}
  .do-row{height:132px;margin-top:34px}
  .do-p,.do-seat{width:132px;height:132px;margin-left:-66px}
  .do-in{width:auto;max-width:none;margin:28px 16px 0}
  .do-in input.af-input,.do-in input.do-fin,.do .af-username-auth input.af-username-input{font-size:24px;padding-left:40px;padding-right:40px}
  .do-go{position:fixed;left:0;right:0;bottom:0;z-index:45;width:auto;height:76px;padding-bottom:env(safe-area-inset-bottom,0px)}
  .do-go .go{left:auto;right:20px;bottom:2px}
  /* the word ends 16px short of its pearl: the .go box is 88px (20 + 88 + 16; R1-5, FX-A 2026-11) */
  .do-go > b{right:124px;bottom:28px}
  /* beside the corner buttons on their row (a2.css, html.a2-dock-row / -free): the pearl on their centre line,
     46px over the bottom edge */
  html:is(.a2-dock-row,.a2-dock-free) .do-go .go{bottom:10px}
  html:is(.a2-dock-row,.a2-dock-free) .do-go > b{bottom:36px}
  .do-tm{left:auto;right:10px;bottom:-8px}
  /* QC2 O6 (owner, 2026-11-21): Privacy and Terms stand on the very bottom of every door, GO or none; they are
     centred, clear of the GO's column at the right */
  .do:has(.do-go:not([hidden])) .do-ft{padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
  .do-ft{padding-top:24px}
  .do-lg{font-size:12.5px}
  .do-lg + .do-lg{font-size:12px}
  /* R6-D1 (owner's sign-up screenshot, 2026-11-18): Safari shows 664px of a 713px sign-up page, so at rest
     the pinned GO sat on "Terms of Service" (the padding above clears it only at the scroll's end). The
     legal lines keep to the left of the GO's column (20 + 88px), whatever the scroll. */
  .do:has(.do-go:not([hidden])) .do-lg{margin:0 108px 0 0;text-align:justify;text-align-last:left;hyphens:auto}
  .do:has(.do-go:not([hidden])) .do-lg + .do-lg{margin-top:2px}
}
/* R15m-D1 (owner, 2026-11-19, the iPad mini's sign-up: "make this text centered and bring it slightly up"): on an upright tablet
   the legal lines stand centred between equal margins (still clear of the GO's column) and a little higher */
@media (min-width:560px) and (max-width:699.98px),(min-width:560px) and (orientation:portrait) and (max-width:1199px){
  .do:has(.do-go:not([hidden])) .do-lg{margin:0 108px;text-align:center}
}

@media (prefers-reduced-motion:reduce){
  .do-p.do-shk,.do-seat{animation:none}
  .do-tm circle{transition-duration:0s !important}
}
