/* Installation wizard styles */
:root {
    --ink: #2b2723;
    --ink-soft: #55504a;
    --muted: #8a8177;
    --line: #e8e2d9;
    --bg: #f7f4ef;
    --card: #ffffff;
    --accent: #b0785a;
    --accent-ink: #8d5f46;
    --good: #4f7d62;
    --bad: #a1524b;
    --radius: 16px;
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    background:
        radial-gradient(1200px 500px at 85% -10%, #efe6db 0%, transparent 60%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.55;
}

.wizard { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; max-width: 1200px; margin: 0 auto; }

/* Sidebar */
.wizard-side { padding: 40px 28px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 32px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, #c98d6b, #96603f);
    color: #fff; font-family: var(--font-display); font-size: 24px; font-weight: 600;
    box-shadow: 0 8px 18px rgba(176, 120, 90, .35);
}
.brand-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--muted); }

.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; font-size: 14px; }
.step-dot {
    width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); flex: none;
    display: grid; place-items: center; font-size: 12px; font-weight: 600; background: #fff; position: relative;
}
.step-check { display: none; }
.step.is-current { background: #fff; color: var(--ink); box-shadow: 0 4px 14px rgba(43, 39, 35, .06); }
.step.is-current .step-dot { border-color: var(--accent); color: var(--accent-ink); }
.step.is-done { color: var(--ink-soft); }
.step.is-done .step-dot { background: var(--good); border-color: var(--good); color: #fff; }
.step.is-done .step-num { display: none; }
.step.is-done .step-check { display: block; }
.side-note { margin-top: auto; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* Main */
.wizard-main { padding: 40px 48px 80px; position: relative; }
.panel { max-width: 720px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-head { margin-bottom: 28px; }
.panel-head h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 8px; }
.panel-head p { color: var(--muted); max-width: 56ch; }

/* Checklist */
.checklist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check {
    display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 4px 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
}
.check-icon { width: 22px; height: 22px; border-radius: 50%; position: relative; }
.check.ok .check-icon { background: rgba(79, 125, 98, .14); }
.check.ok .check-icon::after { content: ""; position: absolute; inset: 6px 5px 7px 5px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg) translateY(-1px); }
.check.bad .check-icon { background: rgba(161, 82, 75, .14); }
.check.bad .check-icon::before, .check.bad .check-icon::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; background: var(--bad); transform: translate(-50%, -50%) rotate(45deg);
}
.check.bad .check-icon::after { transform: translate(-50%, -50%) rotate(-45deg); }
.check-label { font-weight: 500; }
.check-note { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.check-state { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.check.ok .check-state { color: var(--good); }
.check.bad .check-state { color: var(--bad); }

/* Forms */
form { display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.req { color: var(--bad); font-weight: 700; }
.field input, .field select, .field textarea {
    font: inherit; color: var(--ink); background: var(--card);
    border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176, 120, 90, .16);
}
.field input[type="file"] { padding: 9px 12px; background: #fbf9f6; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.hint { font-size: 12.5px; color: var(--muted); }
.error { font-size: 12.5px; color: var(--bad); font-weight: 500; min-height: 0; display: none; }
.error.show { display: block; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; border-radius: 8px; opacity: .55;
}
.pw-toggle:hover { opacity: 1; background: #f1ece5; }
.pw-toggle::before {
    content: ""; display: block; width: 18px; height: 18px; margin: 0 auto;
    background: currentColor;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2"><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></svg>') center / contain no-repeat;
}
.pw-toggle.showing { opacity: .9; color: var(--accent-ink); }

.suffix-wrap { display: flex; align-items: center; gap: 10px; }
.suffix-wrap input { width: 90px; flex: none; }
.suffix { font-size: 13px; color: var(--muted); }

.prefix-set { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fbf9f6; }
.prefix-set legend { font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 0 8px; }

.test-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.test-input { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 240px; }
.test-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176,120,90,.16); }
.test-result { font-size: 13px; font-weight: 500; }
.test-result.ok { color: var(--good); }
.test-result.bad { color: var(--bad); }

/* Buttons */
.btn {
    font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
    border-radius: 999px; padding: 11px 24px; border: 1px solid transparent;
    transition: transform .12s ease, box-shadow .12s ease, background .12s;
    min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #443e37; box-shadow: 0 8px 20px rgba(43, 39, 35, .18); }
.btn.primary:disabled { opacity: .55; cursor: wait; }
.btn.primary.lg { padding: 14px 36px; font-size: 15px; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn.ghost:hover { border-color: #d5cec4; color: var(--ink); }
.btn.subtle { background: transparent; color: var(--muted); }
.btn.subtle:hover { color: var(--ink); }

.panel-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.panel-foot .btn.ghost:first-child { margin-right: auto; }

/* Summary */
.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.summary-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); }
.summary-row strong { font-weight: 600; text-align: right; }

.security-note { background: rgba(79, 125, 98, .07); border: 1px solid rgba(79, 125, 98, .2); border-radius: var(--radius); padding: 18px 22px; }
.security-note h3 { font-size: 14px; margin-bottom: 10px; color: var(--good); }
.security-note ul { padding-left: 18px; color: var(--ink-soft); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }

/* Install progress */
.install-progress { position: absolute; inset: 0; background: rgba(247, 244, 239, .96); display: grid; place-content: center; text-align: center; gap: 10px; z-index: 10; }
.install-progress h2 { font-family: var(--font-display); }
.install-progress p { color: var(--muted); max-width: 40ch; }
.spinner { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(43, 39, 35, .45); backdrop-filter: blur(3px);
    display: grid; place-items: center; padding: 20px; z-index: 100;
}
.modal {
    background: #fff; border-radius: 20px; padding: 34px 32px 28px; max-width: 420px; width: 100%;
    text-align: center; box-shadow: 0 30px 80px rgba(43, 39, 35, .3); animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.modal h2 { font-family: var(--font-display); font-size: 21px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; }
.modal-actions { margin-top: 22px; }
.modal-icon { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; position: relative; }
.modal-icon.success { background: rgba(79, 125, 98, .14); }
.modal-icon.success::after { content: ""; position: absolute; inset: 16px 13px 19px 13px; border-left: 3px solid var(--good); border-bottom: 3px solid var(--good); transform: rotate(-45deg) translateY(-2px); }
.modal-icon.error { background: rgba(161, 82, 75, .13); }
.modal-icon.error::before, .modal-icon.error::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 3px; border-radius: 2px; background: var(--bad); transform: translate(-50%, -50%) rotate(45deg); }
.modal-icon.error::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* Responsive */
@media (max-width: 860px) {
    .wizard { grid-template-columns: 1fr; }
    .wizard-side { flex-direction: column; padding: 24px 16px 8px; border-right: 0; gap: 18px; }
    .steps { flex-direction: row; overflow-x: auto; padding-bottom: 8px; gap: 2px; }
    .step { flex: none; padding: 8px 10px; }
    .step-label { display: none; }
    .step.is-current .step-label { display: inline; font-size: 13px; }
    .side-note { display: none; }
    .wizard-main { padding: 20px 16px 60px; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .panel-head h1 { font-size: 24px; }
    .panel-foot { flex-wrap: wrap; }
}
