.login-page {
    min-height: 100vh;
    padding: 0;
    background:
        radial-gradient(circle at top left, rgba(47, 107, 103, 0.12), transparent 22%),
        radial-gradient(circle at top right, rgba(58, 109, 168, 0.12), transparent 18%),
        linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.legacy-login {
    min-height: 100vh;
}

.legacy-login-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.44);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.legacy-login-theme-slot {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
}

.legacy-login-theme-button {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #173853;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.legacy-login-theme-button:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(70, 123, 121, 0.22);
}

.legacy-login-theme-button .ui-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.legacy-login-theme-button [data-theme-icon] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.legacy-login-theme-button [data-theme-icon].is-hidden {
    display: none;
}

.legacy-login-hero,
.legacy-login-panel {
    min-height: 100%;
}

.legacy-login-hero {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 37, 52, 0.96), rgba(25, 74, 75, 0.9)),
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 24%);
}

.legacy-login-hero-bg,
.legacy-login-hero-overlay,
.legacy-login-hero-art {
    position: absolute;
    inset: 0;
}

.legacy-login-hero-bg {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 26%),
        radial-gradient(circle at bottom left, rgba(198, 138, 59, 0.24), transparent 28%);
}

.legacy-login-hero-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.12));
}

.legacy-login-hero-art {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    opacity: 0.3;
    pointer-events: none;
}

.legacy-login-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.legacy-login-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: 36px 52px 44px;
}

.legacy-login-brand,
.legacy-login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legacy-login-logo,
.legacy-login-mobile-mark {
    width: 88px;
}

.legacy-login-mobile-brand {
    display: none;
    margin-bottom: 24px;
}

.legacy-login-copy {
    display: grid;
    gap: 8px;
    max-width: 520px;
    margin-top: -108px;
}

.legacy-login-slogan {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.legacy-login-title {
    margin: 14px 0 0;
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.legacy-login-text {
    margin: 18px 0 0;
    max-width: 460px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.84);
}

.legacy-login-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.legacy-login-hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.legacy-login-hero-pill-soft {
    color: #fff4de;
    background: rgba(198, 138, 59, 0.18);
    border-color: rgba(198, 138, 59, 0.24);
}

.legacy-login-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.legacy-login-hero-stat {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.legacy-login-hero-stat small,
.legacy-login-hero-stat strong {
    display: block;
}

.legacy-login-hero-stat small {
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.legacy-login-hero-stat strong {
    font-size: 0.94rem;
}

.legacy-login-footer {
    display: grid;
    gap: 6px;
}

.legacy-login-footer-name,
.legacy-login-footer-copy,
.legacy-login-mobile-kicker,
.legacy-login-mobile-copy,
.legacy-login-name,
.legacy-login-heading,
.legacy-login-subtitle {
    margin: 0;
}

.legacy-login-footer-name {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.legacy-login-footer-copy {
    color: rgba(255, 255, 255, 0.74);
}

.legacy-login-panel {
    flex: 1 1 420px;
    max-width: 500px;
    display: flex;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 252, 0.98));
}

.legacy-login-panel-inner {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 44px 38px;
}

.legacy-login-mobile-kicker,
.legacy-login-mobile-copy,
.legacy-login-subtitle,
.legacy-login-helper,
.legacy-checklist-item,
.legacy-reentry-lock-copy,
.legacy-reentry-lock-contact {
    color: var(--muted);
}

.legacy-login-name {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--info);
}

.legacy-password-field {
    position: relative;
}

.legacy-password-field input {
    padding-right: 3rem;
}

.legacy-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: transparent;
    color: #5b6b7a;
    cursor: pointer;
}

.legacy-password-toggle:hover {
    color: #173853;
}

.legacy-password-toggle .is-hidden {
    display: none;
}

.legacy-login-heading {
    margin-top: 12px;
    font-size: 2.15rem;
    letter-spacing: -0.03em;
}

.legacy-login-heading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.legacy-login-heading-row .legacy-login-heading {
    margin-top: 0;
}

