/* Page styles for the portal. Tokens and the top bar live in chrome.css. */

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
small, .small { font-size: 14px; }
.muted { color: var(--text-muted); }


main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.narrow { max-width: 440px; margin: 64px auto; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 14px; font-weight: 600; color: var(--text-muted); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; align-items: center; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=url],
input[type=tel], select, textarea {
  width: 100%; font: 16px var(--font-body); color: var(--text); background: var(--field-bg);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px;
}
textarea { resize: vertical; }
.field { margin-bottom: 18px; }
.field .help, .helptext { display: block; font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.errorlist { list-style: none; padding: 0; margin: 4px 0; color: var(--bad-text); font-size: 14px; font-weight: 500; }
.errors-box { background: var(--bad-bg); color: var(--bad-text); border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; }
ul.choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
ul.choices label { font-weight: 500; display: flex; gap: 8px; align-items: center; }

.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; }
.messages .success { background: var(--good-bg); color: var(--good-text); }
.messages .error { background: var(--bad-bg); color: var(--bad-text); }
.messages .info { background: var(--surface-2); color: var(--text); }

table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 14px; font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong); padding: 8px 10px; }
table.data td { border-bottom: 1px solid var(--border); padding: 10px; vertical-align: top; }
table.data input, table.data select { min-width: 120px; }

.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 14px; font-weight: 600; }
.chip.done { background: var(--good-bg); color: var(--good-text); }
.chip.draft { background: var(--warn-bg); color: var(--warn-text); }
.chip.todo { background: var(--surface-2); color: var(--text); }
.chip.later, .chip.skipped { background: transparent; color: var(--text-muted); border: 1px dashed var(--border-strong); }
.chip.team { background: var(--amber); color: var(--black-navy); }

.wizard { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.wizard > * { min-width: 0; }
.table-wrap { overflow-x: auto; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; }
.steps a, .steps .step-off {
  display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text);
}
.steps a::before, .steps .step-off::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 14px; font-weight: 600;
}
.steps a:hover { background: var(--surface-2); }
.steps .current a { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--client-accent); }
.steps .state-done a::before { background: var(--good-bg); color: var(--good-text); border-color: transparent; }
.steps .step-off { color: var(--text-muted); }
.steps .title { font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.client-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

@media (max-width: 820px) {
  .wizard, .grid-2 { grid-template-columns: 1fr; }
  .steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .steps li { flex: 0 0 auto; }
  .steps .state-later { display: none; }
  main { padding: 24px 16px 48px; }
  h1 { font-size: 28px; }
  table.data { display: block; overflow-x: auto; }
}

.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-logo img { display: block; height: 108px; width: auto; }
.logo-for-dark { display: none !important; }
:root[data-theme="dark"] .logo-for-light { display: none !important; }
:root[data-theme="dark"] .logo-for-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-for-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-for-dark { display: block !important; }
}

.btn.is-busy, .btn-link.is-busy { cursor: progress; opacity: .85; }
.btn.is-busy::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::before { animation-duration: 2s; } }
