/* Sign-in page: split screen, light blue, matches the approved design */
:root {
  --lg-blue: #1b78f2;
  --lg-blue-dark: #1260cc;
  --lg-navy: #0f2447;
  --lg-ink: #1f2937;
  --lg-muted: #667085;
  --lg-line: #d9e2ef;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body.lg-body { margin: 0; font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.5; color: var(--lg-ink); background: #eaf1fb; }
.lg { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: linear-gradient(135deg, #f3f7fd 0%, #e4edfb 100%); }

/* left panel */
.lg-side { display: none; padding: 3rem 3rem 3rem 4rem; background: linear-gradient(160deg, #eef4fd 0%, #dbe8fb 100%); position: relative; overflow: hidden; }
.lg-side::after { content: ""; position: absolute; left: -20%; right: -20%; bottom: -35%; height: 55%; background: radial-gradient(closest-side, rgba(27,120,242,.12), transparent); pointer-events: none; }
.lg-side-in { position: relative; z-index: 1; max-width: 29rem; margin: auto 0 auto auto; width: 100%; }
.lg-logo { margin-bottom: 1.25rem; }
.lg-logo img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 6px 20px rgba(15,36,71,.18); }
.lg-logo-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--lg-navy); color: #fff; font-weight: 700; font-size: 26px; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(15,36,71,.18); }
.lg-title { margin: 0 0 .35rem; font-size: 34px; line-height: 1.15; font-weight: 700; color: var(--lg-navy); letter-spacing: -.01em; }
.lg-tag { margin: 0 0 2rem; font-size: 16px; color: #344054; max-width: 24rem; }
.lg-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.lg-feats li { display: flex; gap: .9rem; align-items: center; }
.lg-ico { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--lg-blue); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(27,120,242,.15); }
.lg-feats strong { display: block; font-size: 15px; color: var(--lg-navy); }
.lg-feats small { display: block; font-size: 13px; color: var(--lg-muted); }

/* right: card */
.lg-main { display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem 2rem; }
.lg-card { width: 100%; max-width: 27rem; background: #fff; border: 1px solid #e6edf7; border-radius: 16px; padding: 2.25rem 2rem 1.75rem; box-shadow: 0 18px 50px rgba(15,36,71,.10); }
.lg-card h2 { margin: 0; text-align: center; font-size: 22px; line-height: 1.25; font-weight: 700; color: var(--lg-navy); }
.lg-sub { margin: .25rem 0 1.5rem; text-align: center; color: var(--lg-muted); }
.lg-error { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; background: #fff1f0; border: 1px solid #f6c5c0; color: #b42318; }

.lg-field { margin-bottom: 1rem; }
.lg-field label { display: block; margin-bottom: .35rem; font-weight: 600; color: #344054; }
.lg-input { position: relative; display: flex; align-items: center; }
.lg-input input { width: 100%; height: 48px; padding: 0 2.75rem 0 2.6rem; font: inherit; color: var(--lg-ink); background: #f8fafd; border: 1px solid var(--lg-line); border-radius: 10px; transition: border-color .15s, box-shadow .15s, background .15s; }
.lg-input input::placeholder { color: #98a2b3; }
.lg-input input:focus { outline: none; background: #fff; border-color: var(--lg-blue); box-shadow: 0 0 0 3px rgba(27,120,242,.18); }
.lg-in-ico { position: absolute; left: .85rem; color: #7b8aa3; pointer-events: none; }
.lg-eye { position: absolute; right: .3rem; width: 40px; height: 40px; border: 0; background: transparent; color: #7b8aa3; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lg-eye:hover { color: var(--lg-blue); background: #eef4fd; }
.lg-eye:focus-visible { outline: 3px solid rgba(27,120,242,.35); }
.lg-eye .eye-off { display: none; }
.lg-eye.is-on .eye-on { display: none; }
.lg-eye.is-on .eye-off { display: block; }

.lg-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .25rem 0 1.1rem; font-size: 13px; }
.lg-check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: #475467; }
.lg-check input { width: 16px; height: 16px; accent-color: var(--lg-blue); margin: 0; }
.lg-forgot { color: var(--lg-blue); font-weight: 600; text-decoration: none; }
.lg-forgot:hover { text-decoration: underline; }
.lg-forgot-note { display: none; margin: -.4rem 0 1rem; padding: .6rem .8rem; border-radius: 10px; background: #eef4fd; color: #344054; font-size: 13px; }
.lg-forgot-note:target { display: block; }

.lg-btn { width: 100%; height: 48px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; font-size: 15px; color: #fff; cursor: pointer; background: linear-gradient(180deg, #2f8bff 0%, var(--lg-blue) 100%); box-shadow: 0 6px 16px rgba(27,120,242,.32); transition: transform .1s, box-shadow .15s, filter .15s; }
.lg-btn:hover { filter: brightness(.96); }
.lg-btn:active { transform: scale(.99); }
.lg-btn:focus-visible { outline: 3px solid rgba(27,120,242,.4); outline-offset: 2px; }
.lg-secure { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: 1.4rem 0 0; font-size: 12px; color: var(--lg-muted); }

/* computer: split screen */
@media (min-width: 900px) {
  .lg { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .lg-side { display: flex; }
  .lg-main { padding: 2rem 3rem; }
}
/* phone: tidy compact top */
@media (max-width: 899px) {
  .lg-side { display: block; background: transparent; padding: 1.75rem 1.25rem 0; text-align: center; }
  .lg-side::after { display: none; }
  .lg-side-in { margin: 0 auto; max-width: 24rem; }
  .lg-logo { margin-bottom: .6rem; }
  .lg-logo img, .lg-logo-mark { width: 64px; height: 64px; }
  .lg-logo-mark { font-size: 20px; }
  .lg-title { font-size: 24px; }
  .lg-tag { margin: 0 auto; font-size: 14px; }
  .lg-feats { display: none; }
  .lg-main { padding-top: 1.25rem; }
  .lg-card { padding: 1.75rem 1.25rem 1.5rem; }
}
@media (max-width: 899px) { .lg-input input { font-size: 16px; } }

/* ===== STEP 5b: reset, request access, Google, security question ===== */
.lg-ok { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; background: #e9f7ef; border: 1px solid #a8d9bd; color: #1f6f43; }
.lg-help { margin: .25rem 0 1rem; color: var(--lg-muted); font-size: 13px; text-align: center; }
.lg-switch { margin: 1.1rem 0 0; text-align: center; color: var(--lg-muted); font-size: 13px; }
.lg-switch a { color: var(--lg-blue); font-weight: 600; text-decoration: none; }
.lg-switch a:hover { text-decoration: underline; }
.lg-input.lg-plain input, .lg-input.lg-plain textarea { padding-left: .9rem; padding-right: .9rem; }
.lg-input textarea { width: 100%; padding: .7rem .9rem; font: inherit; color: var(--lg-ink); background: #f8fafd; border: 1px solid var(--lg-line); border-radius: 10px; resize: vertical; }
.lg-input textarea:focus { outline: none; background: #fff; border-color: var(--lg-blue); box-shadow: 0 0 0 3px rgba(27,120,242,.18); }
.lg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lg-google { display: flex; align-items: center; justify-content: center; gap: .6rem; height: 46px; border: 1px solid var(--lg-line); border-radius: 10px; background: #fff; color: #344054; font-weight: 600; text-decoration: none; }
.lg-google:hover { background: #f8fafd; border-color: #b9c6d8; }
.lg-or { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--lg-muted); font-size: 12px; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--lg-line); }
@media (max-width: 899px) { .lg-input textarea { font-size: 16px; } }

/* A client's own logo on their sign-in page */
.lg-logo img.lg-client { border-radius: 18px; object-fit: contain; background: #fff; padding: 6px; }

/* ===== Sign-in page v2: clean, in the app's own blue, with gentle motion ===== */
:root { --lg-blue:#1b78f2; --lg-blue-dark:#1260cc; --lg-navy:#0f2447; --lg-line:#dbe3ef; }
body.lg-body, .lg { background:#fff; }
.lg { background:#fff; }
/* left: light panel with slow-moving blue glows */
.lg-side { background:linear-gradient(160deg,#f7faff 0%,#eaf2fe 100%); border-right:1px solid #e3ebf7; }
.lg-side::before { content:""; position:absolute; inset:0; background-image:linear-gradient(#dbe6f7 1px,transparent 1px),linear-gradient(90deg,#dbe6f7 1px,transparent 1px); background-size:44px 44px; opacity:.45; -webkit-mask-image:radial-gradient(70% 60% at 30% 40%,#000,transparent); mask-image:radial-gradient(70% 60% at 30% 40%,#000,transparent); pointer-events:none; }
.lg-side::after { content:""; position:absolute; width:520px; height:520px; left:-160px; bottom:-200px; border-radius:50%; background:radial-gradient(closest-side,rgba(27,120,242,.20),transparent); filter:blur(8px); animation:lg-drift 14s ease-in-out infinite alternate; pointer-events:none; }
.lg-logo img:not(.lg-client), .lg-logo-mark { box-shadow:0 8px 24px rgba(15,36,71,.16); border:3px solid #fff; }
.lg-logo img.lg-client { box-shadow:0 8px 24px rgba(15,36,71,.14); }
.lg-ico { background:#fff; color:var(--lg-blue); box-shadow:0 2px 10px rgba(27,120,242,.18); }
/* right: soft background, card with blue header */
.lg-main { background:#f4f8fe; }
.lg-card { padding:0 0 1.75rem; overflow:hidden; border:0; border-radius:18px; box-shadow:0 24px 60px rgba(15,36,71,.13); }
.lg-card h2 { background:linear-gradient(135deg,#2f8bff 0%,#1260cc 100%); color:#fff; text-align:left; padding:1.7rem 2rem .25rem; font-size:24px; margin:0; }
.lg-card .lg-sub { background:linear-gradient(135deg,#2f8bff 0%,#1260cc 100%); color:#dcebff; text-align:left; margin:0; padding:0 2rem 1.6rem; }
.lg-card > *:not(h2):not(.lg-sub) { margin-left:2rem; margin-right:2rem; }
.lg-card > form, .lg-card > .lg-google, .lg-card > a:first-of-type { margin-top:0; }
.lg-card > h2 + .lg-sub + * { margin-top:1.4rem; }
.lg-input input { height:50px; background:#eff4fb; border:1.5px solid transparent; border-radius:12px; }
.lg-input input:focus { background:#fff; border-color:var(--lg-blue); box-shadow:0 0 0 4px rgba(27,120,242,.14); }
.lg-btn { height:50px; border-radius:12px; background:linear-gradient(180deg,#2f8bff 0%,#1b78f2 100%); box-shadow:0 8px 20px rgba(27,120,242,.30); }
.lg-btn:hover { transform:translateY(-1px); filter:none; box-shadow:0 12px 26px rgba(27,120,242,.36); }
.lg-btn:active { transform:none; }
/* gentle entrance */
.lg-card { animation:lg-rise .6s cubic-bezier(.2,.7,.2,1) both; }
.lg-logo, .lg-title, .lg-tag { animation:lg-fade .6s ease both; }
.lg-title { animation-delay:.08s; } .lg-tag { animation-delay:.14s; }
.lg-feats li { animation:lg-fade .6s ease both; }
.lg-feats li:nth-child(1){animation-delay:.2s} .lg-feats li:nth-child(2){animation-delay:.28s} .lg-feats li:nth-child(3){animation-delay:.36s} .lg-feats li:nth-child(4){animation-delay:.44s}
@keyframes lg-rise { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }
@keyframes lg-fade { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes lg-drift { from { transform:translate(0,0) scale(1); } to { transform:translate(60px,-40px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .lg *, .lg *::before, .lg *::after, .lg { animation:none !important; transition:none !important; } }
@media (max-width: 899px) { .lg-side { background:transparent; border:0; } .lg-side::before, .lg-side::after { display:none; } .lg-main { background:transparent; } .lg-card { box-shadow:0 14px 40px rgba(15,36,71,.12); } }

/* Locked sign-in: the way out */
.lg-lock{text-align:center}
.lg-lock .lg-btn{display:flex;align-items:center;justify-content:center;text-decoration:none;margin:4px 0 10px;color:#fff}

/* ===== S38-B20: Sign-in v3, dark (same on computer and phone). Look only; sign-in steps are unchanged. ===== */
:root { --lg3-bg:#070b1a; --lg3-ink:#fff; --lg3-mut:#9fb0dc; --lg3-line:rgba(255,255,255,.2); --lg3-acc:#60a5fa; --lg3-glow:#4f46e5; --lg3-g1:#60a5fa; --lg3-g2:#a78bfa; --lg3-g3:#f472b6; --lg3-gl:.5; }
/* colours follow the time on the device (set by login.js); night is the default */
body[data-tod=morning] { --lg3-bg:#2a1608; --lg3-mut:#f5cfa0; --lg3-glow:#f97316; --lg3-g1:#fdba74; --lg3-g2:#fb923c; --lg3-g3:#fde68a; --lg3-gl:.55; }
body[data-tod=afternoon] { --lg3-bg:#06172b; --lg3-mut:#a9d4ee; --lg3-glow:#0ea5e9; --lg3-g1:#7dd3fc; --lg3-g2:#38bdf8; --lg3-g3:#a7f3d0; --lg3-gl:.55; }
body[data-tod=evening] { --lg3-bg:#1a0a24; --lg3-mut:#e0b4d8; --lg3-glow:#db2777; --lg3-g1:#fb7185; --lg3-g2:#c084fc; --lg3-g3:#f472b6; --lg3-gl:.5; }
html:has(body[data-tod=morning]) { background:#2a1608; } html:has(body[data-tod=afternoon]) { background:#06172b; } html:has(body[data-tod=evening]) { background:#1a0a24; }
html { background:#070b1a; overflow-x:hidden; }
body.lg-body { background:var(--lg3-bg); color:var(--lg3-ink); overflow-x:hidden; position:relative; }
body.lg-body::before { content:""; position:fixed; left:-12vw; bottom:-26vh; width:min(62vw,640px); height:min(62vw,640px); border-radius:50%; background:var(--lg3-glow); filter:blur(140px); opacity:var(--lg3-gl); pointer-events:none; z-index:0; transition:background .4s; }
.lg { position:relative; z-index:1; background:transparent; }
.lg-side { background:transparent; border:0; }
.lg-side::before, .lg-side::after { display:none; }
.lg-main { background:transparent; }
/* left side: logo, company name, big greeting */
.lg-logo img, .lg-logo img:not(.lg-client), .lg-logo img.lg-client { width:88px; height:88px; border-radius:22px; object-fit:contain; background:#fff; padding:8px; border:0; box-shadow:0 10px 30px rgba(37,99,235,.45); }
.lg-logo-mark { width:88px; height:88px; border-radius:22px; background:#2563eb; color:#fff; border:0; box-shadow:0 10px 30px rgba(37,99,235,.5); }
.lg-title { color:#fff; font-size:24px; letter-spacing:-.01em; margin:0; }
.lg-greet { margin:clamp(1.5rem,6vh,3.5rem) 0 .9rem; font-size:clamp(3rem,6.2vw,5.2rem); font-weight:700; line-height:1.15; padding-bottom:.08em; letter-spacing:-.03em; background:linear-gradient(90deg,var(--lg3-g1),var(--lg3-g2),var(--lg3-g3)); -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent; }
.lg-greet:empty { display:none; }
.lg-tag { color:var(--lg3-mut); font-size:16px; margin:0; max-width:26rem; }
.lg-feats { display:none; }
/* card */
.lg-card { background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.16); border-radius:22px; padding:2rem 1.75rem 1.5rem; box-shadow:0 30px 80px rgba(0,0,0,.45); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); overflow:visible; animation:lg-rise .6s cubic-bezier(.2,.7,.2,1) both; }
.lg-card h2 { background:none; color:#fff; text-align:left; padding:0; margin:0; font-size:22px; }
.lg-card .lg-sub { background:none; color:var(--lg3-mut); text-align:left; padding:0; margin:.3rem 0 1.4rem; }
.lg-card > *:not(h2):not(.lg-sub) { margin-left:0; margin-right:0; }
.lg-card > h2 + .lg-sub + * { margin-top:0; }
.lg-field label { color:#c7d3f5; }
.lg-input input, .lg-input textarea { background:rgba(255,255,255,.08); color:#fff; border:1.5px solid var(--lg3-line); border-radius:13px; }
.lg-input input::placeholder, .lg-input textarea::placeholder { color:#7f8db3; }
.lg-input input:focus, .lg-input textarea:focus { background:rgba(255,255,255,.13); border-color:var(--lg3-acc); box-shadow:0 0 0 4px rgba(96,165,250,.22); }
.lg-input input:-webkit-autofill, .lg-input input:-webkit-autofill:focus { -webkit-text-fill-color:#fff; caret-color:#fff; box-shadow:0 0 0 60px #1a2140 inset; -webkit-box-shadow:0 0 0 60px #1a2140 inset; transition:background-color 9999s; }
.lg-in-ico, .lg-eye { color:#9fb0dc; }
.lg-eye:hover { color:#fff; background:rgba(255,255,255,.1); }
.lg-check { color:#c7d3f5; }
.lg-check input { accent-color:var(--lg3-acc); }
.lg-forgot, .lg-switch a { color:#8ab4ff; }
.lg-switch, .lg-help, .lg-secure { color:var(--lg3-mut); }
.lg-btn { background:var(--lg3-acc); color:#08142b; border-radius:13px; box-shadow:0 8px 22px rgba(96,165,250,.32); }
.lg-btn:hover { background:#7ab6fd; transform:translateY(-1px); box-shadow:0 12px 26px rgba(96,165,250,.4); filter:none; }
.lg-lock .lg-btn { color:#08142b; }
.lg-google { background:transparent; color:#fff; border:1.5px solid rgba(255,255,255,.28); border-radius:13px; }
.lg-google:hover { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.4); }
.lg-or { color:#7e8aa8; }
.lg-or::before, .lg-or::after { background:rgba(255,255,255,.16); }
.lg-error { background:rgba(255,80,60,.16); border-color:rgba(255,120,100,.4); color:#ffb4aa; }
.lg-ok { background:rgba(34,197,94,.15); border-color:rgba(74,222,128,.4); color:#86efac; }
.lg-forgot-note { background:rgba(255,255,255,.08); color:#c7d3f5; }
.lg-card a { text-underline-offset:2px; }
.lg-btn:focus-visible, .lg-google:focus-visible, .lg-forgot:focus-visible, .lg-switch a:focus-visible, .lg-eye:focus-visible { outline:3px solid rgba(138,180,255,.6); outline-offset:2px; }
/* computer */
@media (min-width: 900px) {
  .lg-side { padding:3rem 3rem 3rem 4rem; }
  .lg-side-in { max-width:34rem; margin:0 auto 0 0; min-height:calc(100vh - 6rem); display:flex; flex-direction:column; }
  .lg-greet { margin-top:auto; }
  .lg-tag { margin-bottom:0; margin-top:0; }
  .lg-side-in .lg-tag { margin-bottom:auto; }
  .lg-card { max-width:27rem; }
}
/* phone: same dark look, logo on top, greeting under it */
@media (max-width: 899px) {
  .lg-side { padding:1.5rem 1.25rem 0; text-align:left; }
  .lg-side-in { max-width:27rem; margin:0 auto; }
  .lg-logo { display:flex; align-items:center; gap:.9rem; margin:0; }
  .lg-logo img, .lg-logo img:not(.lg-client), .lg-logo img.lg-client, .lg-logo-mark { width:68px; height:68px; border-radius:18px; }
  .lg-greet { font-size:clamp(3rem,15vw,3.6rem); margin:1.2rem 0 .6rem; }
  .lg-tag { font-size:14px; max-width:none; }
  .lg-title { font-size:20px; margin-top:.7rem; }
  .lg-main { padding:1.25rem 1.25rem 2rem; }
  .lg-card { max-width:27rem; padding:1.5rem 1.25rem 1.25rem; }
}
@media (max-width: 380px) { .lg-card { padding:1.25rem 1rem; } }

/* ---- S38-B20: phone steps (email, then password). Computer view is untouched. ---- */
.lg-chip, .lg-next, .lg-or-m, .lg-eerr[hidden] { display:none; }
.lg-eerr { margin:.45rem 0 0; font-size:13px; color:#ffb4aa; }
@media (max-width: 899px) {
  .lg { align-content:start; grid-auto-rows:max-content; }
  .lg-main { align-items:flex-start; }
  .lg-or-d { display:none; } .lg-or-m { display:inline; }
  .lg-card { display:flex; flex-direction:column; }
  .lg-card > h2, .lg-card > .lg-sub { order:0; }
  .lg-login .lg-card > h2, .lg-login .lg-card > .lg-sub { display:none; }
  .lg-login .lg-card > form { order:1; }
  .lg-login .lg-card > .lg-or { order:2; }
  .lg-login .lg-card > .lg-google { order:3; }
  .lg-login .lg-card > .lg-switch, .lg-login .lg-card > .lg-secure { order:4; }
  .lg-login .lg-card > .lg-error, .lg-login .lg-card > .lg-ok, .lg-login .lg-card > .lg-help { order:0; }
  .lg-or { margin:1rem 0; }
  form.lg-steps[data-s="1"] [data-step="2"] { display:none !important; }
  form.lg-steps[data-s="2"] [data-step="1"] { display:none !important; }
  form.lg-steps[data-s="1"] .lg-next { display:block; }
  form.lg-steps[data-s="2"] .lg-chip { display:flex; }
  .lg-card[data-s="2"] > .lg-google, .lg-card[data-s="2"] > .lg-or { display:none; }
  .lg-greet.is-mid { font-size:1.9rem; margin:1.4rem 0 .35rem; background:none; -webkit-text-fill-color:#fff; color:#fff; letter-spacing:-.02em; line-height:1.2; }
  .lg-chip { align-items:center; gap:.7rem; background:rgba(255,255,255,.08); border-radius:14px; padding:.55rem .75rem; margin-bottom:1rem; min-width:0; }
  .lg-chip-av { flex:0 0 32px; width:32px; height:32px; border-radius:50%; background:#2563eb; color:#fff; font-weight:700; display:grid; place-items:center; font-size:14px; }
  .lg-chip-m { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#fff; }
  .lg-chip-chg { border:0; background:none; color:#8ab4ff; font:inherit; font-weight:600; cursor:pointer; padding:.3rem; }
  .lg-chip-chg:focus-visible { outline:3px solid rgba(138,180,255,.6); border-radius:6px; }
}
.lg-title + .lg-tag { margin-top:.5rem; }
