/* Sign-in, password and setup pages */
:root{
  color-scheme:light;
  --bg:#EEF2F7; --surface:#FFFFFF; --ink:#0A2540; --ink-2:#596171; --line:#D5DBE1; --primary:#635BFF; --primary-ink:#FFFFFF;
  --accent:#4D4ECF; --accent-soft:rgba(99,91,255,.12); --crit:#B3093C; --crit-soft:#FFE7F2; --good:#05690D; --good-soft:#D7F7C2;
  --band:#F1F0FF; --logo-tile:#635BFF; --logo-icon:#FFFFFF; --logo-word:#0A2540;
  --card-shadow:0 0 0 1px rgba(10,37,64,.06),0 2px 4px rgba(10,37,64,.05),0 14px 28px -14px rgba(10,37,64,.16);
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0A0E14; --surface:#11161E; --ink:#F3F5F8; --ink-2:#A6AFBC; --line:rgba(255,255,255,.1); --primary:#857EFF; --primary-ink:#0A2540;
  --accent:#9D97FF; --accent-soft:rgba(122,115,255,.16); --crit:#FF8095; --crit-soft:#3B1820; --good:#86D9A9; --good-soft:#173326;
  --band:#0D1219; --logo-tile:#857EFF; --logo-icon:#0A2540; --logo-word:#F3F5F8; --card-shadow:inset 0 0 0 1px rgba(255,255,255,.07); color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0A0E14; --surface:#11161E; --ink:#F3F5F8; --ink-2:#A6AFBC; --line:rgba(255,255,255,.1); --primary:#857EFF; --primary-ink:#0A2540;
  --accent:#9D97FF; --accent-soft:rgba(122,115,255,.16); --crit:#FF8095; --crit-soft:#3B1820; --good:#86D9A9; --good-soft:#173326;
  --band:#0D1219; --logo-tile:#857EFF; --logo-icon:#0A2540; --logo-word:#F3F5F8; --card-shadow:inset 0 0 0 1px rgba(255,255,255,.07); color-scheme:dark;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;min-height:100%;background:var(--bg)}
body{color:var(--ink);font-family:"Inter","Segoe UI",system-ui,sans-serif;font-size:15px;line-height:1.5;display:flex;flex-direction:column;align-items:center;padding:44px 16px 40px;-webkit-font-smoothing:antialiased;background:linear-gradient(var(--band) 0 230px, var(--bg) 230px)}
.lg-tile{fill:var(--logo-tile)} .lg-icon{fill:var(--logo-icon)} .lg-word{fill:var(--logo-word)}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:36px;color:var(--logo-word);max-width:100%}
.brand-mark{width:36px;height:36px;border-radius:9px;background:var(--logo-tile);color:var(--logo-icon);display:grid;place-items:center;font-family:"Inter","Segoe UI",system-ui,sans-serif;font-weight:600;font-size:14px;letter-spacing:.02em;flex:none}
.brand-mark:empty{visibility:hidden}
.brand-name{font-family:"Inter","Segoe UI",system-ui,sans-serif;font-weight:600;font-size:20px;line-height:1.2;overflow-wrap:anywhere}
.card{width:min(420px,100%);background:var(--surface);border-radius:14px;padding:30px 28px;box-shadow:var(--card-shadow)}
h1{font-family:"Inter","Segoe UI",system-ui,sans-serif;font-weight:600;font-size:22px;margin:0 0 6px}
p{margin:0 0 18px;color:var(--ink-2)}
form{display:flex;flex-direction:column;gap:14px}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:var(--ink-2)}
input{font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:10px 12px;min-height:44px}
input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
button{font:inherit;font-weight:600;border:0;border-radius:8px;padding:11px 16px;min-height:44px;background:var(--primary);color:var(--primary-ink);cursor:pointer}
button:hover{filter:brightness(1.1)}
button[disabled]{opacity:.6;cursor:wait}
.link{background:none;color:var(--accent);padding:0;min-height:0;font-weight:600;text-decoration:underline;text-underline-offset:3px;align-self:flex-start}
.msg{padding:10px 12px;border-radius:8px;font-size:14px}
.msg.err{background:var(--crit-soft);color:var(--crit)}
.msg.ok{background:var(--good-soft);color:var(--good)}
.foot{margin-top:24px;font-size:13px;color:var(--ink-2);text-align:center}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
select{font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:10px 12px;min-height:44px;width:100%}
select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
@media (max-width:420px){.two{grid-template-columns:minmax(0,1fr)}}
.brand-logo{display:block;height:40px;width:auto;max-width:260px;object-fit:contain}
.brand.has-logo .brand-mark,.brand.has-logo .brand-name{display:none}

/* Sign in with a passkey: a second, quieter button under "Sign in" */
button.alt{background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line);display:flex;align-items:center;justify-content:center;gap:8px}
button.alt:hover{box-shadow:inset 0 0 0 1px var(--ink-2)}
button.alt svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pk-or{display:flex;align-items:center;gap:10px;color:var(--ink-2);font-size:13px}
.pk-or::before,.pk-or::after{content:"";flex:1;height:1px;background:var(--line)}

