/* The sign-in pages (login.html, confirm.html, reset.html), on top of site.css. Shared form pieces, all prefixed af-.
   Fields use site.css .field; buttons use .btn. Errors are danger text under the field they concern; nothing shakes or bounces. */

/* fields */
.af-form{display:grid;gap:18px;margin:0}
.af-field{display:grid;gap:6px;min-width:0}
.af-field>label{font-weight:700;font-size:16px;line-height:1.5;color:var(--ink)}
.af-hint{margin:-2px 0 2px;font-size:15px;line-height:1.6;color:var(--ink-soft)}
.af-field .field{height:52px}
.af-field .field-msg{margin:2px 0 0;font-size:15px;line-height:1.6}
.af-err{display:flex;gap:6px;font-weight:600}
.af-err::before{content:"";flex:none;width:18px;height:18px;margin-top:.2em;border-radius:50%;background:var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 4.5v5.2' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='13' r='1.3' fill='%23fff'/%3E%3C/svg%3E") center/18px no-repeat}

/* password with a show button inside the same box */
.af-pw{position:relative}
.af-pw .field{padding-right:92px}
.af-eye{position:absolute;right:4px;top:4px;bottom:4px;display:inline-flex;align-items:center;gap:6px;padding:0 12px;border:0;border-radius:6px;background:none;color:var(--cobalt-deep);font-weight:700;font-size:15px;cursor:pointer;min-width:44px}
.af-eye:hover{background:var(--sky-faint)}
.af-eye svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.af-eye.on svg{opacity:.55}

/* the live checklist: grey until typed, then each rule turns green with a tick */
.af-rules{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px 8px}
.af-rules li{display:inline-flex;align-items:center;gap:4px;padding:3px 10px 3px 6px;border-radius:var(--r-xs);background:var(--grey);color:var(--ink-soft);font-size:14px;font-weight:600;line-height:1.5;transition:background-color .15s ease,color .15s ease}
.af-rules svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;opacity:.35}
.af-rules li.ok{background:var(--ok-wash);color:var(--ok)}
.af-rules li.ok svg{opacity:1}

/* the consent tick-box: a real checkbox, drawn larger */
.af-consent{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;align-items:start;padding:14px 16px;border-radius:var(--r-m);background:var(--sky-faint);box-shadow:inset 0 0 0 1px var(--line)}
.af-consent input{appearance:none;-webkit-appearance:none;margin:2px 0 0;width:26px;height:26px;border-radius:6px;background:#fff;box-shadow:inset 0 0 0 2px var(--line-strong);cursor:pointer;display:grid;place-items:center}
.af-consent input:checked{background:var(--cobalt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat;box-shadow:none}
.af-consent input[aria-invalid=true]{box-shadow:inset 0 0 0 2px var(--danger)}
.af-consent label{font-size:15px;line-height:1.75;color:var(--ink);cursor:pointer}
.af-consent label a{color:var(--cobalt-deep);font-weight:700;text-underline-offset:3px}
.af-consent .field-msg{grid-column:2}

/* submit, and what keeps it closed */
.af-submit{display:grid;gap:8px;margin-top:2px}
.af-gate{margin:0;font-size:14px;line-height:1.6;color:var(--ink-soft);text-align:center}
.btn[aria-busy=true]{cursor:progress}
.af-form-err,.af-alert{margin:0;padding:12px 14px;border-radius:var(--r-s);background:#FDECEA;color:var(--danger);font-size:15px;font-weight:600;line-height:1.6}
.af-form-err:focus{outline:none;box-shadow:inset 0 0 0 2px var(--danger)}
.af-alert{margin-top:18px}
.af-captcha{min-height:0}
.af-captcha:focus{outline:none}
.af-captcha-slot{min-height:0}
.af-captcha.af-quiet{position:absolute}   /* the check runs unseen: out of the form's grid, so nothing moves */

/* Google's neutral button: white, grey hairline, their G, their words (Roboto Medium where it loads) */
.af-google{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:52px;margin-top:24px;padding:0 20px;border-radius:var(--r-s);background:#fff;box-shadow:inset 0 0 0 1px #747775;color:#1F1F1F;font-family:Roboto,var(--ui);font-weight:500;font-size:16px;letter-spacing:.01em;text-decoration:none;transition:background-color .15s ease}
.af-google:hover{background:#F8FAFD}
.af-google:active{background:#F1F3F4}
.af-g{width:20px;height:20px;flex:none}

/* "or" between Google and email */
.af-or{display:flex;align-items:center;gap:14px;margin:22px 0 16px;font-size:14px;font-weight:600;color:var(--ink-soft)}
.af-or::before,.af-or::after{content:"";flex:1;height:1px;background:var(--line)}

.af-note{margin:0;font-size:15px;line-height:1.7;color:var(--ink-soft)}
.af-sub{margin-top:8px;padding:16px;border-radius:var(--r-m);box-shadow:inset 0 0 0 1px var(--line)}
.af-done{margin-top:8px;padding:16px;border-radius:var(--r-m);background:var(--ok-wash)}
.af-done:focus{outline:none;box-shadow:inset 0 0 0 2px var(--ok)}
.af-done p{margin:0;font-size:15px;line-height:1.75;color:var(--ink)}
.af-done b{display:block;color:var(--ok)}
.af-steps{margin:18px 0 0;padding-left:1.2em;display:grid;gap:6px;font-size:16px;line-height:1.7;color:var(--ink-soft)}

/* demo mode only: dashed, amber-ink, never looks like the real thing */
.af-demo{margin:16px 0 0;padding:12px 14px;border-radius:var(--r-s);border:1.5px dashed var(--amber-deep);background:var(--paper);font-size:15px;line-height:1.7;color:var(--amber-ink)}
.af-done .af-demo{margin-top:12px}
.af-demo .link{min-height:0;margin-left:4px}

/* confirm.html and reset.html: one calm column with 小鵲 on top */
.ap{padding:clamp(28px,5vw,64px) 0 0}
.ap-in{max-width:520px}
.ap-bird{width:132px;height:auto;margin:0 0 8px}
.ap h1{font-size:clamp(28px,3.2vw,40px)}
.ap h1:focus{outline:none}
.ap .lede{margin-top:10px}
.ap .af-form{margin-top:24px}
.ap-acts{display:flex;flex-wrap:wrap;gap:12px 16px;margin-top:24px}
.ap-acts .btn{min-width:min(100%,220px)}
@media (max-width:560px){
  .ap-acts{flex-direction:column}
  .ap-acts .btn{width:100%}
  .ap-bird{width:104px}
}
@media (prefers-reduced-motion:reduce){
  .af-rules li,.af-google{transition:none}
}
