:root {
    --auth-safe: #54d98c;
    --auth-safe-soft: rgba(84, 217, 140, .10);
    --auth-warning: #f2bb4f;
    --auth-warning-soft: rgba(242, 187, 79, .10);
    --auth-info: #75b9ff;
    --auth-info-soft: rgba(117, 185, 255, .10);
}

body.auth-guided {
    background: var(--auth-page);
}

.auth-guided .auth-page {
    padding: 20px;
}

.auth-guided .auth-shell {
    width: min(1240px, 100%);
    overflow: visible;
    border-radius: 12px;
    background: var(--auth-surface);
    box-shadow: none;
}

.auth-guided .auth-header {
    min-height: 68px;
    padding: 12px 28px;
}

.auth-guided .auth-brand {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -.015em;
}

.auth-header-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 650;
}

.auth-header-status i {
    color: var(--auth-safe);
    font-size: 17px;
}

.auth-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.auth-header-actions .theme-palette-switcher {
    position: relative;
    inset: auto;
    z-index: 20;
}

.auth-header-actions .theme-palette-toggle {
    min-height: 38px;
    border-radius: 8px;
}

.auth-guided .auth-header-link {
    font-size: 13px;
}

.auth-guided .auth-body {
    min-height: 620px;
    grid-template-columns: minmax(0, .92fr) minmax(500px, 1.08fr);
}

.auth-guided .auth-intro {
    justify-content: flex-start;
    padding: 38px 38px 34px;
    background: var(--auth-surface);
}

.auth-guided .auth-intro-heading {
    margin-bottom: 12px;
    font-size: clamp(30px, 3vw, 40px);
    line-height: 1.14;
}

.auth-guided .auth-intro-copy {
    max-width: 520px;
    font-size: 15px;
    line-height: 1.65;
}

.auth-guided .auth-form-panel {
    align-items: flex-start;
    padding: 36px 42px 32px;
    background: var(--auth-panel);
}

.auth-guided .auth-form {
    max-width: 620px;
}

.auth-guided .auth-title {
    font-size: 34px;
}

.auth-guided .auth-subtitle {
    margin: 7px 0 24px;
}

.auth-guide,
.auth-steps,
.auth-security-rules {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--auth-border);
}

.auth-guide-title,
.auth-steps-title,
.auth-security-title {
    margin: 0 0 15px;
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 800;
}

.auth-guide-list,
.auth-security-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-guide-item,
.auth-security-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.auth-guide-icon,
.auth-security-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--guide-color, var(--auth-info)) 52%, var(--auth-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--guide-color, var(--auth-info)) 10%, transparent);
    color: var(--guide-color, var(--auth-info));
    font-size: 20px;
}

.auth-guide-item strong,
.auth-security-item strong {
    display: block;
    margin: 1px 0 3px;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 1.35;
}

.auth-guide-item p,
.auth-security-item p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

.auth-guide-item--safe,
.auth-security-item--safe { --guide-color: var(--auth-safe); }
.auth-guide-item--warning,
.auth-security-item--warning { --guide-color: var(--auth-warning); }
.auth-guide-item--info,
.auth-security-item--info { --guide-color: var(--auth-info); }

.auth-security-status {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    margin-top: 22px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--auth-safe) 36%, var(--auth-border));
    border-radius: 10px;
    background: var(--auth-safe-soft);
}

.auth-security-status > i {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    color: var(--auth-safe);
    font-size: 34px;
}

.auth-security-status strong {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
}

.auth-security-status p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 12px;
}

.auth-security-badge {
    padding: 5px 8px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--auth-safe) 17%, transparent);
    color: var(--auth-safe);
    font-size: 11px;
    font-weight: 800;
}

.auth-steps-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.auth-steps-list::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 16%;
    right: 16%;
    height: 1px;
    background: var(--auth-border-strong);
}

.auth-step {
    position: relative;
    z-index: 1;
    min-width: 0;
    text-align: center;
}

.auth-step-number {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin: 0 auto 9px;
    border: 2px solid var(--auth-accent);
    border-radius: 50%;
    background: var(--auth-surface);
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 850;
}

.auth-step strong {
    display: block;
    color: var(--auth-text);
    font-size: 12px;
    line-height: 1.35;
}

.auth-step span:last-child {
    display: block;
    margin-top: 3px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.35;
}

.auth-guided .auth-field {
    margin-bottom: 15px;
}

.auth-guided .auth-field-grid {
    gap: 14px;
}

.auth-guided .auth-recovery-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
    padding: 5px;
    border: 1px solid rgba(125, 171, 219, .3);
    border-radius: 10px;
    background: rgba(4, 18, 38, .48);
}

.auth-guided .auth-recovery-switch__item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #a9c0dc;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.auth-guided .auth-recovery-switch__item:hover {
    color: #e7f4ff;
    background: rgba(73, 151, 226, .16);
    text-decoration: none;
}

