/* One sign-in look for /login/client, /login/operator and /portal/login.
   Palette and placement follow the homepage draft (output/home-draft/home.css): graphite page,
   a calm grainy glow behind the card that fades out before the footer, a charcoal card with one
   soft coral corner, silver pill buttons. Always dark, like the app. */
@font-face { font-family: Inter; src: url('/shared/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
/* Type (founder, 2026-10-01): Inter, as on the landing pages; headings heavy and tight like the
   landing-page headlines. */

:root {
  color-scheme: dark;
  --bg: #0b0c0d;
  --card: #141518;
  --field: #1b1c20;
  --line: rgb(255 255 255 / .08);
  --line-2: rgb(255 255 255 / .14);
  --ink: #f1f1ee;
  --ink-2: #a3a5aa;
  --ink-3: #8d8f95;
  --button: #efeee9;
  --button-ink: #0c0d0e;
  --danger: #f0a8a0;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --coral: rgb(150 80 64);
  --violet: rgb(86 68 120);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { background: var(--bg); min-width: 320px; }
body.signin {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow-x: hidden;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 3px; }

/* Atmosphere: colour lives behind the card, never inside it. */
/* Turned up with the homepage (founder, 2026-10-01): stronger, drifting slowly, visible grain,
   a soft vignette at the edges. */
.si-atmos { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; box-shadow: inset 0 0 220px 40px rgb(0 0 0 / .55); }
.si-atmos::before {
  content: ""; position: absolute; left: 50%; top: -16%; width: min(1320px, 160vw); height: 92vh; transform: translateX(-50%); filter: blur(38px);
  background:
    radial-gradient(ellipse 40% 52% at 34% 46%, rgb(150 80 64 / .62), transparent 70%),
    radial-gradient(ellipse 38% 50% at 68% 38%, rgb(86 68 120 / .66), transparent 70%),
    radial-gradient(ellipse 62% 58% at 50% 64%, rgb(47 58 74 / .66), transparent 74%);
  animation: si-drift 26s ease-in-out infinite alternate;
}
.si-atmos::after {
  content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .12; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(#000 0%, #000 60%, transparent 95%); mask-image: linear-gradient(#000 0%, #000 60%, transparent 95%);
}
.si-atmos i { position: absolute; left: 50%; bottom: -20%; width: min(1000px, 130vw); height: 44vh; transform: translateX(-50%); filter: blur(40px); background: radial-gradient(ellipse 50% 50% at 50% 50%, rgb(86 68 120 / .3), rgb(47 58 74 / .2) 45%, transparent 72%); }
@keyframes si-drift {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-48%) translateY(1.5%) scale(1.04); }
  100% { transform: translateX(-52%) translateY(-1%) scale(1.02); }
}

.si-header, .si-main, .si-footer { position: relative; z-index: 1; }
.si-header { padding: 28px max(24px, 4vw); }
.si-brand { display: inline-flex; }
.si-brand img { height: 28px; width: auto; }

.si-main { flex: 1; display: grid; place-items: center; padding: 8px 16px 72px; }
.si-card {
  position: relative; isolation: isolate;
  width: min(100%, 432px); padding: 38px 36px 32px; border-radius: 28px; border: 1px solid transparent;
  background:
    radial-gradient(circle at 100% 0%, rgb(150 80 64 / .26), transparent 46%) padding-box,
    radial-gradient(circle at 0% 100%, rgb(86 68 120 / .18), transparent 48%) padding-box,
    linear-gradient(rgb(20 21 24 / .8), rgb(20 21 24 / .8)) padding-box,
    linear-gradient(180deg, rgb(255 255 255 / .2), rgb(255 255 255 / .06) 30%, rgb(255 255 255 / .03) 70%, rgb(255 255 255 / .08)) border-box;
  -webkit-backdrop-filter: blur(26px) saturate(130%); backdrop-filter: blur(26px) saturate(130%);
  box-shadow: 0 50px 110px -40px rgb(0 0 0 / .95), 0 0 0 1px rgb(0 0 0 / .4);
  animation: si-in 700ms var(--ease) both;
}
.si-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-image: var(--grain); opacity: .05; mix-blend-mode: screen;
}
@keyframes si-in { from { opacity: 0; transform: translateY(10px) scale(.99); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .si-card, .si-atmos::before { animation: none; } }

/* Client or Team (founder, 2026-10-01: "change the way the sign in splits are"). One track with
   a lit indicator that slides to the chosen side. Client is the warm side (coral dot, coral card
   corner), Team the cool side (violet), the same as the homepage pop-up. signin.js only sets
   aria-current; everything here follows from it. */
.si-switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 32px; border-radius: 16px;
  background: rgb(0 0 0 / .3); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 3px rgb(0 0 0 / .45);
}
.si-switch::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 12px) / 2); border-radius: 12px; opacity: 0;
  background: radial-gradient(90% 140% at 0% 0%, rgb(var(--side, 150 80 64) / .38), transparent 70%), linear-gradient(180deg, rgb(255 255 255 / .13), rgb(255 255 255 / .06));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), inset 0 1px 0 rgb(255 255 255 / .14), 0 6px 16px -6px rgb(0 0 0 / .7);
  transition: transform 340ms var(--ease), opacity 200ms var(--ease);
}
.si-switch:has([aria-current])::before { opacity: 1; }
.si-switch:has([data-tab="operator"][aria-current])::before { --side: 86 68 120; transform: translateX(calc(100% + 4px)); }
.si-switch a {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; text-decoration: none;
  transition: color 200ms var(--ease);
}
.si-switch a:hover { color: var(--ink); }
.si-switch a[aria-current="page"] { color: var(--ink); }
.si-dot { width: 7px; height: 7px; border-radius: 50%; background: rgb(150 80 64 / .55); box-shadow: 0 0 0 3px rgb(150 80 64 / .12); transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease); }
[data-tab="operator"] .si-dot { background: rgb(120 100 170 / .55); box-shadow: 0 0 0 3px rgb(86 68 120 / .14); }
[data-tab="client"][aria-current] .si-dot { background: #d89580; box-shadow: 0 0 0 3px rgb(150 80 64 / .28), 0 0 12px rgb(216 149 128 / .6); }
[data-tab="operator"][aria-current] .si-dot { background: #a898d8; box-shadow: 0 0 0 3px rgb(86 68 120 / .32), 0 0 12px rgb(168 152 216 / .6); }
@media (prefers-reduced-motion: reduce) { .si-switch::before { transition: none; } }

/* The card's lit corner follows the side: coral for Client, violet for Team. */
.si-card:has([data-tab="operator"][aria-current]) {
  background:
    radial-gradient(circle at 100% 0%, rgb(86 68 120 / .3), transparent 46%) padding-box,
    radial-gradient(circle at 0% 100%, rgb(47 58 74 / .24), transparent 48%) padding-box,
    linear-gradient(rgb(20 21 24 / .8), rgb(20 21 24 / .8)) padding-box,
    linear-gradient(180deg, rgb(255 255 255 / .2), rgb(255 255 255 / .06) 30%, rgb(255 255 255 / .03) 70%, rgb(255 255 255 / .08)) border-box;
}

.si-card h1, .auth-heading h1 { margin: 0; font-size: 32px; line-height: 1.08; font-weight: 800; letter-spacing: -.045em; color: var(--ink); }
.si-card .lead, .auth-heading p { margin: 10px 0 28px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; letter-spacing: -.003em; }
.auth-heading { margin: 0; }
.auth-heading a, .si-card .lead a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.auth-heading a:hover { text-decoration-color: var(--ink); }

/* Buttons: the silver pill is the one action, ghost is the second */
.si-card .button, .primary-button, .google-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 22px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; font: 550 15px/1 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.005em;
  background: linear-gradient(180deg, #fbfaf6, #e6e4de); color: var(--button-ink); box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 0 0 1px rgb(255 255 255 / .1), 0 12px 28px -14px rgb(0 0 0 / .95);
  transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms var(--ease);
}
.si-card .button:hover, .primary-button:hover, .google-button:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 0 0 1px rgb(255 255 255 / .14), 0 16px 34px -14px rgb(0 0 0 / .95), 0 0 40px -8px rgb(150 80 64 / .4); }
.si-card .button[aria-disabled="true"], .primary-button:disabled, .outline-button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.google-button { position: relative; }
.google-button svg { position: absolute; left: 18px; width: 18px; height: 18px; }
.outline-button, .si-card .alt .button {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: rgb(255 255 255 / .05); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); border: 0; font: 500 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  transition: background-color 180ms var(--ease);
}
.outline-button:hover, .si-card .alt .button:hover { background: rgb(255 255 255 / .09); }
.button-link { margin-top: 16px; }
.si-card .alt { display: block; margin-top: 14px; text-align: center; font-size: 13.5px; }
.si-card .alt a { color: var(--ink-2); text-underline-offset: 3px; }
.si-card .alt a:hover { color: var(--ink); }

