/*
 * The installer's own stylesheet (1.2.98). install.php runs before anything
 * else exists, so it depends on nothing: no CDN, no icon font, no compiled
 * Tailwind. Colours follow the admin: one blue accent, slate neutrals, red
 * only for errors, amber for things to look at later.
 */
:root {
    --accent: #2563eb; --accent-600: #2563eb; --accent-700: #1d4ed8; --accent-50: #eff6ff; --accent-100: #dbeafe; --accent-200: #bfdbfe;
    --ink: #0f172a; --text: #334155; --muted: #64748b; --faint: #94a3b8; --line: #e2e8f0; --soft: #f8fafc;
    --ok: #15803d; --ok-bg: #f0fdf4; --warn: #b45309; --warn-bg: #fffbeb; --bad: #b91c1c; --bad-bg: #fef2f2;
    --radius: 12px;
    --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 12px 32px -16px rgb(15 23 42 / .18);
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: #f1f5f9; }
body {
    margin: 0; min-height: 100vh; color: var(--text);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: radial-gradient(1200px 600px at 50% -200px, var(--accent-100), transparent 70%) no-repeat, linear-gradient(#f8fafc, #f1f5f9 640px) no-repeat #f1f5f9;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-700); }
a:hover { color: var(--ink); }
code { font: .9em/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f1f5f9; border-radius: 4px; padding: .1em .35em; }
strong { color: var(--ink); font-weight: 600; }

.ico { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ico--sm { width: 16px; height: 16px; vertical-align: -3px; }
.ico--lg { width: 30px; height: 30px; }
.ico--ok { color: var(--ok); }

.shell { max-width: 680px; margin: 0 auto; padding: 40px 20px 32px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand__logo { width: 52px; height: 52px; border-radius: 14px; filter: drop-shadow(0 6px 14px rgb(37 99 235 / .25)); }
.brand__title { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.brand__sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* Steps */
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 6px; }
.steps__item { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: 10px; color: var(--faint); font-size: 13px; font-weight: 500; }
.steps__item--current { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.steps__item--done { color: var(--text); }
.steps__dot { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted); }
.steps__item--current .steps__dot { background: var(--accent); color: #fff; }
.steps__item--done .steps__dot { background: var(--accent-100); color: var(--accent-700); }
.steps__label { overflow-wrap: anywhere; }

/* Card */
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
.card__title { margin: 0 0 6px; font-size: 20px; line-height: 1.3; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.card__lead { margin: 0 0 24px; color: var(--muted); }
.card__lead .ico { margin-right: 4px; }

/* Requirement checks */
.checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.check { display: flex; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.check__icon { margin-top: 2px; }
.check--ok .check__icon { color: var(--ok); }
.check--warn { background: var(--warn-bg); }
.check--warn .check__icon { color: var(--warn); }
.check--fail { background: var(--bad-bg); }
.check--fail .check__icon { color: var(--bad); }
.check__body { flex: 1; min-width: 0; }
.check__row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check__name { font-weight: 500; color: var(--ink); }
.check__value { color: var(--muted); font-size: 13px; }
.check--fail .check__value { color: var(--bad); font-weight: 600; }
.check__fix { margin: 4px 0 0; font-size: 13px; color: var(--text); }
.tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-size: 11px; font-weight: 500; vertical-align: 1px; }
.check--warn .tag { background: #fef3c7; color: var(--warn); }

/* Forms */
.form { margin: 0; }
.group { border: 0; margin: 0 0 22px; padding: 0; }
.group legend { padding: 0; margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.optional { font-weight: 400; color: var(--faint); font-size: 13px; }
.field input, .field select {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink);
    font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field select { padding-right: 32px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; }
.field input::placeholder { color: var(--faint); }
.field input:focus, .field select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-100); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #f87171; }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px #fee2e2; }
.help { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--bad); display: flex; gap: 5px; align-items: flex-start; }
.field-error .ico { margin-top: 2px; vertical-align: 0; }

.reveal { position: relative; }
.reveal input { padding-right: 46px; }
.reveal__btn { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.reveal__btn:hover, .reveal__btn.is-on { color: var(--accent-700); background: var(--accent-50); }
.reveal__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.meter__bar { flex: none; width: 96px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--bad); transition: width .2s, background .2s; }
.meter[data-score="0"] .meter__fill { width: 12%; }
.meter[data-score="1"] .meter__fill { width: 30%; background: #ef4444; }
.meter[data-score="2"] .meter__fill { width: 55%; background: #f59e0b; }
.meter[data-score="3"] .meter__fill { width: 80%; background: #22c55e; }
.meter[data-score="4"] .meter__fill { width: 100%; background: #16a34a; }

.more { margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--radius); }
.more > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.more > summary::-webkit-details-marker { display: none; }
.more__chev { color: var(--muted); transition: transform .15s; }
.more[open] .more__chev { transform: rotate(180deg); }
.more__value { margin-left: auto; color: var(--muted); font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.more > .grid { padding: 4px 14px 14px; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__track { flex: none; position: relative; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px; background: #cbd5e1; transition: background .15s; }
.toggle__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; }
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle__track { box-shadow: 0 0 0 3px var(--accent-100); }
.toggle .help { margin: 2px 0 0; display: inline; }

.note { display: flex; gap: 8px; align-items: flex-start; margin: 20px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--soft); color: var(--muted); font-size: 13px; }
.note .ico { margin-top: 1px; vertical-align: 0; color: var(--accent-700); }

/* Buttons */
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.actions--center { justify-content: center; }
.actions__note { margin: 0; color: var(--muted); font-size: 14px; flex: 1 1 220px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px;
    font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn--lg { height: 48px; padding: 0 22px; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgb(37 99 235 / .3), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn--primary:hover { background: var(--accent-700); color: #fff; }
.btn--secondary { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn--secondary:hover { background: var(--soft); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--muted); padding: 0 10px; }
.btn--ghost:hover { color: var(--ink); background: #f1f5f9; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { cursor: progress; opacity: .85; }
.spinner { width: 16px; height: 16px; border-radius: 999px; border: 2px solid rgb(255 255 255 / .45); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alerts */
.alert { display: flex; gap: 12px; margin: -8px 0 24px; padding: 14px 16px; border-radius: var(--radius); }
.alert--error { background: var(--bad-bg); border: 1px solid #fecaca; color: #7f1d1d; }
.alert__icon { color: var(--bad); margin-top: 1px; }
.alert__title { margin: 0; font-weight: 600; color: #7f1d1d; }
.alert__text { margin: 4px 0 0; font-size: 14px; }
.alert__text code { background: #fee2e2; }
.alert__details { margin-top: 8px; font-size: 13px; }
.alert__details summary { cursor: pointer; color: var(--bad); }
.alert__details code { display: block; margin-top: 6px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; background: #fff; border: 1px solid #fecaca; }

/* Done */
.done { text-align: center; padding: 8px 0 4px; }
.done__badge { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #22c55e, #15803d); box-shadow: 0 10px 24px -8px rgb(21 128 61 / .5); }
.done .card__lead { margin-bottom: 0; }
.next__title { margin: 32px 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.next { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.next a { display: flex; gap: 12px; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.next a:hover { border-color: var(--accent-200); box-shadow: var(--shadow); color: var(--text); }
.next a > span { display: flex; flex-direction: column; gap: 2px; }
.next strong { font-size: 14px; }
.next__icon { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--accent-50); color: var(--accent-700); }

.foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--faint); }
.foot a { color: var(--muted); }

/* Phones */
@media (max-width: 640px) {
    body { font-size: 16px; }
    .shell { padding: 20px 16px 24px; }
    .brand { margin-bottom: 18px; }
    .brand__logo { width: 44px; height: 44px; }
    .steps__item { padding: 6px; justify-content: center; }
    .steps__item:not(.steps__item--current) .steps__label { display: none; }
    .steps__item--current { flex: 2.4; justify-content: flex-start; }
    .card { padding: 22px 18px; border-radius: 16px; }
    .grid, .next { grid-template-columns: 1fr; }
    .field input, .field select { height: 46px; font-size: 16px; }
    .btn { height: 46px; font-size: 16px; }
    .actions { flex-direction: column-reverse; align-items: stretch; }
    .actions--center { flex-direction: column; }
    .actions .btn { width: 100%; }
    .actions__note { flex: none; text-align: center; }
    .reveal__btn { top: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }
