:root {
    color-scheme: dark;
    --bg: #070808;
    --panel: #111210;
    --panel-soft: #171815;
    --line: rgba(207, 167, 92, .19);
    --line-soft: rgba(255, 255, 255, .08);
    --gold: #d3aa5c;
    --gold-light: #edcf8e;
    --text: #f5f3ed;
    --muted: #aaa79f;
    --success: #77c697;
    --danger: #f08a80;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: clamp(18px, 3vw, 42px);
    color: var(--text);
    background:
        radial-gradient(circle at 18% 16%, rgba(194, 147, 69, .11), transparent 28%),
        radial-gradient(circle at 82% 84%, rgba(194, 147, 69, .07), transparent 30%),
        var(--bg);
}

button,
input,
textarea {
    font: inherit;
}

.installer-shell {
    width: min(1120px, 100%);
    height: min(760px, calc(100dvh - 48px));
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(320px, .82fr) minmax(520px, 1.18fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(15, 16, 14, .96);
    box-shadow: 0 32px 90px rgba(0, 0, 0, .46);
}

.brand-panel {
    min-height: 100%;
    padding: clamp(30px, 4vw, 54px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(5, 6, 5, .30), rgba(5, 6, 5, .90)),
        url("../../assets/img/login-bg.jpg") center/cover;
}

.brand-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(222, 179, 92, .08), transparent 46%);
}

.brand-top,
.brand-message,
.brand-security {
    position: relative;
    z-index: 1;
}

.brand-top,
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-top img,
.mobile-brand img {
    object-fit: contain;
}

.brand-top div,
.mobile-brand div {
    display: grid;
    gap: 3px;
}

.brand-top strong,
.mobile-brand strong {
    font-size: 17px;
    letter-spacing: -.02em;
}

.brand-top span,
.mobile-brand span {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: .03em;
}

.brand-message {
    margin: auto 0;
    max-width: 420px;
}

.eyebrow {
    display: block;
    color: var(--gold);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.brand-message h1 {
    max-width: 390px;
    margin: 17px 0 20px;
    font-size: clamp(34px, 3.4vw, 49px);
    line-height: 1.03;
    letter-spacing: -.045em;
}

.brand-message p {
    margin: 0;
    color: rgba(245, 243, 237, .70);
    font-size: 15px;
    line-height: 1.65;
}

.brand-security {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(10, 11, 10, .72);
    backdrop-filter: blur(12px);
}

.security-icon {
    width: 34px;
    height: 34px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(211, 170, 92, .4);
    border-radius: 11px;
    color: var(--gold-light);
    background: rgba(211, 170, 92, .12);
    font-weight: 800;
}

.brand-security div {
    display: grid;
    gap: 3px;
}

.brand-security strong {
    font-size: 13px;
}

.brand-security span:last-child {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.content-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 88% 8%, rgba(211, 170, 92, .08), transparent 24%),
        var(--panel);
}

.mobile-brand {
    display: none;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 0;
    padding: 29px clamp(28px, 4vw, 52px) 21px;
    list-style: none;
    border-bottom: 1px solid var(--line-soft);
}

.steps li {
    min-width: 0;
    display: flex;
    gap: 9px;
    align-items: center;
    position: relative;
    color: #6f706b;
}

.steps li:not(:last-child)::after {
    content: "";
    width: calc(100% - 42px);
    height: 1px;
    position: absolute;
    left: 35px;
    top: 13px;
    background: var(--line-soft);
}

.steps li.done:not(:last-child)::after {
    background: rgba(211, 170, 92, .42);
}

.step-number {
    width: 27px;
    height: 27px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    position: relative;
    z-index: 1;
    border: 1px solid var(--line-soft);
    border-radius: 50%;
    background: var(--panel);
    font-size: 11px;
    font-weight: 800;
}

.step-label {
    position: relative;
    z-index: 1;
    padding-right: 9px;
    background: var(--panel);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.steps li.active {
    color: var(--gold-light);
}

.steps li.active .step-number {
    border-color: var(--gold);
    color: #0d0e0c;
    background: var(--gold);
}

.steps li.done {
    color: var(--muted);
}

.steps li.done .step-number {
    border-color: rgba(211, 170, 92, .5);
    color: var(--gold-light);
}

.content-scroll {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: clamp(22px, 2.7vw, 32px) clamp(28px, 4vw, 52px);
}

.section-heading {
    max-width: 570px;
    margin-bottom: 22px;
}

.section-heading h2,
.completion h2 {
    margin: 10px 0 9px;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.12;
    letter-spacing: -.035em;
}

.section-heading p,
.completion > p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.requirements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.requirement {
    min-height: 56px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, .018);
}

.requirement-state {
    width: 26px;
    height: 26px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 850;
}

.requirement.ok .requirement-state {
    color: var(--success);
    background: rgba(119, 198, 151, .12);
}

.requirement.fail .requirement-state {
    color: var(--danger);
    background: rgba(240, 138, 128, .12);
}

.requirement div {
    display: grid;
    gap: 4px;
}

.requirement strong {
    font-size: 12px;
}

.requirement div span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.alert {
    display: grid;
    gap: 4px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.45;
}