.legacy-login-period-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #eef8f6 0%, #e4f3ee 100%);
    border: 1px solid #cbe5dd;
    color: #2f7d5a;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.legacy-login-period-pill.is-hidden {
    display: none;
}

.legacy-login-subtitle {
    margin-top: 8px;
    max-width: 560px;
    line-height: 1.6;
}

.legacy-login-panel-note {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(58, 109, 168, 0.08), transparent 24%),
        linear-gradient(180deg, #f9fbfd 0%, #f2f6fb 100%);
}

.legacy-login-panel-note-label {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--info);
}

.legacy-login-panel-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.legacy-login-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #f5f8fb 0%, #eef3f8 100%);
}

.legacy-login-pill {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
}

.legacy-login-pill.is-active {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    color: var(--text);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.legacy-auth-flash-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30;
    width: calc(100vw - 32px);
    max-width: 360px;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.legacy-auth-flash {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.94rem;
    border: 1px solid rgba(47, 107, 103, 0.12);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 32px rgba(23, 33, 43, 0.14);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.legacy-auth-flash-success {
    color: var(--success);
}

.legacy-auth-flash-error {
    color: var(--danger);
}

.legacy-auth-panels {
    margin-top: 22px;
}

.legacy-auth-pane {
    display: none;
}

.legacy-auth-pane.is-active {
    display: block;
}

.legacy-login-form,
.legacy-reentry-form {
    display: grid;
    gap: 18px;
}

.legacy-auth-grid {
    display: grid;
    gap: 16px;
}

.legacy-auth-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legacy-login-field {
    position: relative;
    display: grid;
    gap: 8px;
}

.legacy-login-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.legacy-login-helper {
    font-size: 0.92rem;
}

.legacy-login-link-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

.legacy-login-link {
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.legacy-login-link:hover {
    color: var(--info);
}

.legacy-login-submit {
    width: 100%;
}

.legacy-checklist {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: 100%;
    display: none;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(47, 107, 103, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 32px rgba(23, 33, 43, 0.14);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.legacy-checklist.is-visible {
    display: grid;
}

.legacy-checklist-item {
    position: relative;
    padding-left: 14px;
    font-size: 0.88rem;
}

.legacy-checklist-item::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}

.legacy-checklist-item.is-valid {
    color: var(--success);
}

.legacy-conditional-field.is-hidden {
    display: none;
}

.legacy-reentry-shell {
    display: grid;
    gap: 18px;
}

.legacy-reentry-lock-card {
    padding: 22px;
    border: 1px solid #e6dac1;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(198, 138, 59, 0.12), transparent 22%),
        linear-gradient(180deg, #fffdfa 0%, #fff7ea 100%);
}

.legacy-reentry-lock-icon,
.legacy-reentry-lock-title {
    margin: 0;
}

.legacy-reentry-lock-icon {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.legacy-reentry-lock-title {
    margin-top: 6px;
    font-size: 1.2rem;
    color: #5f3d11;
}

.legacy-reentry-lock-copy,
.legacy-reentry-lock-contact {
    margin-top: 10px;
    line-height: 1.6;
}

.auth-standalone-panel {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .legacy-login-shell {
        background: rgba(255, 255, 255, 0.92);
    }

    .legacy-login-theme-button,
    .legacy-login-hero-pill,
    .legacy-login-hero-stat,
    .legacy-auth-flash,
    .legacy-checklist {
        background: rgba(255, 255, 255, 0.97);
    }

    .legacy-login-hero-pill,
    .legacy-login-hero-stat {
        background: rgba(255, 255, 255, 0.18);
    }
}

.auth-standalone-actions {
    display: grid;
    gap: 12px;
}

.auth-standalone-actions .button {
    width: 100%;
}

html.dark .login-page {
    background:
        radial-gradient(circle at top left, rgba(70, 123, 121, 0.16), transparent 22%),
        radial-gradient(circle at top right, rgba(58, 109, 168, 0.14), transparent 18%),
        linear-gradient(180deg, #0d1720 0%, #121f29 100%);
}

html.dark .legacy-login-shell {
    background: rgba(12, 20, 28, 0.42);
}

html.dark .legacy-login-theme-button {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.34);
    color: #e5eef7;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

html.dark .legacy-login-hero {
    background:
        linear-gradient(135deg, rgba(10, 22, 33, 0.98), rgba(21, 60, 61, 0.94)),
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 24%);
}

html.dark .legacy-login-hero-bg {
    background:
        radial-gradient(circle at top right, rgba(126, 177, 234, 0.12), transparent 26%),
        radial-gradient(circle at bottom left, rgba(198, 138, 59, 0.14), transparent 28%);
}

html.dark .legacy-login-hero-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.18));
}

html.dark .legacy-login-panel {
    background:
        linear-gradient(180deg, rgba(18, 31, 41, 0.96), rgba(14, 24, 33, 0.98));
}

html.dark .legacy-login-name,
html.dark .legacy-login-heading,
html.dark .legacy-login-field label {
    color: #f5f8fb;
}

html.dark .legacy-login-period-pill {
    background: linear-gradient(180deg, rgba(49, 102, 89, 0.24), rgba(42, 87, 76, 0.18));
    border-color: rgba(101, 166, 146, 0.22);
    color: #9fd3c1;
}

html.dark .legacy-login-mobile-kicker,
html.dark .legacy-login-mobile-copy,
html.dark .legacy-login-subtitle,
html.dark .legacy-login-helper,
html.dark .legacy-checklist-item,
html.dark .legacy-reentry-lock-copy,
html.dark .legacy-reentry-lock-contact {
    color: #9eb0c0;
}

html.dark .legacy-login-switch {
    border-color: rgba(64, 84, 102, 0.88);
    background: linear-gradient(180deg, rgba(25, 39, 51, 0.98), rgba(21, 33, 44, 0.98));
}

html.dark .legacy-login-pill {
    color: #8ea0af;
}

html.dark .legacy-login-pill.is-active {
    background: linear-gradient(180deg, rgba(36, 55, 71, 0.98), rgba(28, 43, 57, 0.98));
    color: #f5f8fb;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

html.dark .legacy-login-link {
    color: #9fd3c1;
}

html.dark .legacy-login-link:hover {
    color: #b6e4d5;
}

html.dark .legacy-login-panel .form-control,
html.dark .legacy-login-panel .form-select,
html.dark .legacy-login-panel input,
html.dark .legacy-login-panel select,
html.dark .legacy-login-panel textarea {
    background: rgba(17, 29, 39, 0.92);
    border-color: rgba(64, 84, 102, 0.88);
    color: #f5f8fb;
}

html.dark .legacy-login-panel .form-control::placeholder,
html.dark .legacy-login-panel input::placeholder,
html.dark .legacy-login-panel textarea::placeholder {
    color: #8092a1;
}

html.dark .legacy-auth-flash {
    border-color: rgba(64, 84, 102, 0.88);
    background: rgba(18, 31, 41, 0.96);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

html.dark .legacy-checklist {
    border-color: rgba(64, 84, 102, 0.88);
    background: rgba(18, 31, 41, 0.98);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

html.dark .legacy-reentry-lock-card {
    border-color: rgba(116, 88, 38, 0.6);
    background:
        radial-gradient(circle at top right, rgba(198, 138, 59, 0.14), transparent 22%),
        linear-gradient(180deg, rgba(47, 35, 18, 0.98), rgba(35, 27, 16, 0.98));
}

html.dark .legacy-reentry-lock-title {
    color: #f8e0b5;
}

@media (max-width: 1080px) {
    .legacy-login-shell {
        width: 100%;
        display: block;
    }

    .legacy-login-hero {
        min-height: 320px;
    }

    .legacy-login-hero-content {
        padding: 36px;
    }

    .legacy-login-hero-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .legacy-login-hero {
        display: none;
    }

    .legacy-login-mobile-brand {
        display: flex;
    }

    .legacy-login-panel-inner {
        width: 100%;
        padding: 28px 20px;
    }

    .legacy-auth-grid-two,
    .legacy-login-switch {
        grid-template-columns: 1fr;
    }

    .legacy-login-switch {
        display: grid;
    }

    .legacy-login-pill {
        width: 100%;
    }
}
