.login-page {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--app-ink);
    background:
        radial-gradient(circle at 8% 8%, rgba(70, 86, 215, .16), transparent 32rem),
        radial-gradient(circle at 92% 88%, rgba(18, 139, 79, .10), transparent 28rem),
        var(--app-canvas);
}

.login-page::before,
.login-page::after {
    position: fixed;
    z-index: 0;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(70, 86, 215, .12);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.login-page::before { top: -105px; right: -65px; }
.login-page::after { bottom: -140px; left: -85px; width: 310px; height: 310px; }

.login-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(20px, 4vw, 48px);
}

.login-card {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(390px, .96fr);
    width: min(1080px, 100%);
    min-height: 630px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 28px;
    background: var(--app-surface);
    box-shadow: 0 28px 80px rgba(23, 32, 51, .14);
}

.login-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: clamp(36px, 5vw, 68px);
    color: #fff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .06), transparent 45%),
        linear-gradient(155deg, #101a36 0%, #273c83 58%, #4656d7 100%);
}

.login-brand-panel::before,
.login-brand-panel::after {
    position: absolute;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.login-brand-panel::before {
    top: -105px;
    right: -115px;
    width: 320px;
    height: 320px;
    border: 54px solid rgba(255, 255, 255, .055);
}

.login-brand-panel::after {
    right: -60px;
    bottom: -130px;
    width: 290px;
    height: 290px;
    background: rgba(23, 185, 105, .17);
}

.login-brand-content { position: relative; z-index: 1; width: 100%; }

.login-logo-frame {
    display: flex;
    align-items: center;
    width: min(330px, 100%);
    min-height: 112px;
    margin-bottom: 38px;
    padding: 13px 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(7, 13, 31, .22);
}

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

.login-eyebrow,
.login-welcome {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.login-eyebrow { color: #bfc7ff; }

.login-brand-panel h1 {
    max-width: 470px;
    margin: 0;
    color: #fff;
    font-size: clamp(31px, 3.4vw, 46px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.login-brand-description {
    max-width: 490px;
    margin: 22px 0 34px;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
    line-height: 1.7;
}

.login-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.login-feature {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 14px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .075);
    backdrop-filter: blur(4px);
}

.login-feature-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    font-size: 18px;
}

.login-feature strong,
.login-feature small { display: block; }
.login-feature strong { color: #fff; font-size: 12px; }
.login-feature small { margin-top: 3px; color: rgba(255, 255, 255, .6); font-size: 10px; }

.login-form-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(30px, 4.5vw, 58px);
    background: var(--app-surface);
}

.login-panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 42px; }

.login-security {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 600;
}

.login-security i { color: #14905a; font-size: 17px; }

.login-theme-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    color: var(--app-muted);
    background: var(--app-canvas);
    font-size: 20px;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

.login-theme-toggle:hover { border-color: var(--app-primary); color: var(--app-primary); transform: translateY(-1px); }

.login-form-wrap {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    width: min(390px, 100%);
    margin: 0 auto;
    padding: 28px 0 10px;
}

.login-heading { margin-bottom: 30px; }
.login-welcome { color: var(--app-primary); }

.login-heading h2 {
    margin: 0 0 10px;
    color: var(--app-ink);
    font-size: clamp(28px, 3vw, 37px);
    font-weight: 700;
    letter-spacing: -.035em;
}

.login-heading > p:last-child { margin: 0; color: var(--app-muted); font-size: 14px; line-height: 1.6; }
.login-form { display: grid; gap: 21px; }
.login-field { min-width: 0; }

.login-field .form-label { margin-bottom: 8px; color: var(--app-ink); font-size: 13px; font-weight: 600; }
.login-input-group { position: relative; display: flex; align-items: center; }

.login-input-group > i {
    position: absolute;
    z-index: 2;
    left: 16px;
    color: var(--app-muted);
    font-size: 19px;
    pointer-events: none;
}

.login-input-group .form-control {
    min-height: 54px;
    padding: 12px 48px;
    border: 1px solid var(--app-border);
    border-radius: 13px;
    color: var(--app-ink);
    background: var(--app-canvas);
    box-shadow: none;
    font-size: 14px;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.login-input-group .form-control::placeholder { color: #98a0af; }

.login-input-group .form-control:focus {
    border-color: var(--app-primary);
    background: var(--app-surface);
    box-shadow: 0 0 0 4px rgba(70, 86, 215, .12);
}

.login-input-group:focus-within > i { color: var(--app-primary); }

.password-toggle {
    position: absolute;
    z-index: 3;
    right: 6px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: var(--app-muted);
    background: transparent;
    font-size: 20px;
}

.password-toggle:hover,
.password-toggle:focus-visible { color: var(--app-primary); background: var(--app-primary-soft); }

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 54px;
    margin-top: 2px;
    border-radius: 13px;
    box-shadow: 0 12px 25px rgba(70, 86, 215, .23);
}

.login-submit i { font-size: 21px; }
.login-submit:disabled { cursor: wait; opacity: .75; }

.login-feedback {
    margin: -10px 0 20px;
    padding: 12px 14px;
    border: 1px solid rgba(201, 42, 42, .2);
    border-radius: 11px;
    color: #a92323;
    background: rgba(220, 53, 69, .08);
    font-size: 13px;
    line-height: 1.45;
}

.login-feedback[hidden] { display: none; }

.login-help { display: flex; align-items: flex-start; gap: 7px; margin: 28px 0 0; color: var(--app-muted); font-size: 11px; line-height: 1.55; }
.login-help i { margin-top: 1px; color: var(--app-primary); font-size: 15px; }
.login-footer { margin: 17px 0 0; color: var(--app-muted); font-size: 11px; text-align: center; }

html[data-bs-theme="dark"] .login-card { box-shadow: 0 28px 80px rgba(0, 0, 0, .3); }
html[data-bs-theme="dark"] .login-input-group .form-control::placeholder { color: #858d9d; }
html[data-bs-theme="dark"] .login-feedback { color: #ffabab; background: rgba(220, 53, 69, .13); }

@media (max-width: 991.98px) {
    .login-card { grid-template-columns: minmax(0, .82fr) minmax(380px, 1.18fr); min-height: 600px; }
    .login-brand-panel { padding: 42px 34px; }
    .login-logo-frame { margin-bottom: 32px; }
    .login-features { grid-template-columns: 1fr; }
    .login-feature { flex-direction: row; align-items: center; padding: 11px; }
    .login-feature:nth-child(3) { display: none; }
}

@media (max-width: 767.98px) {
    .login-shell { justify-content: flex-start; padding: 18px; }
    .login-card { grid-template-columns: 1fr; width: min(560px, 100%); min-height: 0; border-radius: 22px; }
    .login-brand-panel { min-height: 225px; padding: 28px 30px; }
    .login-logo-frame { width: 245px; min-height: 80px; margin-bottom: 20px; padding: 9px 13px; border-radius: 14px; }
    .login-eyebrow { margin-bottom: 8px; }
    .login-brand-panel h1 { max-width: 410px; font-size: 28px; }
    .login-brand-description,
    .login-features { display: none; }
    .login-form-panel { padding: 28px 30px 34px; }
    .login-form-wrap { padding-top: 20px; }
    .login-heading { margin-bottom: 25px; }
}

@media (max-width: 575.98px) {
    .login-shell { padding: 0; background: var(--app-surface); }
    .login-card { width: 100%; min-height: calc(100vh - 30px); min-height: calc(100dvh - 30px); border: 0; border-radius: 0 0 22px 22px; box-shadow: none; }
    .login-brand-panel { min-height: 190px; padding: max(22px, env(safe-area-inset-top)) 22px 24px; }
    .login-brand-panel::before { width: 250px; height: 250px; }
    .login-logo-frame { width: 205px; min-height: 67px; margin-bottom: 16px; }
    .login-eyebrow { font-size: 10px; }
    .login-brand-panel h1 { font-size: 24px; }
    .login-form-panel { padding: 22px max(22px, env(safe-area-inset-right)) 30px max(22px, env(safe-area-inset-left)); }
    .login-form-wrap { justify-content: flex-start; padding-top: 22px; }
    .login-heading h2 { font-size: 29px; }
    .login-input-group .form-control { font-size: 16px; }
    .login-footer { margin: 10px 16px; padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-height: 720px) and (min-width: 768px) {
    .login-shell { justify-content: flex-start; }
    .login-card { min-height: 570px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-theme-toggle,
    .login-input-group .form-control { transition: none; }
}
