/* == theme == */
:root {
  --radius: 14px;
  --radius-s: 10px;
  --speed: 160ms;
  color-scheme: dark;
  --bg0: #0a0d13;
  --bg1: #0f131b;
  --bg2: #141a24;
  --bg3: #1a2130;
  --ink: #edf1f7;
  --ink2: #a6b0c2;
  --ink3: #76839a;
  --hair: rgba(160, 176, 205, 0.14);
  --hair-strong: rgba(160, 176, 205, 0.26);
  --accent: #7c8cff;
  --accent-deep: #5b6cf2;
  --accent-hover: #98a5ff;
  --accent-soft: rgba(124, 140, 255, 0.13);
  --accent-line: rgba(124, 140, 255, 0.38);
  --accent-glow: rgba(124, 140, 255, 0.55);
  --live: #3ddc97;
  --live-soft: rgba(61, 220, 151, 0.12);
  --live-line: rgba(61, 220, 151, 0.35);
  --live-glow: rgba(61, 220, 151, 0.35);
  --warn: #f0b45c;
  --warn-soft: rgba(240, 180, 92, 0.12);
  --danger: #ff7a76;
  --code-bg: #070a10;
  --code-ink: #9fb2d8;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 14px 40px rgba(0, 0, 0, 0.40);
  --shadow-3: 0 10px 28px rgba(0, 0, 0, 0.38);
  --edge: rgba(237, 241, 247, 0.05);
  --wash: rgba(124, 140, 255, 0.08);
  --selection: rgba(124, 140, 255, 0.35);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a6b0c2' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg0: #f2f4f9;
  --bg1: #f9fafc;
  --bg2: #ffffff;
  --bg3: #e8ecf4;
  --ink: #181e2b;
  --ink2: #4c576e;
  --ink3: #5c6880;
  --hair: rgba(24, 30, 43, 0.10);
  --hair-strong: rgba(24, 30, 43, 0.20);
  --accent: #4353e8;
  --accent-deep: #3644c9;
  --accent-hover: #2f3cb0;
  --accent-soft: rgba(67, 83, 232, 0.09);
  --accent-line: rgba(67, 83, 232, 0.35);
  --accent-glow: rgba(67, 83, 232, 0.35);
  --live: #0c7f56;
  --live-soft: rgba(12, 127, 86, 0.11);
  --live-line: rgba(12, 127, 86, 0.35);
  --live-glow: rgba(12, 127, 86, 0.30);
  --warn: #8f5a0a;
  --warn-soft: rgba(143, 90, 10, 0.11);
  --danger: #cf3f39;
  --code-bg: #10141c;
  --code-ink: #9fb2d8;
  --shadow-1: 0 1px 2px rgba(24, 30, 43, 0.05), 0 4px 14px rgba(24, 30, 43, 0.05);
  --shadow-2: 0 12px 32px rgba(24, 30, 43, 0.10);
  --shadow-3: 0 14px 34px rgba(24, 30, 43, 0.13);
  --edge: rgba(255, 255, 255, 0.9);
  --wash: rgba(67, 83, 232, 0.05);
  --selection: rgba(67, 83, 232, 0.22);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234c576e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
  color-scheme: light;
  --bg0: #f2f4f9;
  --bg1: #f9fafc;
  --bg2: #ffffff;
  --bg3: #e8ecf4;
  --ink: #181e2b;
  --ink2: #4c576e;
  --ink3: #5c6880;
  --hair: rgba(24, 30, 43, 0.10);
  --hair-strong: rgba(24, 30, 43, 0.20);
  --accent: #4353e8;
  --accent-deep: #3644c9;
  --accent-hover: #2f3cb0;
  --accent-soft: rgba(67, 83, 232, 0.09);
  --accent-line: rgba(67, 83, 232, 0.35);
  --accent-glow: rgba(67, 83, 232, 0.35);
  --live: #0c7f56;
  --live-soft: rgba(12, 127, 86, 0.11);
  --live-line: rgba(12, 127, 86, 0.35);
  --live-glow: rgba(12, 127, 86, 0.30);
  --warn: #8f5a0a;
  --warn-soft: rgba(143, 90, 10, 0.11);
  --danger: #cf3f39;
  --code-bg: #10141c;
  --code-ink: #9fb2d8;
  --shadow-1: 0 1px 2px rgba(24, 30, 43, 0.05), 0 4px 14px rgba(24, 30, 43, 0.05);
  --shadow-2: 0 12px 32px rgba(24, 30, 43, 0.10);
  --shadow-3: 0 14px 34px rgba(24, 30, 43, 0.13);
  --edge: rgba(255, 255, 255, 0.9);
  --wash: rgba(67, 83, 232, 0.05);
  --selection: rgba(67, 83, 232, 0.22);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234c576e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  }
}
/* == /theme == */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { max-width: 42rem; margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }

