@import url("brand-tokens.css");

:root {
    --login-navy: #0b1735;
    --login-navy-soft: #122754;
    --login-blue: #2563eb;
    --login-violet: #6d5dfc;
    --login-cyan: #06b6d4;
    --login-green: #12a86b;
    --login-ink: #10213d;
    --login-muted: #667792;
    --login-line: #dce5f2;
    --login-field: #f8faff;
    --login-shadow: 0 30px 90px rgba(25, 42, 79, .18), 0 8px 28px rgba(25, 42, 79, .09);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #edf2fb;
}

body.page-login {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--login-ink);
    background: #edf2fb;
    font-family: Inter, var(--font-sans);
    font-size: 12px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.page-login button,
body.page-login input {
    font: inherit;
}

.login-page {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(18px, 3vw, 38px);
    place-items: center;
    background:
        radial-gradient(circle at 8% 16%, rgba(109, 93, 252, .13), transparent 26%),
        radial-gradient(circle at 91% 82%, rgba(6, 182, 212, .12), transparent 28%),
        linear-gradient(145deg, #f8faff 0%, #edf3fb 52%, #f6f4ff 100%);
}

.login-grid-bg {
    position: absolute;
    z-index: -3;
    inset: 0;
    opacity: .42;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(73, 102, 153, .075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(73, 102, 153, .075) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 80%, transparent 100%);
}

.login-orb {
    position: absolute;
    z-index: -2;
    border: 1px solid rgba(99, 102, 241, .18);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(.2px);
}

.orb-left {
    top: -130px;
    left: -110px;
    width: 360px;
    height: 360px;
    box-shadow: inset 0 0 80px rgba(99, 102, 241, .08);
}

.orb-right {
    right: -125px;
    bottom: -160px;
    width: 430px;
    height: 430px;
    border-color: rgba(6, 182, 212, .2);
    box-shadow: inset 0 0 90px rgba(6, 182, 212, .08);
}

.login-page > .container {
    width: min(1140px, 100%);
    max-width: none;
    margin: 0;
    padding: 0;
}

.login-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
    min-height: min(610px, calc(100vh - clamp(36px, 6vw, 76px)));
    overflow: hidden;
    border: 1px solid rgba(207, 219, 238, .92);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--login-shadow);
}

.login-brand-panel,
.login-form-panel {
    position: relative;
    min-width: 0;
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    padding: clamp(28px, 3vw, 44px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 83% 12%, rgba(51, 214, 240, .21), transparent 26%),
        radial-gradient(circle at 12% 92%, rgba(122, 105, 255, .3), transparent 31%),
        linear-gradient(145deg, var(--login-navy) 2%, #0e2047 52%, var(--login-navy-soft) 100%);
}

.login-brand-panel::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: .36;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(145deg, #000, transparent 75%);
}

.login-brand-panel::after {
    position: absolute;
    right: -150px;
    bottom: -190px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 50%;
    content: "";
    box-shadow:
        0 0 0 45px rgba(255, 255, 255, .025),
        0 0 0 95px rgba(255, 255, 255, .018);
}

.login-brand-panel > * {
    position: relative;
    z-index: 1;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    width: 148px;
    height: 52px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 30px rgba(4, 12, 31, .22);
    transition: transform .2s ease, box-shadow .2s ease;
}

.login-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 35px rgba(4, 12, 31, .27);
}

.login-logo:focus-visible,
.note-home-link:focus-visible,
.form-options a:focus-visible,
.form-footer a:focus-visible,
.password-toggle:focus-visible,
.login-button:focus-visible {
    outline: 3px solid rgba(86, 192, 255, .48);
    outline-offset: 3px;
}

.login-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-content {
    max-width: 570px;
    margin-top: clamp(34px, 5vh, 58px);
}

.eyebrow,
.form-header > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 25px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .105em;
    line-height: 1;
    text-transform: uppercase;
}

.eyebrow {
    border: 1px solid rgba(132, 218, 255, .22);
    color: #bcecff;
    background: rgba(57, 172, 231, .1);
}

