.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 {
    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: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 5px;
    border: 1px solid rgba(70, 123, 121, 0.24);
    border-radius: 16px;
    background:
        radial-gradient(circle at top left, rgba(70, 123, 121, 0.08), transparent 34%),
        linear-gradient(180deg, #f7fbfa 0%, #edf4f6 100%);
    box-shadow: 0 12px 26px rgba(28, 43, 46, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.legacy-login-pill {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.legacy-login-pill:hover {
    background: rgba(255, 255, 255, 0.62);
    color: var(--text);
}

.legacy-login-pill:active {
    transform: translateY(1px) scale(0.98);
}

.legacy-login-pill.is-active {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    color: var(--text);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.legacy-login-pill.is-panda-highlight {
    animation: pandaRegisterBounce 0.78s ease-in-out 2;
    border: 1px solid rgba(70, 123, 121, 0.32);
    background: linear-gradient(180deg, #e9fbf7 0%, #9fd3c1 100%);
    color: #173f3d;
}

.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-registration-success {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #b7dfcf;
    border-radius: 16px;
    background: linear-gradient(180deg, #f0fbf7 0%, #e7f6ef 100%);
    color: #214f3f;
}

.legacy-registration-success strong,
.legacy-registration-success p {
    margin: 0;
}

.legacy-registration-success strong {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.legacy-registration-success p {
    line-height: 1.5;
}

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

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

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

.legacy-login-panda-chat {
    position: fixed;
    z-index: 60;
    display: grid;
    grid-template-columns: 64px minmax(0, 260px);
    align-items: end;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 24px);
    touch-action: none;
    user-select: none;
}

.legacy-login-panda-chat.is-hidden {
    display: none;
}

.legacy-login-panda-close {
    position: absolute;
    top: -14px;
    left: -8px;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    background: #ffffff;
    color: #34515f;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
}

.legacy-login-panda-close:hover {
    background: #eef8f6;
}

.legacy-login-panda-handle {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(47, 107, 103, 0.18);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f5faf9 100%);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    cursor: grab;
}

.legacy-login-panda-handle:active {
    cursor: grabbing;
}

.legacy-login-panda-handle img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.legacy-login-panda-teaser {
    align-self: center;
    justify-self: start;
    max-width: 230px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(47, 107, 103, 0.14);
    border-radius: 999px;
    background: #ffffff;
    color: #34515f;
    font-size: 0.86rem;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
    cursor: pointer;
    animation: pandaTeaserPulse 2.4s ease-in-out infinite;
}

.legacy-login-panda-teaser:hover {
    background: #eef8f6;
}

.legacy-login-panda-dialog {
    position: absolute;
    left: 74px;
    bottom: 0;
    width: min(340px, calc(100vw - 112px));
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(47, 107, 103, 0.14);
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(70, 123, 121, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f5faf9 100%);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    max-height: min(220px, calc(100vh - 120px));
    overflow: auto;
}

.legacy-login-panda-dialog[hidden],
.legacy-login-panda-chat.is-open .legacy-login-panda-teaser {
    display: none;
}

.legacy-login-panda-chat.is-open {
    width: min(440px, calc(100vw - 32px));
}

.legacy-login-panda-dialog p {
    margin: 0;
    color: #34515f;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.45;
}

.legacy-login-panda-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.legacy-login-panda-actions button {
    width: 100%;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(47, 107, 103, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: #2f6b67;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.legacy-login-panda-actions button:hover {
    transform: translateY(-1px);
    background: #eef8f6;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.legacy-login-panda-actions button:active {
    transform: translateY(1px) scale(0.98);
}

.legacy-login-tutorial-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
}

.legacy-login-tutorial-modal[hidden] {
    display: none;
}

.legacy-login-tutorial-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.legacy-login-tutorial-card {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100vw - 40px));
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.34);
    overflow: hidden;
}

.legacy-login-tutorial-card video {
    display: block;
    width: 100%;
    max-height: min(78vh, 720px);
    background: #000000;
}

.legacy-login-tutorial-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}

@keyframes pandaTeaserPulse {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

@keyframes pandaRegisterBounce {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    35% {
        transform: translateY(-7px) scale(1.04);
        box-shadow: 0 16px 26px rgba(70, 123, 121, 0.24);
    }
    65% {
        transform: translateY(0) scale(0.98);
    }
}

.legacy-login-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-terms-row {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.35;
    padding: 10px 12px;
    border: 1px solid rgba(70, 123, 121, 0.18);
    border-radius: 12px;
    background: rgba(247, 251, 250, 0.82);
}

.legacy-terms-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.legacy-terms-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: left;
}

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

.legacy-terms-modal[hidden] {
    display: none;
}

.legacy-terms-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
}

.legacy-terms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.legacy-terms-modal-card {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: 24px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    color: #334155;
    line-height: 1.55;
}

.legacy-terms-modal-card h3 {
    margin: 0 28px 12px 0;
    font-size: 1.12rem;
}

.legacy-terms-modal-card p {
    margin: 0 0 10px;
}

.legacy-terms-modal-card p:last-child {
    margin-bottom: 0;
}

.legacy-terms-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #eef4f5;
    color: #173853;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.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;
}

.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 {
    color: #9eb0c0;
}

html.dark .legacy-login-switch {
    border-color: rgba(158, 198, 214, 0.22);
    background:
        radial-gradient(circle at top left, rgba(120, 185, 173, 0.1), transparent 34%),
        linear-gradient(180deg, rgba(27, 41, 48, 0.98), rgba(18, 29, 34, 0.98));
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

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

html.dark .legacy-login-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f2f7f5;
}

html.dark .legacy-login-pill.is-active {
    background: linear-gradient(180deg, rgba(39, 59, 68, 0.98), rgba(28, 43, 50, 0.98));
    color: #f5f8fb;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(158, 198, 214, 0.1);
}

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-registration-success {
    border-color: rgba(106, 178, 142, 0.34);
    background: linear-gradient(180deg, rgba(31, 69, 56, 0.96), rgba(22, 52, 43, 0.96));
    color: #ccefe0;
}

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-login-panda-chat {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

html.dark .legacy-login-panda-close {
    border-color: rgba(101, 166, 146, 0.24);
    background: rgba(17, 29, 39, 0.94);
    color: #d7e4ed;
}

html.dark .legacy-login-panda-handle {
    border-color: rgba(64, 84, 102, 0.88);
    background:
        radial-gradient(circle at top left, rgba(70, 123, 121, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(25, 39, 51, 0.98), rgba(19, 32, 43, 0.98));
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

html.dark .legacy-login-panda-dialog {
    border-color: rgba(64, 84, 102, 0.88);
    background:
        radial-gradient(circle at top left, rgba(70, 123, 121, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(25, 39, 51, 0.98), rgba(19, 32, 43, 0.98));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

html.dark .legacy-login-panda-teaser {
    border-color: rgba(101, 166, 146, 0.24);
    background: rgba(17, 29, 39, 0.94);
    color: #d7e4ed;
}

html.dark .legacy-login-panda-dialog p {
    color: #d7e4ed;
}

html.dark .legacy-login-panda-actions button {
    border-color: rgba(101, 166, 146, 0.24);
    background: rgba(17, 29, 39, 0.92);
    color: #9fd3c1;
}

html.dark .legacy-login-panda-actions button:hover {
    background: rgba(42, 87, 76, 0.38);
}

@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) {
    .login-page {
        min-height: 100dvh;
        overflow-x: hidden;
    }

    .legacy-login-hero {
        display: none;
    }

    .legacy-login,
    .legacy-login-shell,
    .legacy-login-panel {
        min-height: 100dvh;
    }

    .legacy-login-panel {
        align-items: flex-start;
    }

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

    .legacy-login-panel-inner {
        width: 100%;
        max-width: 100%;
        padding: 72px 16px 34px;
        box-sizing: border-box;
    }

    .legacy-login-theme-slot {
        top: 14px;
        right: 14px;
    }

    .legacy-login-heading-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .legacy-login-heading {
        font-size: 1.72rem;
    }

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

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

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

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

    .legacy-login-panda-chat {
        grid-template-columns: 54px minmax(0, 1fr);
        width: min(330px, calc(100vw - 24px));
    }

    .legacy-login-panda-handle {
        width: 54px;
        height: 54px;
    }

    .legacy-login-panda-handle img {
        width: 54px;
        height: 54px;
    }
}

@media (max-width: 420px) {
    .legacy-login-panel-inner {
        padding-left: 12px;
        padding-right: 12px;
    }

    .legacy-login-panda-chat {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        width: calc(100vw - 24px);
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .legacy-login-panda-handle,
    .legacy-login-panda-handle img {
        width: 48px;
        height: 48px;
    }
}

.legacy-login-shell :where(
    .legacy-login-panel,
    .legacy-login-panel-inner,
    .legacy-login-card,
    .legacy-login-pill,
    .legacy-auth-flash,
    .legacy-checklist,
    .form-control,
    .form-select,
    input,
    select,
    textarea,
    .button-light
) {
    border-color: var(--border) !important;
}
