/* Sign-in and "choose a password" pages.
   Left: this month as a timesheet (the thing the tool works on), in the app's own day colours. Right: the form.
   Type: Bahnschrift (the DIN-style face built into Windows) for headings and numbers; the system face for text.
   No web fonts are loaded, so nothing is fetched from outside. Colours come from tools.css, so dark mode works. */
:root{
  --f-time:Bahnschrift,'DIN Alternate','DIN 2014','Roboto Condensed','Arial Narrow',system-ui,sans-serif;
  --sheet-bg:#173d61; --sheet-ink:#ffffff; --sheet-muted:#b9cde2; --sheet-line:rgba(255,255,255,.16);
  --cell-wk:#ffffff; --cell-wk-ink:#173d61;
  --cell-lv:#fdebd0; --cell-lv-ink:#7a4800;
  --cell-ph:#dbe8f7; --cell-ph-ink:#1d4f8c;
  --cell-we:rgba(255,255,255,.07);
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--sheet-bg:#0f263c;--cell-wk:#e8eef5;--cell-wk-ink:#0f263c}}
:root[data-theme="dark"]{--sheet-bg:#0f263c;--cell-wk:#e8eef5;--cell-wk-ink:#0f263c}

body:has(.signin){background:var(--bg);padding:0}
body:has(.signin) #app-main{margin:0;padding:0}
body:has(.signin) .foot{margin-top:0;padding:12px 16px}

.signin{display:grid;grid-template-columns:minmax(380px,46%) 1fr;min-height:calc(100vh - 44px)}

/* ── the timesheet side ── */
.signin-sheet{background:var(--sheet-bg);color:var(--sheet-ink);padding:40px clamp(28px,4vw,56px);display:flex;flex-direction:column;gap:40px}
.sheet-brand{display:flex;align-items:center;gap:14px}
.sheet-logo{height:48px;width:48px;object-fit:contain;background:#fff;border-radius:10px;padding:3px}
.sheet-mark{width:48px;height:48px;border-radius:10px;display:grid;place-items:center;background:#fff;color:var(--sheet-bg);font:600 19px/1 var(--f-time)}
.sheet-org{font-size:13px;line-height:1.35;color:var(--sheet-muted)}
.sheet-body{flex:1;display:flex;flex-direction:column;justify-content:center;max-width:520px}
.sheet-title{margin:0;font:600 clamp(36px,4.2vw,52px)/1 var(--f-time);font-stretch:87.5%;letter-spacing:-.01em}
.sheet-line{margin:12px 0 32px;font-size:16px;line-height:1.45;color:var(--sheet-muted);max-width:34ch}

.month{margin:0}
.month-head{display:flex;justify-content:space-between;align-items:baseline;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid var(--sheet-line);font:600 17px/1.2 var(--f-time)}
.month-total{font-weight:400;font-size:14px;color:var(--sheet-muted);font-variant-numeric:tabular-nums}
.month-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.month-dow{font:400 12px/1 var(--f-time);color:var(--sheet-muted);padding:0 0 4px 4px}
.cell{position:relative;aspect-ratio:1.25;border-radius:6px;background:transparent;font-family:var(--f-time);font-variant-numeric:tabular-nums}
.cell i{position:absolute;top:5px;left:6px;font-style:normal;font-size:11px;line-height:1;opacity:.7}
.cell b{position:absolute;right:7px;bottom:5px;font-weight:600;font-size:clamp(13px,1.35vw,17px);line-height:1}
.cell.wk{background:var(--cell-wk);color:var(--cell-wk-ink)}
.cell.lv{background:var(--cell-lv);color:var(--cell-lv-ink)}
.cell.ph{background:var(--cell-ph);color:var(--cell-ph-ink)}
.cell.we{background:var(--cell-we);color:var(--sheet-muted)}
.cell.fut{box-shadow:inset 0 0 0 1px var(--sheet-line);color:var(--sheet-muted)}
.cell.today{box-shadow:0 0 0 2px var(--sheet-bg),0 0 0 4px #fff}
.cell.blank{visibility:hidden}
.month-key{display:flex;flex-wrap:wrap;gap:6px 18px;list-style:none;margin:14px 0 0;padding:0;font-size:13px;color:var(--sheet-muted)}
.month-key li{display:flex;align-items:center;gap:7px}
.sw{width:12px;height:12px;border-radius:3px;display:inline-block}
.sw.wk{background:var(--cell-wk)}.sw.lv{background:var(--cell-lv)}.sw.ph{background:var(--cell-ph)}.sw.we{background:rgba(255,255,255,.18)}.sw.fut{box-shadow:inset 0 0 0 1px rgba(255,255,255,.45)}

/* the one moment of motion: the month fills in once, like a timesheet being read */
@media (prefers-reduced-motion:no-preference){
  .cell:not(.blank){animation:cell-in .32s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i) * 16ms + 120ms)}
  @keyframes cell-in{from{opacity:0;transform:translateY(4px)}}
}

/* ── the form side ── */
.signin-main{display:flex;flex-direction:column;justify-content:center;padding:48px clamp(20px,6vw,88px)}
.signin-top{display:none}
.signin-form{width:min(380px,100%)}
.signin-form h1{margin:0 0 6px;font:600 34px/1.1 var(--f-time);font-stretch:87.5%;color:var(--text)}
.signin-form .lead{margin:0 0 28px;color:var(--text-muted);font-size:15px;line-height:1.45}
.signin-note{margin:28px 0 0;padding-top:16px;border-top:1px solid var(--border);color:var(--text-muted);font-size:13px;line-height:1.5;max-width:38ch}

.auth-field{display:flex;flex-direction:column;gap:6px;margin-bottom:18px}
.auth-field label{font:600 14px/1.2 var(--f-sans);color:var(--text)}
.auth-input{position:relative;display:flex}
.auth-input input{width:100%;height:48px;padding:0 14px;border:1px solid var(--border-input);border-radius:8px;background:var(--surface);color:var(--text);font:400 16px var(--f-sans)}
.auth-input input::placeholder{color:var(--text-muted);opacity:.8}
.auth-input input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.auth-input.has-toggle input{padding-right:72px}
.auth-toggle{position:absolute;right:6px;top:7px;height:34px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:var(--accent);font:600 13px var(--f-sans);cursor:pointer}
.auth-toggle:hover{background:var(--accent-soft)}
.auth-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.auth-error{display:none;gap:10px;align-items:flex-start;margin:0 0 18px;padding:10px 12px;border-radius:8px;background:var(--danger-soft);color:var(--danger);font-size:14px;line-height:1.4}
.auth-error.on{display:flex}
.auth-error svg{flex:none;margin-top:2px}
.auth-ok{display:none;margin:0 0 18px;padding:10px 12px;border-radius:8px;background:var(--accent-soft);color:var(--accent);font-size:14px}
.auth-ok.on{display:block}
.auth-go{width:100%;height:50px;margin-top:4px;border:0;border-radius:8px;background:var(--accent);color:var(--on-accent,#fff);font:600 17px var(--f-time);letter-spacing:.01em;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:10px}
.auth-go:hover{filter:brightness(1.1)}
.auth-go:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.auth-go:disabled{opacity:.8;cursor:progress}
.auth-go .spin{display:none;width:18px;height:18px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:auth-spin .7s linear infinite}
.auth-go:disabled .spin{display:inline-block}
@keyframes auth-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.auth-go .spin{animation-duration:2s}}

/* ── narrow screens: the form first, the month below it ── */
@media (max-width:860px){
  .signin{grid-template-columns:1fr;min-height:0}
  .signin-main{order:1;padding:28px 16px 36px;justify-content:flex-start}
  .signin-sheet{order:2;padding:28px 16px;gap:20px}
  .sheet-brand{display:none}
  .sheet-title,.sheet-line{display:none}
  .signin-top{display:flex;align-items:center;gap:10px;margin-bottom:28px;font:600 18px/1 var(--f-time);color:var(--text)}
  .signin-top .sheet-logo,.signin-top .sheet-mark{width:36px;height:36px;border-radius:8px}
  .signin-top .sheet-mark{background:var(--sheet-bg);color:#fff;font-size:15px}
  .signin-form{width:100%;max-width:420px}
}