/* Fields */
.auth-form { display: grid; gap: 12px; }
input {
  width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: 14px; background: rgb(12 13 15 / .6); color: var(--ink);
  font: 400 15px/1 Inter, ui-sans-serif, system-ui, sans-serif; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 160ms var(--ease);
}
input::placeholder { color: var(--ink-3); }
input:focus { outline: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .42), 0 0 0 4px rgb(150 80 64 / .2); }
.identity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 4px; padding: 11px 16px; border-radius: 14px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.identity-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-button, .more-options { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.link-button:hover, .more-options:hover { color: var(--ink); }
.more-options { display: block; margin: 14px auto 0; padding: 4px 8px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--ink-3); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.recovery-note { margin: 14px 4px 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.55; text-align: center; }
#operatorHint strong { color: var(--ink); font-weight: 600; }
.invitation-card { margin: 4px 0 6px; padding: 20px; border-radius: 16px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.invitation-card img { width: 28px; height: 28px; margin-bottom: 16px; filter: brightness(0) invert(1); opacity: .85; }
.invitation-card strong { font-size: 14px; font-weight: 600; }
.invitation-card p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }

/* Messages */
.notice, .message { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: rgb(255 255 255 / .05); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.notice.error, .message.error { background: rgb(214 113 128 / .1); box-shadow: inset 0 0 0 1px rgb(214 113 128 / .32); color: var(--danger); }
.message { margin: 16px 0 0; }

.si-footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px max(24px, 4vw) 28px; color: var(--ink-3); font-size: 13px; }
.si-footer a { text-decoration: none; margin-left: 20px; }
.si-footer a:first-child { margin-left: 0; }
.si-footer a:hover { color: var(--ink); }

@media (max-width: 480px) {
  .si-header { padding: 22px 20px; }
  .si-main { padding: 0 14px 56px; }
  .si-card { padding: 30px 22px 24px; border-radius: 24px; }
  .si-card h1, .auth-heading h1 { font-size: 28px; }
  .si-atmos { box-shadow: inset 0 0 120px 20px rgb(0 0 0 / .5); }
  .si-footer { padding: 18px 20px 24px; }
}

/* Hidden spam trap for the request form */
.si-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.si-card .switch { margin: 22px 0 0; text-align: center; font-size: 13.5px; color: var(--ink-3); }
.si-card .switch a { color: var(--ink); text-underline-offset: 3px; }

/* Labelled fields, show-password, field messages (single-step sign-in) */
.field { display: grid; gap: 7px; }
.field label { font-size: 11.5px; font-weight: 550; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-head .link-button { font-size: 12.5px; }
.optional { margin-left: 6px; color: var(--ink-3); font-weight: 400; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 500 12.5px/1 Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: rgb(255 255 255 / .06); }
.field-hint { margin: 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.field-error { margin: 0; padding: 11px 14px; border-radius: 12px; background: rgb(214 113 128 / .1); box-shadow: inset 0 0 0 1px rgb(214 113 128 / .32); color: var(--danger); font-size: 13px; line-height: 1.5; }
input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px rgb(214 113 128 / .7); }
.si-card .primary-button, .si-card .outline-button { margin-top: 2px; }
a.primary-button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.si-card .switch { margin: 22px 0 0; text-align: center; font-size: 13.5px; color: var(--ink-3); }
.si-card .switch .link-button { color: var(--ink); font-size: inherit; }
.si-card h1:focus { outline: none; }
.link-button:focus-visible, .pw-toggle:focus-visible, .si-switch a:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; padding: 0; accent-color: #efeee9; box-shadow: none; flex: none; }
.si-card .switch a { color: var(--ink-2); text-underline-offset: 3px; }
.si-card .switch a:hover { color: var(--ink); }

/* Continue with Google (founder, 2026-10-01). Google's dark button: near-black fill, grey edge,
   the four-colour G, so it reads as Google's and never competes with the silver Sign in pill.
   Hidden until /api/google/config says Google is set up. */
.google-block { display: grid; gap: 18px; margin: 0 0 20px; }
.si-card .google-button {
  min-height: 48px; background: #131314; color: #e3e3e3; font-weight: 500; letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgb(142 145 143 / .55), 0 10px 24px -14px rgb(0 0 0 / .9);
}
.si-card .google-button:hover { background: #1c1d1f; color: #fff; box-shadow: inset 0 0 0 1px rgb(142 145 143 / .8), 0 12px 28px -14px rgb(0 0 0 / .95); }
.si-card .google-button svg { left: 20px; width: 19px; height: 19px; }
.google-block .divider { margin: 0; }