.alert strong {
    font-size: 12px;
}

.alert-error {
    border-color: rgba(240, 138, 128, .26);
    color: #f2c2bd;
    background: rgba(240, 138, 128, .08);
}

.alert-success {
    border-color: rgba(119, 198, 151, .26);
    color: #b9dfc8;
    background: rgba(119, 198, 151, .08);
}

.help-note,
.safety-message {
    margin-top: 18px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--muted);
    background: rgba(211, 170, 92, .045);
    font-size: 11px;
    line-height: 1.55;
}

.installer-form {
    display: grid;
    gap: 22px;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

legend {
    width: 100%;
    margin-bottom: 13px;
    color: var(--gold-light);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

label {
    min-width: 0;
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

label.wide {
    grid-column: 1 / -1;
}

label small,
.read-only-domain small {
    color: #777973;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.4;
}

input,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, .035);
    transition: border-color .16s ease, box-shadow .16s ease;
}

input {
    height: 43px;
    padding: 0 13px;
}

textarea {
    min-height: 72px;
    resize: vertical;
    padding: 12px 13px;
    line-height: 1.45;
}

input:focus,
textarea:focus {
    border-color: rgba(211, 170, 92, .65);
    box-shadow: 0 0 0 3px rgba(211, 170, 92, .09);
}

.field-error {
    color: var(--danger);
    font-size: 9px;
    font-weight: 600;
}

.read-only-domain {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    margin-bottom: 13px;
    padding: 13px 15px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
}

.read-only-domain span {
    color: var(--muted);
    font-size: 10px;
}

.read-only-domain strong {
    justify-self: end;
    color: var(--gold-light);
    font-size: 11px;
}

.read-only-domain small {
    grid-column: 1 / -1;
}

.primary-action,
.secondary-action {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}

.primary-action {
    color: #12130f;
    background: linear-gradient(135deg, #e0bd76, #c69745);
    box-shadow: 0 10px 28px rgba(198, 151, 69, .14);
}

.secondary-action {
    border-color: var(--line-soft);
    color: var(--text);
    background: rgba(255, 255, 255, .025);
}

.primary-action:hover,
.secondary-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.installer-form > .primary-action {
    justify-self: end;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--line-soft);
}

.summary-card > div {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 16px;
    background: var(--panel-soft);
}

.summary-card span,
.completion-details span {
    color: var(--muted);
    font-size: 10px;
}

.summary-card strong,
.completion-details strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.safety-message strong {
    display: block;
    margin-bottom: 4px;
    color: var(--gold-light);
    font-size: 11px;
}

.safety-message p {
    margin: 0;
}

.action-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.completion {
    max-width: 570px;
    margin: auto;
    text-align: center;
}

.completion-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(119, 198, 151, .35);
    border-radius: 18px;
    color: var(--success);
    background: rgba(119, 198, 151, .10);
    font-size: 24px;
    font-weight: 850;
}

.completion-icon.locked {
    border-color: var(--line);
    color: var(--gold-light);
    background: rgba(211, 170, 92, .08);
}

.completion-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 28px 0;
}

.completion-details > div {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
}

.installer-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px clamp(28px, 4vw, 52px);
    border-top: 1px solid var(--line-soft);
    color: #686963;
    font-size: 9px;
}

@media (max-width: 880px) {
    body {
        height: auto;
        place-items: start center;
        overflow: auto;
        padding: 16px;
    }

    .installer-shell {
        height: auto;
        min-height: calc(100dvh - 32px);
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .brand-panel {
        display: none;
    }

    .mobile-brand {
        display: flex;
        padding: 22px 24px 17px;
        border-bottom: 1px solid var(--line-soft);
    }

    .steps {
        padding: 18px 24px;
    }

    .content-scroll {
        padding: 28px 24px;
    }
}

@media (max-width: 560px) {
    body {
        padding: 0;
        background: var(--panel);
    }

    .installer-shell {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .mobile-brand {
        padding-top: max(18px, env(safe-area-inset-top));
    }

    .mobile-brand img {
        width: 42px;
        height: 42px;
    }

    .mobile-brand strong {
        font-size: 15px;
    }

    .steps {
        padding: 15px 18px;
    }

    .step-label {
        display: none;
    }

    .steps li:not(:last-child)::after {
        width: calc(100% - 34px);
        left: 31px;
    }

    .content-scroll {
        padding: 26px 18px 34px;
    }

    .section-heading h2,
    .completion h2 {
        font-size: 26px;
    }

    .requirements,
    .form-grid,
    .summary-card,
    .completion-details {
        grid-template-columns: 1fr;
    }

    label.wide {
        grid-column: auto;
    }

    .read-only-domain {
        grid-template-columns: 1fr;
    }

    .read-only-domain strong {
        justify-self: start;
    }

    .action-row {
        display: grid;
    }

    .action-row form,
    .action-row button,
    .installer-form > .primary-action,
    .completion .primary-action {
        width: 100%;
    }

    .installer-footer {
        padding: 14px 18px max(14px, env(safe-area-inset-bottom));
    }

    .installer-footer span:last-child {
        display: none;
    }
}
