/* The app's two palettes, nothing invented here: light is the site's, dark is the one the app and
   the home page already wear (frontend/src/styles/home/dark.css). The stored choice decides. */
:root{
  --room:#F4F7FA; --card:#FFFFFF; --edge:#DEE7F0; --rule:#E2E9F0;
  --t1:#132338; --t2:#3F5570; --t3:#77899E;
  --field:#FFFFFF; --field-line:#C8D5E2; --chip:#FFFFFF; --chip-line:#C8D5E2; --chip-hover:#F7FAFC;
  --accent:#B36F78; --send:#171515; --send-ink:#FFFFFF; --send-hover:#2E2A2A;
  --plate:#06283C; --ember:#B04559; --dot:rgba(19,35,56,.13);
  --disp:'Jost',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --gut:clamp(20px,3.4vh,52px);
}
/* They came off a white page, so the room starts white and settles into the app's grey. */
:root:not(.settled){--room:#FFFFFF}
:root[data-theme="dark"]{
  color-scheme:dark;
  --room:#141418; --card:#1e1e23; --edge:#3b3b45; --rule:#323239;
  --t1:#e7e8eb; --t2:#a5a6ad; --t3:#94959c;
  --field:#19191d; --field-line:#3b3b45; --chip:#2a2a31; --chip-line:#3b3b45; --chip-hover:#323239;
  --accent:#D79AA2; --send:#F4F1F1; --send-ink:#171515; --send-hover:#FFFFFF;
  --plate:#06283C; --dot:rgba(231,232,235,.10);
}
*{box-sizing:border-box;margin:0;padding:0}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.auth-card > *,.auth-legal{animation:rise .5s cubic-bezier(.22,.68,.32,1) both}
.auth-card > :nth-child(2){animation-delay:.05s}.auth-card > :nth-child(3){animation-delay:.1s}
.auth-card > :nth-child(4){animation-delay:.15s}.auth-card > :nth-child(5){animation-delay:.2s}
.auth-legal{animation-delay:.26s}
@media(prefers-reduced-motion:reduce){.auth-card > *,.auth-legal{animation:none}}
body,.auth-shell,.auth-pane,.auth-sub,.auth-btn,.auth-field,.auth-rule,.auth-foot,.auth-legal,.auth-or,
.auth-email-form input,.auth-sent h2,.auth-sent p{transition:background-color 1.9s cubic-bezier(.22,.61,.36,1) .15s,border-color 1.9s cubic-bezier(.22,.61,.36,1) .15s,color 1.9s cubic-bezier(.22,.61,.36,1) .15s}
html,body{height:100%}
/* The page is one screen: the card is sized to the window, so nothing here ever scrolls. */
body{display:flex;align-items:center;justify-content:center;padding:var(--gut);overflow:hidden;
  background:var(--room);color:var(--t1);font-family:var(--disp);-webkit-font-smoothing:antialiased;
  background-image:radial-gradient(var(--dot) 1px,transparent 1.4px);background-size:12px 12px}
a{color:inherit;text-decoration:none}
[hidden]{display:none!important}
::selection{background:var(--accent);color:#171515}
:focus-visible{outline:3px solid rgba(201,139,147,.38);outline-offset:3px}

/* Two halves: an animated plate carrying the one sentence, and the form. Nothing else is on
   screen, so neither half has to compete. */
.auth-shell{display:flex;width:100%;max-width:1200px;height:calc(100dvh - var(--gut) * 2);max-height:900px;
  overflow:hidden;background:var(--card);border:1px solid var(--edge);border-radius:16px;
  box-shadow:0 30px 70px -40px rgba(19,35,56,.45)}
:root[data-theme="dark"] .auth-shell{box-shadow:0 40px 90px -45px rgba(0,0,0,.8)}

.auth-art{position:relative;flex:0 0 50%;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;
  gap:24px;padding:clamp(28px,3.4vw,48px);overflow:hidden;background:var(--plate)}
.auth-art canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.auth-art::after{content:'';position:absolute;left:0;right:0;bottom:0;height:62%;pointer-events:none;
  background:linear-gradient(to top,rgba(4,26,40,.78),rgba(4,26,40,0))}
/* The way back has to be readable wherever the cloth happens to be bright. */
.auth-art::before{content:'';position:absolute;left:0;right:0;top:0;height:26%;pointer-events:none;
  background:linear-gradient(to bottom,rgba(4,26,40,.5),rgba(4,26,40,0))}
.auth-back{position:relative;z-index:1;display:inline-flex;align-items:center;gap:8px;
  font-size:14px;color:rgba(6,40,60,.8);transition:color .16s}
.auth-back:hover{color:#06283C}
.auth-back svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
.auth-back:hover svg{transform:translateX(-4px)}
.auth-say{position:relative;z-index:1;max-width:420px}
/* The mark is drawn in pixels, so it is blown up in whole squares like the cloth behind it. */
.auth-mark{display:block;width:clamp(40px,4vw,56px);height:auto;margin-bottom:clamp(12px,1.6vh,20px);image-rendering:pixelated;
  filter:drop-shadow(0 0 7px rgba(4,26,40,.55)) drop-shadow(0 0 16px rgba(4,26,40,.4))}
.auth-say h1{font-size:clamp(28px,2.8vw,38px);font-weight:600;letter-spacing:-.02em;line-height:1.24;color:#FFFFFF;text-shadow:0 .04em 0 #08476A}
.auth-say h1 span{color:#D7DEE4}

/* the form column: logo, card, small print, in three bands */
.auth-pane{display:flex;flex-direction:column;flex:1;min-width:0;overflow-y:auto;background:var(--card);border-left:1px solid var(--edge)}
.auth-body{flex:1;display:flex;align-items:center;justify-content:center;padding:clamp(12px,3vh,32px)}
.auth-card{width:100%;max-width:420px;flex-shrink:0}
.auth-sub{font-size:clamp(21px,3vh,26px);font-weight:650;letter-spacing:-.015em;color:var(--t1);margin-bottom:clamp(10px,2.2vh,20px)}
.auth-buttons{display:flex;gap:10px}
.auth-btn{flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:center;gap:9px;height:clamp(40px,6.4vh,48px);padding:0 14px;
  border:1.5px dashed var(--chip-line);border-radius:12px;background:var(--chip);font-family:var(--disp);font-size:14.5px;font-weight:500;
  color:var(--t1);cursor:pointer;transition:border-color .16s,background .16s}
.auth-btn:hover{border-style:solid;border-color:var(--t3);background:var(--chip-hover)}
.auth-ic{width:17px;height:17px;flex:0 0 auto}
.auth-or{display:flex;align-items:center;gap:12px;margin:clamp(9px,2vh,18px) 0;font-size:11px;font-weight:500;letter-spacing:.1em;color:var(--t3)}
.auth-or::before,.auth-or::after{content:'';flex:1;height:1px;background:var(--rule)}
.auth-email-form{display:grid;gap:clamp(7px,1.7vh,14px)}
.auth-field{display:grid;gap:clamp(3px,.7vh,6px);font-size:12.5px;font-weight:500;color:var(--t2)}
.auth-email-form input{width:100%;min-width:0;height:clamp(40px,6.4vh,48px);padding:0 16px;border:1.5px dashed var(--field-line);border-radius:12px;
  font-family:var(--disp);font-size:15.5px;color:var(--t1);background:var(--field);transition:border-color .16s}
.auth-email-form input:hover{border-color:var(--t3)}
.auth-email-form input::placeholder{color:var(--t3)}
.auth-email-form input:focus{outline:none;border-style:solid;border-color:var(--t1)}
.auth-rule{font-size:11.5px;font-weight:400;line-height:1.45;color:var(--t3);margin-top:-6px}
/* The one button that sends: paper on a dark card, ink on a light one. The green lives in the
   plate's first seconds, not on a control. */
.auth-email-form button{width:100%;margin-top:6px;height:clamp(42px,6.6vh,48px);border:0;border-radius:12px;
  background:var(--send);color:var(--send-ink);font-family:var(--disp);font-size:15.5px;font-weight:600;cursor:pointer;
  transition:background-color .16s,transform .16s cubic-bezier(.25,.46,.45,.94)}
.auth-email-form button:hover{background:var(--send-hover)}
.auth-email-form button:active{transform:translateY(1px) scale(.99)}
/* Working: the button goes quiet and a ring turns beside the words, so a press visibly took. */
.auth-email-form button:disabled{background:var(--chip);color:var(--t3);cursor:progress;transform:none}
.auth-email-form button:disabled::before{content:'';display:inline-block;width:13px;height:13px;margin-right:9px;vertical-align:-2px;
  border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:auth-turn .7s linear infinite}
@keyframes auth-turn{to{transform:rotate(360deg)}}
.auth-error{margin-top:12px;font-size:12.5px;line-height:1.45;color:var(--ember)}
.auth-foot{margin-top:clamp(10px,2vh,16px);font-size:13px;color:var(--t3);text-align:center}
.auth-foot a{color:var(--accent);font-weight:600}
.auth-foot a:hover{text-decoration:underline}
.auth-turnstile{margin-top:clamp(9px,1.6vh,14px)}
.auth-legal{padding:0 32px clamp(12px,3vh,32px);font-size:11.5px;line-height:1.5;color:var(--t3);text-align:center}
.auth-legal a{color:var(--t2);text-decoration:underline;text-underline-offset:3px}
/* The house art, not a one-off drawing: the same envelope the home page animates. */
.auth-sent{text-align:center}
.auth-sent-art{display:block;width:104px;height:104px;margin:0 auto 22px}
.auth-sent h2{font-size:26px;font-weight:650;letter-spacing:-.015em;color:var(--t1);margin-bottom:10px}
.auth-sent p{font-size:14.5px;line-height:1.55;color:var(--t2)}
.auth-sent-help{display:flex;justify-content:center;gap:22px;margin-top:26px;padding-top:18px;border-top:1px solid var(--rule)}
.auth-sent-help a{font-size:13.5px;font-weight:600;color:var(--accent)}
.auth-sent-help a:hover{text-decoration:underline}
.auth-sent-help a.held{color:var(--t3);font-weight:400;pointer-events:none}
/* A short window is the common one on a laptop: the bands give way together so the whole card
   still lands on one screen. */
@media(max-height:800px){
  :root{--gut:12px}
  .auth-sub{font-size:20px;margin-bottom:9px}
  .auth-or{margin:8px 0}
  .auth-legal{padding-bottom:10px;font-size:10.5px;line-height:1.4}
  .auth-foot{margin-top:8px}
}
@media(max-width:860px){
  /* The plate is decoration. Beside a form this narrow it takes the fields' room, so it keeps the
     sentence and gives the width back. */
  .auth-shell{flex-direction:column;height:auto;max-height:none}
  .auth-art{flex:0 0 auto;padding:22px}
  .auth-say h1{font-size:22px}
}