/* Parking — дизайн-система. Mobile-first, без внешних ресурсов. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #1a1d23;
  --muted: #565d6b;
  --border: #d5d9e0;
  --primary: #1f5fd1;
  --primary-hover: #1749a3;
  --on-primary: #ffffff;
  --focus: #1f5fd1;
  --ok-bg: #dff3e6;   --ok-fg: #0e5a2a;
  --warn-bg: #fdf0cf; --warn-fg: #6b4700;
  --info-bg: #dde9fb; --info-fg: #123e8a;
  --err-bg: #fbdfdf;  --err-fg: #8f1414;
  --off-bg: #e6e8ec;  --off-fg: #454b57;
  --danger: #b42318;
  --danger-hover: #8f1c12;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #181c24;
    --surface-2: #222733;
    --text: #e8eaf0;
    --muted: #a3abbb;
    --border: #333a49;
    --primary: #6ea0ff;
    --primary-hover: #93b8ff;
    --on-primary: #0b1220;
    --focus: #8db3ff;
    --ok-bg: #15341f;   --ok-fg: #8fe0aa;
    --warn-bg: #3b2e0e; --warn-fg: #f3cf7a;
    --info-bg: #172a4d; --info-fg: #a9c8ff;
    --err-bg: #421818;  --err-fg: #ffb3b3;
    --off-bg: #2a2f3a;  --off-fg: #b7bdca;
    --danger: #ff8a80;
    --danger-hover: #ffb0a8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1rem/1.55 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--s3); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--s3); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.skip { position: absolute; left: var(--s3); top: -4rem; background: var(--primary); color: var(--on-primary); padding: var(--s2) var(--s3); border-radius: 6px; z-index: 10; }
.skip:focus { top: var(--s2); }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }

/* Layout */
.container { width: 100%; max-width: 62rem; margin: 0 auto; padding: 0 var(--s4); }
.container--narrow { max-width: 30rem; }
main { flex: 1; padding: var(--s5) 0 var(--s7); }
.page-head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s5); }
.page-head h1 { margin: 0; overflow-wrap: anywhere; }
.stack > * + * { margin-top: var(--s4); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding-top: var(--s3); padding-bottom: var(--s3); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); margin-left: auto; }
.nav a, .nav button.link { color: var(--text); text-decoration: none; padding: var(--s1) var(--s2); border-radius: 6px; font: inherit; }
.nav a:hover, .nav button.link:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }
.nav form { margin: 0; }
button.link { background: none; border: 0; cursor: pointer; }
.nav-email { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--border); padding: var(--s4) 0; color: var(--muted); font-size: .875rem; background: var(--surface); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: space-between; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 2.75rem; padding: .5rem 1.1rem; border-radius: 8px;
  border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn--sm { min-height: 2.25rem; padding: .25rem .75rem; font-size: .875rem; }
.btn--lg { min-height: 3.25rem; padding: .75rem 1.6rem; font-size: 1.1rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }

/* Forms */
.field { margin-bottom: var(--s4); }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: var(--s1); }
.field .hint { display: block; color: var(--muted); font-size: .875rem; margin-top: var(--s1); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], textarea, select {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem; font: inherit;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--muted); border-radius: 8px;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 600; margin-top: var(--s1); font-size: .9rem; }
.radio-cards { display: grid; gap: var(--s3); margin-bottom: var(--s4); border: 0; padding: 0; min-width: 0; }
.radio-cards legend { font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.radio-card { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.radio-card:hover { border-color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.radio-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.radio-card input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }
.radio-card strong { display: block; }
.input-group { display: flex; flex-direction: column; gap: var(--s2); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s4); }
.card--danger { border-color: var(--danger); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: var(--s4); }
.stat { text-align: left; }
.stat .num { font-size: 2rem; font-weight: 700; line-height: 1.1; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .4em; padding: .15rem .65rem;
  border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap;
  background: var(--off-bg); color: var(--off-fg);
}
.badge::before { content: "–"; font-weight: 700; }
.badge--pending_dns { background: var(--warn-bg); color: var(--warn-fg); }
.badge--pending_dns::before { content: "…"; }
.badge--verified { background: var(--info-bg); color: var(--info-fg); }
.badge--verified::before { content: "✓"; }
.badge--issuing_cert { background: var(--info-bg); color: var(--info-fg); }
.badge--issuing_cert::before { content: "↻"; }
.badge--active { background: var(--ok-bg); color: var(--ok-fg); }
.badge--active::before { content: "●"; }
.badge--error { background: var(--err-bg); color: var(--err-fg); }
.badge--error::before { content: "!"; }
.badge--disabled { background: var(--off-bg); color: var(--off-fg); }
.badge--role { background: var(--info-bg); color: var(--info-fg); }
.badge--role::before { content: none; }

/* Flash / alerts */
.flash-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.flash, .alert { padding: var(--s3) var(--s4); border-radius: var(--radius); border: 1px solid transparent; }
.flash--success, .alert--success { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); }
.flash--info, .alert--info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-fg); }
.flash--warning, .alert--warning { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-fg); }
.flash--error, .flash--danger, .alert--error { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-fg); }
.alert { margin-bottom: var(--s4); }
.alert strong { display: block; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: var(--s3) var(--s4); font-weight: 600; }
th, td { padding: var(--s3) var(--s4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td .domain-link { font-weight: 600; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.actions form { margin: 0; }
.inline-form { display: inline-flex; gap: var(--s2); align-items: center; margin: 0; }
.inline-form input[type="number"] { width: 5rem; min-height: 2.25rem; }

/* Mobile: таблица доменов превращается в карточки */
@media (max-width: 40rem) {
  table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
  table.responsive tbody tr:last-child { border-bottom: 0; }
  table.responsive td { border: 0; padding: var(--s1) 0; display: flex; gap: var(--s3); justify-content: space-between; align-items: center; }
  table.responsive td:not([data-label]) { display: block; }
  table.responsive td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; flex: none; }
}

/* Stepper */
.stepper { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: var(--s2); counter-reset: step; }
.stepper li { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.stepper .n { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--surface-2); color: var(--muted); border: 2px solid var(--border); }
.stepper li.is-done { color: var(--text); }
.stepper li.is-done .n { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); }
.stepper li.is-current { color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); font-weight: 600; }
.stepper li.is-current .n { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.stepper li.is-error .n { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-fg); }
@media (min-width: 48rem) {
  .stepper { grid-template-columns: repeat(4, 1fr); }
  .stepper li { flex-direction: column; text-align: center; padding: var(--s3); }
}

/* DNS-запись */
.dns-record { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: var(--s3) var(--s4); }
.dns-record + .dns-record { margin-top: var(--s3); }
.dns-record .dns-head { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; margin-bottom: var(--s2); font-weight: 600; }
.dns-row { display: grid; gap: var(--s1); margin-bottom: var(--s3); }
.dns-row:last-child { margin-bottom: 0; }
.dns-row .k { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.copy-line { display: flex; gap: var(--s2); align-items: stretch; }
.copy-line code { flex: 1; min-width: 0; padding: .5rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.copy-btn.is-copied { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); }

/* Checks */
.checks { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.checks li { display: flex; gap: var(--s3); align-items: flex-start; }
.checks .mark { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; background: var(--warn-bg); color: var(--warn-fg); }
.checks li.ok .mark { background: var(--ok-bg); color: var(--ok-fg); }
.checks li.fail .mark { background: var(--err-bg); color: var(--err-fg); }
.checks .detail { display: block; color: var(--muted); font-size: .875rem; }
.poll-note { color: var(--muted); font-size: .85rem; }

/* Empty state */
.empty { text-align: center; padding: var(--s6) var(--s4); }
.empty svg { width: 3rem; height: 3rem; color: var(--muted); margin-bottom: var(--s3); }
.empty p { color: var(--muted); max-width: 30rem; margin-left: auto; margin-right: auto; }

/* Progress */
.progress { height: .6rem; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); }

/* Landing */
.hero { padding: var(--s6) 0; text-align: left; }
.hero h1 { font-size: 2rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.feature-grid { display: grid; gap: var(--s4); margin: var(--s5) 0; }
.how { counter-reset: how; list-style: none; padding: 0; display: grid; gap: var(--s3); }
.how li { counter-increment: how; display: flex; gap: var(--s3); align-items: flex-start; }
.how li::before { content: counter(how); flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 700; }
.auth-card { margin-top: var(--s5); }

/* Park page */
body.park { align-items: center; justify-content: center; text-align: center; padding: var(--s5) var(--s4); }
.park-box { max-width: 36rem; width: 100%; }
.park-box h1 { font-size: 2rem; overflow-wrap: anywhere; }
.park-box .park-text { font-size: 1.1rem; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.park-foot { margin-top: var(--s6); font-size: .8rem; color: var(--muted); }

.error-page { text-align: center; padding: var(--s6) 0; }
.error-page .code { font-size: 4rem; font-weight: 800; line-height: 1; color: var(--muted); }

@media (min-width: 40rem) {
  .container { padding: 0 var(--s5); }
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.8rem; }
  .feature-grid, .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .input-group { flex-direction: row; }
  .input-group input { flex: 1; }
  .dns-row { grid-template-columns: 8rem 1fr; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .radio-card, .nav a { transition: background-color .15s, border-color .15s, box-shadow .15s; }
  .progress > span { transition: width .3s; }
}