/* Light and dark logos: the dark one only in the dark look (chosen, or the device's when on Auto). */
.brand-logo.lg-dark{display:none}
:root[data-theme="dark"] .brand-logo.lg-dark{display:block}:root[data-theme="dark"] .brand-logo.lg-light{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .brand-logo.lg-dark{display:block}:root:not([data-theme="light"]) .brand-logo.lg-light{display:none}}
/* Once the page knows the colour behind the logo (auth.js logoTone), that decides: a dark background shows
   the light-coloured logo, a light one the main logo, whatever the light or dark look. */
.auth-wrap .brand.on-dark .brand-logo.lg-dark,.auth-wrap .brand.on-light .brand-logo.lg-light{display:block}
.auth-wrap .brand.on-dark .brand-logo.lg-light,.auth-wrap .brand.on-light .brand-logo.lg-dark{display:none}

/* "Remember this device" on the code step */
.remember{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;font-weight:500}
.remember input{width:18px;height:18px;margin:0;flex:none;accent-color:var(--brand,#635BFF)}
textarea{font:inherit;color:var(--ink);border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:10px 12px;resize:vertical}
textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.opt{font-weight:400}
.hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.link.inline{display:inline;font-size:inherit}

/* The whole page in the firm's own header colour, with land contour lines drawn faintly across it,
   and the sign-in card in the middle. Same on every sign-in page (sign in, password, welcome, setup). */
body.split{display:block;padding:0;background:var(--hdr-bg,var(--band))}
.auth-wrap{position:relative;overflow:hidden;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 16px 24px;background:var(--hdr-bg,var(--band));color:var(--hdr-ink,var(--ink))}
.sipat{position:absolute;inset:0;pointer-events:none}
.sipat svg{position:absolute;inset:0;width:100%;height:100%}
/* The firm's choice of background: its header colour (above), its brand colour, or a colour of its own. */
.auth-wrap[data-bg="brand"],body.split:has(.auth-wrap[data-bg="brand"]){background:var(--brand,var(--primary));color:var(--brand-ink,var(--primary-ink))}
.auth-wrap[data-bg="custom"],body.split:has(.auth-wrap[data-bg="custom"]){background:var(--si-bg);color:var(--si-ink)}
.auth-wrap[data-bg="brand"]>.foot,.auth-wrap[data-bg="custom"]>.foot{color:inherit;opacity:.82}
.auth-head,.auth-wrap>.card,.auth-wrap>.foot{position:relative;z-index:1}
.auth-head{display:flex;flex-direction:column;align-items:center;text-align:center}
.auth-head .brand{margin:0;color:inherit}
.auth-head .brand-name{color:inherit}
.auth-line{margin:18px 0 0;color:inherit;font-weight:650;font-size:clamp(22px,2.4vw,30px);line-height:1.2;letter-spacing:-.01em;text-wrap:balance}
.auth-wrap>.card{background:var(--surface);color:var(--ink);margin:28px 0 20px;width:min(420px,100%);border-radius:16px;padding:32px 30px;box-shadow:0 30px 70px -30px rgba(0,0,0,.45),0 0 0 1px rgba(0,0,0,.04)}
.auth-wrap>.foot{margin:0;text-align:center;color:var(--hdr-mute,var(--ink-2))}
.auth-wrap>.foot .link{color:inherit}
@media (prefers-reduced-motion:no-preference){.sipat svg{animation:ct-in 1.2s ease-out both}}
@keyframes ct-in{from{opacity:0}}
@media (max-width:520px){
  .auth-wrap{justify-content:flex-start;padding:28px 12px 20px}
  .auth-line{font-size:20px;margin-top:14px}
  .auth-wrap>.card{padding:24px 20px;margin-top:20px}
}
/* The initials tile stands out on any background: in the page's text colour, with the background colour inside. */
.auth-wrap[data-bg="brand"] .brand-mark{background:var(--brand-ink,#fff);color:var(--brand,var(--primary))}
.auth-wrap[data-bg="custom"] .brand-mark{background:var(--si-ink);color:var(--si-bg)}
/* The sign-in box: roomy and rounded, with softly shaded fields that turn white with a coloured ring when you type in them. */
.auth-wrap>.card{border-radius:22px;padding:38px 36px 32px;width:min(430px,100%);box-shadow:0 1px 2px rgba(0,0,0,.06),0 24px 60px -20px rgba(0,0,0,.4)}
.auth-wrap>.card h1{font-size:26px;font-weight:700;letter-spacing:-.02em}
.auth-wrap>.card form{gap:18px}
.auth-wrap>.card label{font-weight:500}
.auth-wrap>.card :is(input:not([type=checkbox]),textarea,select){border:1px solid color-mix(in srgb,var(--ink) 9%,transparent);background-color:color-mix(in srgb,var(--ink) 5%,var(--surface));border-radius:12px;min-height:50px;padding:12px 14px}
.auth-wrap>.card textarea{min-height:96px}
.auth-wrap>.card :is(input:not([type=checkbox]),textarea,select):focus{background-color:var(--surface);border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.auth-wrap>.card button:not(.link){border-radius:12px;min-height:50px;font-size:15px}
@media (max-width:520px){.auth-wrap>.card{padding:28px 22px 24px;border-radius:18px}.auth-wrap>.card h1{font-size:23px}}