.brand-content h1 {
    max-width: 590px;
    margin: 15px 0 12px;
    color: #fff;
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(24px, 2.35vw, 33px);
    font-weight: 800;
    letter-spacing: -.047em;
    line-height: 1.12;
}

.brand-content p {
    max-width: 550px;
    margin: 0;
    color: #bdc9df;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.65;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 24px;
}

.login-feature-card {
    position: relative;
    min-height: 104px;
    padding: 13px 12px 11px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .105);
    border-radius: 14px;
    background: rgba(255, 255, 255, .055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
    backdrop-filter: blur(10px);
}

.login-feature-card::after {
    position: absolute;
    right: -22px;
    bottom: -30px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    content: "";
    opacity: .13;
    background: currentColor;
}

.login-feature-card > i {
    display: grid;
    width: 31px;
    height: 31px;
    margin-bottom: 9px;
    border-radius: 9px;
    font-size: 12px;
    place-items: center;
    color: #bab5ff;
    background: rgba(121, 104, 255, .18);
}

.login-feature-card:nth-child(2) > i {
    color: #78e4f2;
    background: rgba(6, 182, 212, .16);
}

.login-feature-card:nth-child(3) > i {
    color: #75e3af;
    background: rgba(18, 168, 107, .17);
}

.login-feature-card > span {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.login-feature-card p {
    margin: 0;
    color: #aebbd2;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.52;
}

.login-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: auto;
    padding-top: 20px;
}

.login-note-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 390px;
    color: #aab8cf;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.55;
}

.login-note-text > i {
    margin-top: 2px;
    color: #5ee0ad;
}

.note-home-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 11px;
    color: #eaf0fb;
    background: rgba(255, 255, 255, .055);
    font-size: 9px;
    font-weight: 800;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.note-home-link:hover {
    border-color: rgba(255, 255, 255, .27);
    color: #fff;
    background: rgba(255, 255, 255, .1);
    transform: translateY(-1px);
}

.login-form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(30px, 3.7vw, 48px);
    background:
        radial-gradient(circle at 100% 0%, rgba(109, 93, 252, .055), transparent 33%),
        linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.login-form-panel::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    content: "";
    background: linear-gradient(90deg, var(--login-violet), var(--login-blue), var(--login-cyan));
}

.form-card {
    width: min(100%, 390px);
}

.form-header {
    margin-bottom: 21px;
}

.form-header > span {
    border: 1px solid #d9e2ff;
    color: #5548d9;
    background: #f0efff;
}

.form-header > span i {
    color: var(--login-violet);
}

