/* Extracted unchanged from the prototype site/login.html. */
/* Split screen sign in: brand panel with the mascot on the left, one short form on the right.
   On phones the panel folds away and a small mascot sits above the form. Dark only, like the landing. */
:root {
  color-scheme: dark;
  --night: #0D0D0D; --coal: #151415; --coal-2: #1E1D1E; --edge: #333333; --edge-2: #4A4A4A;
  --gold: #F4C644; --sun: #FFDE69; --white: #FFFFFF; --mute: #A3A3A3; --no: #FF7A6B; --ok: #5BD38D;
  --display: 'Bricolage Grotesque', 'Arial Black', Arial, sans-serif;
  --body: 'DM Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.logo .mark { width: 34px; height: 34px; flex: none; }
@media (max-width: 900px) { .logo .mark { width: 30px; height: 30px; } }
::selection { background: #F4C644; color: #0D0D0D; text-shadow: none; }
::-moz-selection { background: #F4C644; color: #0D0D0D; text-shadow: none; }
html, body { height: 100%; }
body { margin: 0; background: var(--night); color: var(--white); font: 16px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 8px; }

.shell { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Brand panel */
.brand { position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; text-align: center; gap: 24px; padding: 40px 40px 32px; background: var(--coal); border-right: 2px solid var(--edge); }
.brand::before, .brand::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(244,198,68,.42); background: radial-gradient(circle, rgba(244,198,68,.12) 0%, rgba(244,198,68,.05) 55%, transparent 72%); }
.brand::before { top: -150px; left: -150px; }
.brand::after { bottom: -170px; right: -170px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo b { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; }
.logo span { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; background: var(--gold); color: #0D0D0D; padding: 4px 8px; border-radius: 6px; border: 2px solid #0D0D0D; transform: rotate(-3deg); }
.hello { align-self: center; display: grid; justify-items: center; gap: 20px; }
.halo { width: min(22rem, 34vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--gold); background: radial-gradient(circle at 50% 55%, rgba(244,198,68,.22), rgba(244,198,68,0) 68%), var(--night); }
.bot { width: 78%; filter: drop-shadow(0 14px 20px rgba(0,0,0,.5)); }
.hello h2 { font-size: clamp(1.9rem, 2.8vw, 2.6rem); max-width: 16ch; }
.hello p { color: var(--mute); font-size: 1.1rem; max-width: 30ch; }
.note { color: var(--mute); font-size: .88rem; max-width: 40ch; }

/* Form pane */
.pane { display: grid; place-items: center; padding: 40px 24px; }
.card { width: 100%; max-width: 26rem; display: grid; gap: 20px; }
.m-only { display: none; }
.head { text-align: center; display: grid; gap: 8px; }
.head h1 { font-size: 2.4rem; }
.head p { color: var(--mute); }

/* Phone and one time code */
.step { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
label { font-weight: 600; font-size: .95rem; }
.tel { display: flex; align-items: stretch; min-height: 56px; background: var(--coal); border: 2px solid var(--edge); border-radius: 12px; transition: border-color .15s; overflow: hidden; }
.tel:hover { border-color: var(--edge-2); }
.tel:focus-within { border-color: var(--gold); }
.flag { width: 24px; height: 16px; flex: none; display: block; }
.tel.bad, .field.bad input { border-color: var(--no); }
.cc { display: flex; align-items: center; gap: 8px; padding: 0 14px; font-family: var(--mono); font-weight: 700; color: var(--mute); border-right: 2px solid var(--edge); }
.num { position: relative; flex: 1; min-width: 0; }
.num input, .num .show { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; letter-spacing: .06em; padding: 0 16px; }
.num input { border: 0; background: transparent; min-height: 52px; height: 100%; color: transparent; caret-color: var(--gold); position: relative; z-index: 1; }
.num input::placeholder { color: #5E5E5E; font-weight: 400; }
.num .show { position: absolute; inset: 0; display: flex; align-items: center; white-space: pre; pointer-events: none; color: var(--white); overflow: hidden; }
.show i { font-style: normal; display: inline-block; }
.show i.new { animation: pop .26s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.6); } 60% { opacity: 1; } }
input { width: 100%; min-height: 52px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--white); background: var(--coal); border: 2px solid var(--edge); border-radius: 12px; transition: border-color .15s; }
input::placeholder { color: #6E6E6E; }
input:focus { outline: none; }
.field > input:focus { border-color: var(--gold); }
.err { color: var(--no); font-size: .88rem; }

.otp { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.otp span { aspect-ratio: 1 / 1.15; max-height: 64px; display: grid; place-items: center; border: 2px solid var(--edge); border-radius: 12px; background: var(--coal); font-family: var(--mono); font-weight: 700; font-size: 1.5rem; transition: border-color .15s; }
.otp span.on { border-color: var(--gold); }
.otp span.on:empty::after { content: ""; width: 2px; height: 1.2em; background: var(--gold); animation: blink 1s steps(1) infinite; }
.otp.bad span { border-color: var(--no); }
.otp.bad { animation: shake .35s cubic-bezier(.3,0,.3,1); }
.otp span b { display: block; font-weight: 700; }
.otp span b.pop { animation: pop .28s cubic-bezier(.2,.9,.3,1.3) both; }
.otp span.fill { border-color: var(--edge-2); }
.otp.checking span { animation: pulse 1s ease-in-out infinite; }
.otp.checking span:nth-of-type(2) { animation-delay: .08s; } .otp.checking span:nth-of-type(3) { animation-delay: .16s; }
.otp.checking span:nth-of-type(4) { animation-delay: .24s; } .otp.checking span:nth-of-type(5) { animation-delay: .32s; }
.otp.checking span:nth-of-type(6) { animation-delay: .4s; }
.otp.ok span { border-color: var(--ok); color: var(--ok); background: rgba(91,211,141,.08); animation: okpop .3s cubic-bezier(.2,.9,.3,1.3) both; }
.otp.ok span:nth-of-type(2) { animation-delay: .04s; } .otp.ok span:nth-of-type(3) { animation-delay: .08s; }
.otp.ok span:nth-of-type(4) { animation-delay: .12s; } .otp.ok span:nth-of-type(5) { animation-delay: .16s; }
.otp.ok span:nth-of-type(6) { animation-delay: .2s; }
@keyframes pulse { 0%, 100% { border-color: var(--edge-2); transform: none; } 40% { border-color: var(--gold); transform: translateY(-4px); } }
@keyframes okpop { 50% { transform: scale(1.08); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.state { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 24px; color: var(--mute); font-size: .92rem; }
.state .spin { width: 14px; height: 14px; border-color: rgba(244,198,68,.25); border-top-color: var(--gold); }
.state.ok { color: var(--ok); font-weight: 700; }
.otp input { position: absolute; inset: 0; opacity: 0; font-size: 16px; caret-color: transparent; color: transparent; border: 0; cursor: text; }
@keyframes blink { 50% { opacity: 0; } }
.sentto { text-align: center; color: var(--mute); }
.sentto b { color: var(--white); font-weight: 700; white-space: nowrap; }
.link { font: inherit; font-weight: 700; color: var(--gold); background: none; border: 0; padding: 4px; cursor: pointer; text-decoration: none; border-radius: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link[disabled] { color: var(--mute); cursor: default; text-decoration: none; font-weight: 500; }
.resend { text-align: center; }
.hint { text-align: center; color: var(--mute); font-size: .85rem; font-family: var(--mono); }

.go { min-height: 54px; border: 2px solid #0D0D0D; border-radius: 12px; background: var(--gold); color: #0D0D0D; font: 700 1.05rem var(--body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s, transform .12s; width: 100%; }
.go:hover { background: var(--sun); }
.go:active { transform: scale(.98); }
.go[disabled] { opacity: .7; cursor: default; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(13,13,13,.25); border-top-color: #0D0D0D; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { text-align: center; font-size: .95rem; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--gold); background: rgba(244,198,68,.08); }
.swap { text-align: center; color: var(--mute); }
.agree { text-align: center; color: var(--mute); font-size: .88rem; }
.agree a { color: var(--gold); text-underline-offset: 3px; }
.swap a { color: var(--gold); font-weight: 700; text-decoration: none; }
.swap a:hover { text-decoration: underline; text-underline-offset: 3px; }

.fade { animation: in .28s cubic-bezier(.2,0,0,1) both; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

/* Phones and small tablets: one centred column */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .brand { display: none; }
  .pane { place-items: start center; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .m-only { display: block; }
  .m-top { display: flex; justify-content: center; padding-bottom: 4px; }
  .m-bot { width: 128px; margin: 0 auto -4px; }
  .m-note { text-align: center; color: var(--mute); font-size: .85rem; padding-top: 8px; }
  .head h1 { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
