:root {
    --navy-950: #172134;
    --navy-900: #223049;
    --navy-800: #30415f;
    --orange-600: #d84a2f;
    --orange-500: #ea5a3d;
    --purple-200: #c5b0e7;
    --purple-100: #eee8f8;
    --ink: #1d293d;
    --muted: #6e7a90;
    --line: #dfe5ee;
    --surface: #ffffff;
    --background: #f6f7fb;
    --danger: #b42318;
    --success: #067647;
    --warning: #a15c00;
    --shadow: 0 28px 80px rgba(29, 41, 61, 0.16);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: light;
}

body {
    min-width: 320px;
    min-height: 100vh;
    background: var(--navy-950);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(390px, 0.9fr) minmax(520px, 1.1fr);
    min-height: 100vh;
}

.brand-panel {
    position: relative;
    display: flex;
    min-height: 100%;
    overflow: hidden;
    padding: clamp(40px, 6vw, 80px);
    background:
        linear-gradient(150deg, rgba(34, 48, 73, 0.96), rgba(23, 33, 52, 0.99)),
        var(--navy-950);
    color: #fff;
    isolation: isolate;
}

.brand-panel::after {
    position: absolute;
    inset: 20px;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 28px;
    content: "";
}

.brand-panel__glow {
    position: absolute;
    z-index: -2;
    border-radius: 999px;
    filter: blur(2px);
}

.brand-panel__glow--one {
    top: -180px;
    right: -180px;
    width: 520px;
    height: 520px;
    background: rgba(197, 176, 231, 0.22);
}

.brand-panel__glow--two {
    bottom: -220px;
    left: -160px;
    width: 460px;
    height: 460px;
    background: rgba(234, 90, 61, 0.16);
}

.brand-content {
    display: flex;
    width: min(100%, 570px);
    flex-direction: column;
    justify-content: center;
    margin: auto;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: clamp(72px, 12vh, 130px);
}