/* Exactly one view is visible, chosen by the body's data-view. */
.loading, .account, .wizard, .done { display: none; }
body[data-view='loading'] .loading { display: block; }
body[data-view='signup'] .signup { display: block; }
body[data-view='signin'] .signin { display: block; }
body[data-view='wizard'] .wizard { display: block; }
body[data-view='done'] .done { display: flex; }

h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h2 { font-size: 1rem; font-weight: 600; margin: 1.9rem 0 0.3rem; }
.lede { color: var(--ink2); margin: 0 0 1.6rem; }
.hint { color: var(--ink3); font-size: 0.84rem; margin: 0.3rem 0 0; }
.loading { color: var(--ink3); }
::selection { background: var(--selection); }

.account, .wizard {
  background: radial-gradient(140% 100% at 50% 0%, var(--wash) 0%, transparent 60%), var(--bg2);
  border: 1px solid var(--hair); border-radius: 20px;
  padding: 2.1rem 2rem; box-shadow: inset 0 1px 0 var(--edge), var(--shadow-2);
}
.account { max-width: 25rem; margin: 8vh auto 0; }

.field { margin-bottom: 0.9rem; }
.pair { display: flex; gap: 0.85rem; flex-wrap: wrap; }
.pair .field { flex: 1 1 12rem; }
label { display: block; font-size: 0.82rem; color: var(--ink2); margin-bottom: 0.3rem; }
label.check { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink); font-size: 0.92rem; margin: 0.2rem 0; }
label.check input { width: auto; margin: 0; }
input, select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--hair);
  border-radius: var(--radius-s); font: inherit; background: var(--bg1); color: var(--ink);
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--hair-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); background: var(--bg2); outline: none; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 0.7rem center;
}
input[type='checkbox'] { accent-color: var(--accent-deep); }
textarea { resize: vertical; }
button { font: inherit; cursor: pointer; color: inherit; }
button.primary {
  background: linear-gradient(180deg, var(--accent) -35%, var(--accent-deep) 90%);
  color: #fff; border: 0; border-radius: var(--radius-s);
  padding: 0.6rem 1.1rem; font-weight: 600; box-shadow: var(--shadow-1);
  transition: filter var(--speed) ease, transform var(--speed) ease, box-shadow var(--speed) ease;
}
button.primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-3); }
button.primary[disabled] { opacity: 0.45; cursor: default; transform: none; }
button.quiet {
  background: transparent; color: var(--ink); border: 1px solid var(--hair-strong);
  border-radius: var(--radius-s); padding: 0.5rem 0.9rem; font-weight: 550;
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
button.quiet:hover { border-color: var(--accent-line); background: var(--accent-soft); }
button.linky { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 550; }
button.linky:hover { color: var(--accent-hover); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.error { color: var(--danger); min-height: 1.2rem; margin: 0.5rem 0 0; font-size: 0.92rem; }
.swap { color: var(--ink3); font-size: 0.88rem; margin-top: 1.25rem; }
.actions { display: flex; gap: 0.6rem; margin-top: 1.6rem; }

.wizard header { display: flex; align-items: baseline; gap: 0.75rem; }
.wizard header h1 { flex: 1; }

.steps { list-style: none; display: flex; gap: 0.4rem; padding: 0; margin: 0 0 1.75rem; flex-wrap: wrap; }
.steps li {
  font-size: 0.82rem; font-weight: 550; color: var(--ink3);
  background: var(--bg1); border: 1px solid var(--hair);
  border-radius: 999px; padding: 0.18rem 0.75rem;
  transition: color var(--speed) ease, border-color var(--speed) ease, background var(--speed) ease;
}
.steps li[aria-current='step'] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.steps li[data-done='yes'] { color: var(--live); border-color: var(--live-line); }

fieldset.step { border: 0; padding: 0; margin: 0; }
fieldset.step:not([data-current='yes']) { display: none; }
fieldset.step > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
fieldset.inner {
  border: 1px solid var(--hair); border-radius: var(--radius-s); padding: 0.7rem 1rem 1rem;
  margin: 1.4rem 0; background: var(--bg1);
}
fieldset.inner legend { font-size: 0.82rem; color: var(--ink2); padding: 0 0.35rem; }

table.hours { width: 100%; border-collapse: collapse; }
table.hours th { text-align: left; font-weight: 500; color: var(--ink2); padding: 0.2rem 0.5rem 0.2rem 0; white-space: nowrap; }
table.hours td { padding: 0.18rem 0.3rem; }
table.hours input[type='time'] { min-width: 6.5rem; }
tr[data-shut='yes'] input[type='time'] { opacity: 0.3; }

ul.rows { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.5rem; }
ul.rows li {
  background: var(--bg1); border: 1px solid var(--hair); border-radius: var(--radius-s);
  padding: 0.65rem 0.75rem; display: grid; gap: 0.45rem;
}
ul.rows .line { display: flex; gap: 0.5rem; flex-wrap: wrap; }
ul.rows .line input { flex: 1 1 8rem; }
ul.rows .drop { align-self: end; }

/* --------------------------------------------------------- completion moment */
.done { min-height: 70vh; align-items: center; justify-content: center; }
.done-card {
  max-width: 26rem; text-align: center;
  background: radial-gradient(120% 130% at 50% 0%, var(--live-soft) 0%, transparent 55%), var(--bg2);
  border: 1px solid var(--hair); border-radius: 18px; padding: 2.6rem 2.2rem 2.2rem;
  box-shadow: var(--shadow-2);
}
.done-portrait { position: relative; display: inline-block; margin-bottom: 1.1rem; }
.done-portrait img.avatar {
  display: block; width: 5rem; height: 5rem; border-radius: 1.5rem;
  object-fit: cover; border: 1px solid var(--hair-strong); background: var(--bg3);
}
.done-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--live-soft); color: var(--live);
  border: 1px solid var(--live-line);
  font-size: 1.3rem; font-weight: 700;
}
.done-portrait img.avatar:not([hidden]) + .done-mark {
  position: absolute; right: -0.6rem; bottom: -0.6rem;
  width: 1.9rem; height: 1.9rem; font-size: 0.9rem;
  border: 2px solid var(--bg2); background: var(--bg2); color: var(--live);
}
.done-mark::before { content: '\2713'; }
.done .summary { color: var(--ink2); margin: 0.4rem 0 0; }
.done .entering { color: var(--ink3); font-size: 0.9rem; margin-top: 1.6rem; }
@media (prefers-reduced-motion: no-preference) {
  .done-card { animation: settle 340ms ease; }
  @keyframes settle { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
}

@media (max-width: 30rem) {
  .account, .wizard { padding: 1.5rem 1.2rem; }
  table.hours th, table.hours td { display: block; padding: 0.1rem 0; }
  table.hours tr { display: block; border-bottom: 1px solid var(--hair); padding: 0.5rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