.auth-guided .auth-recovery-switch__item.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 128, 219, .88), rgba(31, 103, 186, .88));
    box-shadow: 0 5px 14px rgba(2, 21, 47, .32);
}

.auth-guided .auth-control {
    height: 48px;
    background: var(--auth-control);
}

.auth-password-feedback {
    margin: -2px 0 15px;
}

.auth-password-feedback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--auth-muted);
    font-size: 12px;
}

.auth-password-feedback-head strong {
    color: var(--auth-text);
    font-weight: 750;
}

.auth-password-meter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.auth-password-meter span {
    height: 4px;
    border-radius: 99px;
    background: var(--auth-border);
}

.auth-password-feedback[data-strength="1"] .auth-password-meter span:nth-child(1) {
    background: #ef6b79;
}

.auth-password-feedback[data-strength="2"] .auth-password-meter span:nth-child(-n+2) {
    background: var(--auth-warning);
}

.auth-password-feedback[data-strength="3"] .auth-password-meter span:nth-child(-n+3),
.auth-password-feedback[data-strength="4"] .auth-password-meter span {
    background: var(--auth-safe);
}

.auth-password-hint {
    display: block;
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-match-state {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 20px;
    margin: -7px 0 12px;
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-match-state[data-state="empty"] {
    visibility: hidden;
}

.auth-match-state[data-state="match"] {
    color: var(--auth-safe);
}

.auth-match-state[data-state="mismatch"] {
    color: #f28b98;
}

.auth-security-callout {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin: 0 0 15px;
    padding: 11px 13px;
    border: 1px solid color-mix(in srgb, var(--callout-color, var(--auth-safe)) 30%, var(--auth-border));
    border-radius: 9px;
    background: color-mix(in srgb, var(--callout-color, var(--auth-safe)) 7%, transparent);
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.45;
}

.auth-security-callout > i {
    color: var(--callout-color, var(--auth-safe));
    font-size: 21px;
    text-align: center;
}

.auth-security-callout--warning {
    --callout-color: var(--auth-warning);
}

.auth-guided .auth-submit {
    min-height: 50px;
    border-radius: 9px;
}

.auth-submit + .auth-security-callout {
    margin-top: 14px;
}

.auth-legal-footer {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 28px;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-muted);
    font-size: 11px;
}

.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 18px;
}

.auth-legal-links a {
    color: var(--auth-muted);
}

.auth-legal-links a:hover {
    color: var(--auth-accent);
}

.auth-guided--login .auth-form-panel,
.auth-guided--forgot .auth-form-panel {
    padding-top: 48px;
}

.auth-guided--login .auth-form {
    max-width: 640px;
}

.auth-guided--forgot .auth-body {
    grid-template-columns: minmax(0, .95fr) minmax(510px, 1.05fr);
}

@media (max-width: 980px) {
    .auth-guided .auth-page {
        align-items: start;
        padding: 14px;
    }

    .auth-guided .auth-shell {
        max-width: 720px;
    }

    .auth-header-status {
        display: none;
    }

    .auth-guided .auth-body,
    .auth-guided--forgot .auth-body {
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-areas:
            "form"
            "intro";
    }

    .auth-guided .auth-intro {
        border-top: 1px solid var(--auth-border);
        border-right: 0;
    }

    .auth-guided .auth-form-panel,
    .auth-guided--login .auth-form-panel,
    .auth-guided--forgot .auth-form-panel {
        padding: 32px 30px;
    }
}

@media (max-width: 620px) {
    .auth-guided .auth-page {
        padding: 0;
    }

    .auth-guided .auth-shell {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .auth-guided .auth-header {
        min-height: 60px;
        padding: 10px 16px;
    }

    .auth-header-actions {
        gap: 8px;
    }

    .auth-header-actions .theme-palette-toggle-label,
    .auth-header-actions .theme-palette-current-swatch {
        display: none;
    }

    .auth-header-actions .theme-palette-toggle {
        width: 38px;
        min-width: 38px;
        padding: 0;
        justify-content: center;
    }

    .auth-guided .auth-form-panel,
    .auth-guided--login .auth-form-panel,
    .auth-guided--forgot .auth-form-panel,
    .auth-guided .auth-intro {
        padding: 26px 18px;
    }

    .auth-guided .auth-field-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-guided .auth-intro-heading {
        font-size: 27px;
    }

    .auth-steps-list {
        gap: 4px;
    }

    .auth-step span:last-child {
        display: none;
    }

    .auth-security-status {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .auth-security-badge {
        display: none;
    }

    .auth-legal-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 18px;
    }

    .auth-legal-links {
        justify-content: flex-start;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-guided *,
    .auth-guided *::before,
    .auth-guided *::after {
        transition: none !important;
    }
}

@media (max-width: 575.98px) {
    .auth-guided .auth-recovery-switch {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
