/* 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], input[type=number], input[type=time], 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; } }

.schedule-row { margin-bottom: 16px; }
.schedule-row legend { padding: 0 6px; font-size: 18px; }
.schedule-grid { display: grid; grid-template-columns: 80px repeat(5, minmax(0, 1fr)); gap: 0 14px; align-items: end; }
.schedule-grid .field { margin-bottom: 8px; }
.schedule-grid label { font-size: 14px; }
@media (max-width: 1100px) { .schedule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.module-choices > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px; margin-top: 6px; }
.module-choices label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.module-choices input { width: 18px; height: 18px; }
@media (max-width: 820px) { .module-choices > div { grid-template-columns: 1fr; } }

.binding-row { margin-bottom: 14px; }
.binding-row > label { font-size: 15px; }
.binding-controls { display: flex; gap: 10px; align-items: center; }
.binding-controls select { flex: 1; min-width: 0; }

/* M4d setup steps */
.grid-3 { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 0 16px; }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
.table-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.table-scroll table { width: 100%; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 24px; align-items: start; }
.color-row { display: grid; gap: 4px; }
.color-field { display: grid; grid-template-columns: 90px minmax(0, 220px); gap: 4px 12px; align-items: center; }
.color-field .help { grid-column: 2; margin: 0; }
.color-field label { margin: 0; }
.color-pair { display: flex; gap: 8px; align-items: center; }
.color-pair input[type="color"] { width: 44px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--field-bg); cursor: pointer; flex: none; }
.color-hex { width: 100%; min-width: 0; font-family: ui-monospace, Menlo, monospace; }
.contrast-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.contrast-list li { display: grid; grid-template-columns: 68px 1fr; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; font-size: 15px; }
.contrast-list li.ok { background: var(--good-bg); color: var(--good-text); }
.contrast-list li.warn { background: var(--warn-bg); color: var(--warn-text); }
.contrast-list li.block { background: var(--bad-bg); color: var(--bad-text); }
.contrast-ratio { font-weight: 700; font-variant-numeric: tabular-nums; }
.brand-preview { --bp-header: #03142a; --bp-accent: #45c59b; --bp-series: #26496a; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg); }
.bp-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bp-header); border-bottom: 2px solid var(--bp-accent); color: #fff; }
.bp-header img { height: 32px; max-width: 160px; object-fit: contain; }
.bp-name { font-weight: 700; font-family: var(--font-head); }
.bp-pill { margin-left: auto; font-size: 13px; padding: 4px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; }
.bp-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bp-accent); color: #03142a; font-weight: 700; }
.bp-body { display: grid; grid-template-columns: 110px 1fr; }
.bp-nav { display: grid; gap: 4px; padding: 12px 8px; border-right: 1px solid var(--border); font-size: 14px; align-content: start; }
.bp-nav span { padding: 5px 8px; border-radius: 6px; }
.bp-nav .bp-active { box-shadow: inset 3px 0 0 var(--bp-accent); background: var(--surface); font-weight: 600; }
.bp-chart { padding: 12px 14px; }
.bp-bars rect { fill: var(--bp-series); }
.bp-now { fill: var(--text); }
.bp-axis { stroke: var(--border-strong); }
.bp-good { color: var(--good-text); background: var(--good-bg); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.bp-bad { color: var(--bad-text); background: var(--bad-bg); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
@media (max-width: 900px) { .brand-grid, .grid-3 { grid-template-columns: 1fr; } }
.brand-section { margin-bottom: 16px; }
.brand-section legend { font-weight: 700; }
.brand-thumb { max-height: 44px; max-width: 200px; padding: 6px; border-radius: 6px; background: var(--black-navy); }
.brand-thumb.icon { max-height: 40px; width: 40px; object-fit: contain; }
.brand-preview-col { position: sticky; top: 90px; align-self: start; }
.brand-section { min-width: 0; }
.brand-grid > * { min-width: 0; }
.domain-colors[hidden] { display: none; }
.brand-section .grid-2 { grid-template-columns: 1fr; }
