/* Login screen with the brand intro - design_handoff_avelio_login.
   Values are the handoff's; the timeline table in its README is the source.
   Every animation sits under html.av-intro, which a head script adds only
   when the intro should play: without it (no JS, reduced motion, a failed
   attempt) the rules below the keyframes are already the final state. */

:root {
  --av-paper: #F4F2EC;
  --av-slate: #5D6D8E;
  --av-slate-hover: #4B5A78;
  --av-cream: #DDD9C9;
  --av-ink: #2E3850;
  --av-line: #C3C8D2;
  --av-err: #B3261E;   /* not in the handoff (errors were not designed); a red that reads on the paper colour */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--av-paper); }
body { font-family: "Montserrat", sans-serif; -webkit-font-smoothing: antialiased; }

.av-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
           padding: 48px 24px; overflow: hidden; }
.av-col { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; }

/* ---------------------------------------------------------------- logo */
.av-logo { display: flex; flex-direction: column; align-items: center; cursor: pointer; outline: none;
           -webkit-tap-highlight-color: transparent; }
.av-logo:focus-visible { outline: 2px solid var(--av-slate); outline-offset: 8px; border-radius: 8px; }
.av-logo svg { display: block; overflow: visible; }
.av-ring { stroke-dasharray: 434; stroke-dashoffset: 0; }   /* 2πr for r=69 */
.av-chev { stroke-dasharray: 150; stroke-dashoffset: 0; }   /* two legs of ~74.5 each */
.av-word { display: flex; justify-content: center; margin-top: 28px;
           /* trailing tracking pushes the word left; padding the same amount re-centres it */
           padding-left: .3em; font-weight: 600; font-size: 34px; letter-spacing: .3em; line-height: 1;
           color: var(--av-slate); }
.av-word span { display: inline-block; }
.av-tag { margin-top: 14px; padding-left: .32em; font-weight: 600; font-size: 11px; letter-spacing: .32em;
          color: var(--av-slate); white-space: nowrap; }

/* ---------------------------------------------------------------- form */
.av-form { width: 100%; margin-top: 52px; display: flex; flex-direction: column; gap: 24px;
           transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.av-field { display: flex; flex-direction: column; gap: 4px; }
.av-field > span { font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
                   color: var(--av-slate); }
.av-field input { font-family: inherit; font-size: 16px; font-weight: 500; color: var(--av-ink);
                  background: transparent; border: none; border-bottom: 1.5px solid var(--av-line);
                  border-radius: 0; padding: 12px 0; outline: none; transition: border-color .2s ease;
                  -webkit-appearance: none; appearance: none; }
.av-field input:focus { border-bottom-color: var(--av-slate); }
.av-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--av-paper) inset;
                                   -webkit-text-fill-color: var(--av-ink); }
.av-field input.av-bad { border-bottom-color: var(--av-err); }
.av-err { margin: 6px 0 0; font-size: 12px; font-weight: 500; color: var(--av-err); line-height: 1.4; }
.av-submit { margin-top: 16px; height: 52px; width: 100%; border: none; border-radius: 999px;
             background: var(--av-slate); color: var(--av-paper); font-family: inherit; font-size: 12px;
             font-weight: 600; letter-spacing: .24em; text-transform: uppercase; cursor: pointer;
             transition: background .2s ease; }
.av-submit:hover { background: var(--av-slate-hover); }
.av-submit:focus-visible { outline: 2px solid var(--av-slate); outline-offset: 3px; }
.av-submit[aria-busy="true"] { cursor: progress; }

/* --------------------------------------------------------------- intro */
@keyframes av-disc   { from { transform: scale(0); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes av-draw   { to { stroke-dashoffset: 0 } }
@keyframes av-letter { from { opacity: 0; transform: translateY(14px); filter: blur(6px) }
                       to { opacity: 1; transform: none; filter: none } }
@keyframes av-track  { from { opacity: 0; letter-spacing: .8em } to { opacity: 1; letter-spacing: .32em } }
/* 150px is about half the form's height: during the splash the logo sits
   near the middle of the viewport. Change it if the form grows. */
@keyframes av-settle { from { transform: translateY(150px) scale(1.2) } to { transform: none } }

.av-intro .av-disc { transform-box: fill-box; transform-origin: center;
                     animation: av-disc .8s cubic-bezier(.34,1.45,.55,1) 0s both; }
.av-intro .av-ring { stroke-dashoffset: 434; animation: av-draw 1.05s cubic-bezier(.65,0,.35,1) .5s both; }
.av-intro .av-chev { stroke-dashoffset: 150; animation: av-draw .7s cubic-bezier(.65,0,.35,1) 1.25s both; }
.av-intro .av-word span { animation: av-letter .65s cubic-bezier(.2,.8,.2,1) calc(1.7s + var(--i) * .07s) both; }
.av-intro .av-tag { animation: av-track 1s cubic-bezier(.2,.8,.2,1) 2.15s both; }
.av-intro .av-logo { animation: av-settle .95s cubic-bezier(.65,0,.35,1) 2.9s both; }
/* the form keeps its space the whole time, so nothing reflows when it appears */
.av-intro .av-form:not(.ready) { opacity: 0; transform: translateY(16px); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .av-form { transition: none; }
}