.form-header h2 {
    margin: 14px 0 5px;
    color: #0d1d38;
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(21px, 2vw, 26px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.15;
}

.form-header p {
    margin: 0;
    color: var(--login-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 9px 11px;
    border: 1px solid;
    border-radius: 13px;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.5;
}

.alert-box i {
    margin-top: 2px;
}

.alert-box.error {
    border-color: #fecaca;
    color: #b42318;
    background: #fff2f2;
}

.alert-box.success {
    border-color: #b7ecd2;
    color: #08744a;
    background: #effcf5;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #273957;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .075em;
    line-height: 1.25;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
}

.input-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: #8291a9;
    font-size: 12px;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color .2s ease;
}

.input-wrap input {
    width: 100%;
    height: 44px;
    padding: 0 42px 0 38px;
    border: 1px solid #d6e0ee;
    border-radius: 11px;
    outline: none;
    color: #172842;
    background: var(--login-field);
    font-size: 11px;
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(18, 35, 62, .025);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-wrap input::placeholder {
    color: #9aa8bb;
    font-weight: 500;
}

.input-wrap:focus-within > i {
    color: var(--login-blue);
}

.input-wrap input:hover {
    border-color: #bdcbe0;
}

.input-wrap input:focus {
    border-color: #6c81f4;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .11);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: #6f7f98;
    background: transparent;
    cursor: pointer;
    place-items: center;
    transform: translateY(-50%);
    transition: color .2s ease, background .2s ease;
}

.password-toggle:hover {
    color: var(--login-blue);
    background: #ebf1ff;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 2px 0 17px;
}

.remember-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #53637c;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
}

.remember-check input {
    width: 14px;
    height: 14px;
    margin: 0;
    border-radius: 5px;
    accent-color: var(--login-violet);
}

.form-options a,
.form-footer a {
    color: #365dd8;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

.form-options a:hover,
.form-footer a:hover {
    color: #5548d9;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0 12px 0 16px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(115deg, #275fe4 0%, #6256ee 55%, #7a3ff0 100%);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 13px 28px rgba(79, 70, 229, .25);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-button i {
    display: grid;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    transition: transform .2s ease;
}

.login-button:hover {
    color: #fff;
    filter: saturate(1.07);
    transform: translateY(-2px);
    box-shadow: 0 17px 34px rgba(79, 70, 229, .31);
}

.login-button:hover i {
    transform: translateX(2px);
}

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

.form-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    color: #74839a;
    font-size: 10px;
    font-weight: 550;
}

.mini-status-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 390px);
    margin-top: 25px;
    overflow: hidden;
    border: 1px solid #e0e8f3;
    border-radius: 13px;
    background: #f8faff;
}

.mini-status-row > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 5px;
    color: #687892;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .025em;
    text-align: center;
    text-transform: uppercase;
}

.mini-status-row > div + div {
    border-left: 1px solid #e0e8f3;
}

.mini-status-row i {
    color: var(--login-violet);
    font-size: 11px;
}

.mini-status-row > div:nth-child(2) i {
    color: var(--login-cyan);
}

.mini-status-row > div:nth-child(3) i {
    color: var(--login-green);
}

@media (max-width: 980px) {
    .login-page {
        align-items: start;
        padding: 16px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        width: min(720px, 100%);
        min-height: 0;
        margin: auto;
    }

    .login-brand-panel {
        padding: 25px;
    }

    .brand-content {
        margin-top: 25px;
    }

    .brand-content h1 {
        max-width: 600px;
        font-size: clamp(24px, 4.5vw, 30px);
    }

    .login-feature-card {
        min-height: 96px;
    }

    .login-note {
        margin-top: 22px;
    }

    .login-form-panel {
        min-height: 500px;
        padding: 38px 26px 30px;
    }
}

@media (max-width: 620px) {
    .login-page {
        display: block;
        padding: 0;
        background: #fff;
    }

    .login-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-brand-panel {
        padding: 25px 21px 28px;
    }

    .login-logo {
        width: 132px;
        height: 47px;
        border-radius: 14px;
    }

    .brand-content {
        margin-top: 30px;
    }

    .eyebrow {
        font-size: 9px;
    }

    .brand-content h1 {
        margin-top: 16px;
        font-size: 24px;
        line-height: 1.1;
    }

    .brand-content p {
        font-size: 11px;
        line-height: 1.65;
    }

    .login-feature-grid {
        gap: 7px;
        margin-top: 25px;
    }

    .login-feature-card {
        min-height: 84px;
        padding: 12px 9px;
        border-radius: 13px;
    }

    .login-feature-card > i {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
        font-size: 12px;
    }

    .login-feature-card p {
        display: none;
    }

    .login-note {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding-top: 20px;
    }

    .note-home-link {
        align-self: flex-start;
    }

    .login-form-panel {
        min-height: 0;
        padding: 42px 21px 32px;
    }

    .form-header h2 {
        font-size: 22px;
    }

    .form-options {
        gap: 12px;
    }

    .mini-status-row {
        margin-top: 28px;
    }

    .mini-status-row > div {
        flex-direction: column;
        gap: 4px;
        padding: 10px 4px;
        font-size: 8px;
    }
}

@media (max-width: 380px) {
    .form-options,
    .form-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-footer {
        gap: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
