/* The auth-page background, hero logo and card palette come from the login theme. */
.setup-shell {
    grid-template-columns: minmax(13rem, 0.72fr) minmax(0, 1.45fr);
    max-width: 76rem;
    gap: clamp(2.5rem, 6vw, 6rem);
}
.setup-brand { width: 100%; max-width: 19rem; justify-self: center; }
.setup-brand .hero-logo { width: 100%; margin: 0 auto; }
.setup-identity {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    font-weight: 600;
}
.setup-version { color: var(--gold); font-size: .8rem; font-weight: 500; }
.setup-steps { display: grid; gap: .25rem; margin: .85rem 0 0; padding: 0; list-style: none; }
.setup-steps li { display: flex; align-items: center; gap: .75rem; min-height: 2.5rem; color: var(--muted); font-size: .875rem; }
.step-marker {
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}
.setup-steps [aria-current="step"] { color: var(--text); font-weight: 600; }
.setup-steps [aria-current="step"] .step-marker { background: var(--gold); border-color: var(--gold); color: #19150d; }
.setup-steps .is-complete .step-marker { color: var(--gold); }
.setup-steps a { color: var(--muted); }
.setup-card { width: 100%; min-width: 0; line-height: 1.55; }
.setup-card h1 { margin-bottom: 1.25rem; }
.setup-card h1:has(+ .auth-card-subtitle) { margin-bottom: .4rem; }
.setup-card .auth-card-subtitle { margin-bottom: 1.5rem; }
.setup-card a:not(.btn) { color: var(--gold); }
.setup-card .text-muted { color: var(--muted) !important; }
.setup-card p { overflow-wrap: anywhere; }
.setup-card .form-group { display: block; min-width: 0; margin: 0 0 1.1rem; }
.setup-card label, .setup-card legend { margin-bottom: .4rem; color: var(--text); font-size: .875rem; font-weight: 500; }
.setup-card .form-control {
    min-height: 2.85rem;
    height: auto;
    padding: .55rem .75rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: var(--input);
    color: var(--text);
    font-size: 1rem;
}
.setup-card .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 .15rem #dfb96325; }
.setup-card .form-control::placeholder, .setup-card .form-control[readonly] { color: var(--muted); }
.setup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .875rem; }
.setup-key { display: flex; gap: .5rem; align-items: stretch; margin-bottom: .3rem; }
.setup-key .form-control { min-width: 0; }
.setup-key button { flex-shrink: 0; }
.setup-card .installer-mode-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    align-items: baseline;
    gap: .4rem .55rem;
    border: 1px solid var(--line);
    border-radius: .65rem;
    padding: .85rem;
    margin: 0;
    background: var(--input);
    cursor: pointer;
}
.installer-mode-card input { accent-color: var(--gold); }
.setup-card .installer-mode-card:is(:hover, :focus-within, .selected) { border-color: var(--gold); }
.installer-mode-title { font-weight: 600; }
.installer-mode-description { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; font-weight: 400; }
.setup-checks, .setup-summary { margin: 0; padding: 0; list-style: none; }
.setup-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.setup-checks li, .setup-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 0;
    border-top: 1px solid var(--line);
    font-size: .9rem;
}
.setup-checks small { display: block; color: var(--muted); font-size: .72rem; }
.check-state { color: #8bd5ad; font-size: .8rem; }
.check-missing { color: #f5aaaa; }
.setup-subheading { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .65rem; }
.setup-summary dt { color: var(--muted); font-weight: 400; }
.setup-summary dd { margin: 0; max-width: 60%; text-align: right; overflow-wrap: anywhere; }
.setup-actions { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.setup-actions #next:only-child { margin-left: auto; }
.setup-card .btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .55rem;
    min-height: 2.75rem;
    padding: .55rem .95rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 600;
    white-space: normal;
}
.setup-card .btn-primary, .setup-card .btn-success { border-color: var(--gold); background: var(--gold); color: #20190c; }
.setup-card :is(.btn-primary, .btn-success):hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.setup-card .btn-outline-secondary, .setup-card .btn-dark { border-color: #52545a; background: var(--input); color: var(--text); }
.setup-card :is(.btn-outline-secondary, .btn-dark):hover { border-color: var(--gold); }
.setup-card .btn:focus-visible { box-shadow: none; outline: 2px solid var(--gold); outline-offset: 3px; }
.setup-card .alert, #errormsg:not(:empty) { border-radius: .55rem; padding: .8rem 1rem; font-size: .875rem; }
.setup-card .alert-danger { background: #392024; border-color: #774047; color: #ffbcbe; }
.setup-card .alert-success { background: #172c24; border-color: #355d4a; color: #a6e3be; }
.setup-card .alert-info, .setup-card .alert-warning { background: #302a1e; border-color: #655439; color: #ecd39c; }
.setup-card .progress { background: var(--input); border-radius: .4rem; }
#installation-progress { background: var(--gold) !important; color: #20190c; font-weight: 600; }
#errormsg:not(:empty), .loader { margin-top: .8rem; }
.setup-card code { color: var(--gold-hover); }

@media (max-width: 800px) {
    .setup-shell { grid-template-columns: 1fr; align-content: center; gap: 1.5rem; max-width: 43rem; padding: 1.5rem 1rem; }
    .setup-brand { max-width: none; display: grid; grid-template-columns: 5.5rem 1fr; align-items: center; gap: .5rem 1rem; }
    .setup-identity { padding: 0; border: 0; }
    .setup-brand nav { grid-column: 1 / -1; }
    .setup-steps { display: flex; justify-content: space-between; gap: .4rem; margin: 0; }
    .setup-steps li { flex: 1; flex-direction: column; gap: .3rem; text-align: center; font-size: .75rem; line-height: 1.3; }
    .setup-card { padding: 1.5rem; }
}
@media (max-width: 520px) {
    .setup-checks { grid-template-columns: 1fr; }
    .setup-fields { grid-template-columns: 1fr; }
    .installer-mode-card + .installer-mode-card { margin-top: .45rem; }
    .setup-key { flex-wrap: wrap; }
    .setup-actions { flex-wrap: wrap; }
    .setup-card { padding: 1.25rem; }
}