.brand-logo {
    width: 82px;
    height: 82px;
    border: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.eyebrow {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-lockup h1 {
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.05;
}

.brand-lockup h1 span {
    color: var(--orange-500);
}

.brand-message {
    max-width: 540px;
}

.brand-kicker {
    margin-bottom: 20px;
    font-size: clamp(2.4rem, 4.7vw, 4.6rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.brand-description {
    max-width: 500px;
    color: rgba(255, 255, 255, 0.66);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.7;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 42px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-weight: 650;
}

.feature-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    color: var(--purple-200);
    font-size: 0.65rem;
}

.brand-footer {
    position: absolute;
    right: clamp(40px, 6vw, 80px);
    bottom: 42px;
    color: rgba(255, 255, 255, 0.36);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.login-panel {
    position: relative;
    display: grid;
    overflow: hidden;
    place-items: center;
    padding: clamp(32px, 6vw, 96px);
    background:
        radial-gradient(circle at 82% 8%, rgba(197, 176, 231, 0.32), transparent 30%),
        radial-gradient(circle at 12% 92%, rgba(234, 90, 61, 0.2), transparent 28%),
        linear-gradient(145deg, #263654 0%, #1c2941 52%, #172134 100%);
    isolation: isolate;
}

.login-panel::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    content: "";
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 92%);
}

.login-panel::after {
    position: absolute;
    top: 10%;
    right: 8%;
    z-index: -1;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(197, 176, 231, 0.18);
    border-radius: 50%;
    box-shadow:
        0 0 0 34px rgba(197, 176, 231, 0.035),
        0 0 0 70px rgba(197, 176, 231, 0.025);
    content: "";
}

.login-wrap {
    width: min(100%, 490px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.075);
    box-shadow:
        0 32px 70px rgba(6, 13, 26, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: clamp(30px, 4vw, 48px);
    backdrop-filter: blur(22px);
}

.mobile-brand {
    display: none;
}

.login-heading {
    margin-bottom: 34px;
}

.eyebrow--orange {
    color: var(--orange-600);
}

.login-heading h2 {
    margin-bottom: 10px;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    letter-spacing: -0.055em;
    line-height: 1;
    color: #fff;
}

.login-heading > p:last-child {
    color: rgba(255, 255, 255, 0.62);
    font-size: 1rem;
    line-height: 1.6;
}

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

.field label {
    display: inline-block;
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.86rem;
    font-weight: 750;
}

.field-control {
    position: relative;
}

.field-control input {
    width: 100%;
    min-height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 15px;
    outline: none;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    padding: 0 112px 0 50px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-control input::placeholder {
    color: rgba(255, 255, 255, 0.43);
}

.field-control input:focus {
    border-color: rgba(197, 176, 231, 0.75);
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 0 0 4px rgba(197, 176, 231, 0.13);
}

.field-prefix {
    position: absolute;
    top: 50%;
    left: 18px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    color: var(--purple-200);
    font-size: 1rem;
    font-weight: 800;
    transform: translateY(-50%);
}

.field-prefix--lock {
    width: 16px;
    height: 14px;
    border: 2px solid var(--purple-200);
    border-radius: 4px;
}

.field-prefix--lock::before {
    position: absolute;
    top: -9px;
    left: 2px;
    width: 8px;
    height: 9px;
    border: 2px solid var(--purple-200);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    content: "";
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--purple-200);
    padding: 8px 9px;
    font-size: 0.75rem;
    font-weight: 800;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: rgba(197, 176, 231, 0.12);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -4px;
}

.remember-option {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.85rem;
    cursor: pointer;
}

.remember-option input {
    width: 17px;
    height: 17px;
    accent-color: var(--orange-500);
}

.forgot-link {
    border: 0;
    background: transparent;
    color: var(--orange-600);
    font-size: 0.85rem;
    font-weight: 750;
}

.forgot-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.submit-button {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--orange-500), #d7442c);
    color: #fff;
    box-shadow: 0 16px 32px rgba(216, 74, 47, 0.28);
    font-size: 0.95rem;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
    background: linear-gradient(135deg, #f06648, var(--orange-600));
    box-shadow: 0 20px 36px rgba(216, 74, 47, 0.34);
    transform: translateY(-2px);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-arrow {
    font-size: 1.15rem;
}

.support-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-top: 32px;
    border: 1px solid rgba(197, 176, 231, 0.18);
    border-radius: 15px;
    background: rgba(197, 176, 231, 0.08);
    padding: 16px;
}

.support-badge {
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--purple-200);
    color: var(--navy-900);
    padding: 6px 8px;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.support-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.9);
}

.support-card p {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.77rem;
    line-height: 1.5;
}

.version {
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.34);
    font-size: 0.7rem;
    text-align: center;
}

.signup-separator { display:flex; align-items:center; gap:12px; margin:20px 0 14px; color:rgba(255,255,255,.38); font-size:.75rem; text-transform:uppercase; }
.signup-separator::before,.signup-separator::after { content:""; height:1px; flex:1; background:rgba(255,255,255,.14); }
.signup-button { width:100%; min-height:54px; border:1px solid rgba(197,176,231,.42); border-radius:15px; background:rgba(197,176,231,.1); color:#fff; font-weight:800; transition:160ms ease; }
.signup-button:hover { background:rgba(197,176,231,.19); transform:translateY(-1px); }
.signup-note { margin-top:10px; color:rgba(255,255,255,.46); font-size:.72rem; line-height:1.5; text-align:center; }
.registration-dialog { width:min(calc(100% - 28px),650px); }
.registration-dialog form { max-height:min(88vh,760px); overflow:auto; }
.registration-grid { display:grid; grid-template-columns:1fr 1fr; gap:15px; margin:22px 0; }
.registration-grid label { display:grid; gap:7px; color:var(--navy-800); font-size:.8rem; font-weight:800; }
.registration-grid small { color:var(--muted); font-size:.68rem; font-weight:600; line-height:1.4; }
.registration-grid input { width:100%; min-height:46px; border:1px solid var(--line); border-radius:11px; outline:none; padding:0 12px; color:var(--ink); background:#fff; }
.registration-grid input:focus { border-color:#8f72c2; box-shadow:0 0 0 3px rgba(143,114,194,.13); }
.registration-wide { grid-column:1/-1; }
.registration-submit { display:flex; align-items:center; justify-content:center; gap:10px; background:linear-gradient(135deg,var(--orange-500),#d7442c); }
.registration-alert { margin-top:16px; border:1px solid #fecdca; border-radius:11px; background:#fef3f2; color:var(--danger); padding:11px 13px; font-size:.78rem; font-weight:750; line-height:1.45; }
@media(max-width:580px){.registration-grid{grid-template-columns:1fr}.registration-wide{grid-column:auto}}

.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    border: 1px solid;
    border-radius: 13px;
    padding: 13px 15px;
    font-size: 0.84rem;
    font-weight: 700;
    opacity: 1;
    transition: opacity 220ms ease, transform 220ms ease, margin 220ms ease, padding 220ms ease;
}

.flash-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.flash-error {
    border-color: #fecdca;
    background: #fef3f2;
    color: var(--danger);
}

.flash-success {
    border-color: #abefc6;
    background: #ecfdf3;
    color: var(--success);
}

.flash-warning {
    border-color: #fedf89;
    background: #fffaeb;
    color: var(--warning);
}

.flash-hide {
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transform: translateY(-8px);
}

.recovery-dialog {
    width: min(calc(100% - 32px), 460px);
    border: 0;
    border-radius: 22px;
    box-shadow: var(--shadow);
    color: var(--ink);
    padding: 0;
}

.recovery-dialog::backdrop {
    background: rgba(23, 33, 52, 0.68);
    backdrop-filter: blur(5px);
}

.recovery-dialog form {
    position: relative;
    padding: 38px;
}

.dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: #f2f4f7;
    color: var(--navy-800);
    font-size: 1.4rem;
}

.dialog-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 15px;
    background: var(--purple-100);
    color: var(--navy-800);
    font-size: 1.3rem;
    font-weight: 900;
}

.recovery-dialog h2 {
    margin-bottom: 12px;
    font-size: 1.45rem;
}

.recovery-dialog p,
.recovery-dialog li {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.recovery-dialog ol {
    display: grid;
    gap: 6px;
    margin: 18px 0 26px;
    padding-left: 20px;
}

.dialog-confirm {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--navy-900);
    color: #fff;
    font-weight: 800;
}

:focus-visible {
    outline: 3px solid rgba(234, 90, 61, 0.45);
    outline-offset: 3px;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 42px 24px;
    }

    .mobile-brand {
        display: flex;
        width: 100%;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        margin-bottom: 54px;
        color: #fff;
        font-size: 1.12rem;
        font-weight: 850;
        letter-spacing: -0.02em;
        text-align: center;
    }

    .mobile-brand img {
        width: 112px;
        height: 112px;
        border: 0;
        border-radius: 50%;
        object-fit: cover;
        box-shadow:
            0 18px 34px rgba(7, 14, 28, 0.34),
            0 0 0 8px rgba(197, 176, 231, 0.08);
    }
}

@media (max-width: 520px) {
    .login-panel {
        align-items: start;
        padding: 24px 16px;
    }

    .mobile-brand {
        margin-bottom: 38px;
    }

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

    .login-heading {
        margin-bottom: 28px;
    }

    .login-heading h2 {
        font-size: 2.35rem;
    }

    .login-wrap {
        border-radius: 22px;
        padding: 26px 20px;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .field-control input {
        min-height: 54px;
    }

    .recovery-dialog form {
        padding: 30px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
