:root {
    --client-primary: #002395;
    --client-secondary: #0033cc;
    --client-accent: #ffb612;
    --client-bg: #f8fafc;
    --client-surface: #ffffff;
    --client-text: #1e293b;
    --client-muted: #64748b;
    --client-border: #e2e8f0;
    --brand: var(--client-primary);
    --brand-light: var(--client-secondary);
    --brand-accent: var(--client-accent);
    --brand-overlay: rgba(29, 97, 161, 0.76);
    --login-ink: #122033;
    --login-muted: #64748b;
    --login-border: rgba(148, 163, 184, 0.28);
    --login-surface: rgba(255, 255, 255, 0.88);
    --login-surface-strong: #ffffff;
    --login-page-bg: #edf4f8;
    --login-focus: rgba(31, 51, 71, 0.16);
    --login-radius-xl: 2rem;
    --login-radius-lg: 1.25rem;
    --login-radius-md: 0.875rem;
    --login-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
    --login-shadow-soft: 0 18px 46px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100dvh;
    margin: 0;
    background:
        radial-gradient(circle at 9% 12%, rgba(58, 90, 120, 0.2), transparent 32rem),
        radial-gradient(circle at 88% 18%, rgba(31, 51, 71, 0.16), transparent 30rem),
        linear-gradient(135deg, #f7fbfd 0%, var(--login-page-bg) 48%, #e7eef3 100%);
    color: var(--login-ink);
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(31, 51, 71, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 51, 71, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 80%);
}

.text-brand {
    color: var(--brand) !important;
}

.login-shell {
    min-height: 100dvh;
    padding: clamp(0.75rem, 1.6vw, 1.5rem);
    position: relative;
}

.login-layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: calc(100dvh - clamp(1.5rem, 3.2vw, 3rem));
    max-height: calc(100dvh - clamp(1.5rem, 3.2vw, 3rem));
    max-width: 1440px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: var(--login-radius-xl);
    background: rgba(255, 255, 255, 0.46);
    box-shadow: var(--login-shadow);
    backdrop-filter: blur(26px);
}

.left-sidebar {
    width: 46%;
    min-height: 100%;
}

.right-form-section {
    width: 54%;
    min-height: 100%;
}

.image-sidebar {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--brand);
}

.image-sidebar .overlay-brand,
.gradient-overlay,
.hero-orb {
    position: absolute;
    inset: 0;
}

.image-sidebar .overlay-brand {
    z-index: 1;
    background-image: url("/images/loginBackground/loginbackgroundDefault.png");
    background-position: center;
    background-size: cover;
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.02);
}

.gradient-overlay {
    z-index: 2;
    background:
        linear-gradient(135deg, rgba(10, 18, 32, 0.88) 0%, rgba(31, 51, 71, 0.68) 46%, rgba(31, 51, 71, 0.3) 100%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.08));
}

.hero-orb {
    z-index: 3;
    width: 22rem;
    height: 22rem;
    border-radius: 999px;
    opacity: 0.34;
    filter: blur(10px);
    pointer-events: none;
}

.hero-orb-one {
    inset: auto auto 8% -6rem;
    background: radial-gradient(circle, var(--brand-light), transparent 64%);
}

.hero-orb-two {
    inset: 10% -8rem auto auto;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.88), transparent 62%);
}

.sidebar-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: clamp(1.75rem, 3vw, 3.5rem);
    color: #ffffff;
}

.brand-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 0.65rem;
    padding: 0.62rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    backdrop-filter: blur(16px);
}

.brand-kicker-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--brand-accent);
    box-shadow: 0 0 0 0.32rem color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

.hero-copy {
    max-width: 34rem;
    margin-top: auto;
    margin-bottom: auto;
    animation: loginRise 700ms ease both;
}

.juno-logo {
    width: min(220px, 64vw);
    height: auto;
    margin-bottom: 1.55rem;
    filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.22));
}

.hero-copy h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 3.5vw, 3.65rem);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.045em;
}

.hero-copy p {
    max-width: 30rem;
    margin: 1.35rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(0.94rem, 1.2vw, 1.05rem);
    line-height: 1.7;
}

.powered-by {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(4, 12, 24, 0.34);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 600;
    backdrop-filter: blur(16px);
}

.powered-by img {
    height: auto;
}

.right-form-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 3rem);
    background:
        radial-gradient(circle at 78% 14%, rgba(58, 90, 120, 0.12), transparent 18rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.96));
}

.right-form-section::before {
    content: "";
    position: absolute;
    width: 18rem;
    height: 18rem;
    right: -8rem;
    bottom: -7rem;
    border-radius: 999px;
    background: rgba(31, 51, 71, 0.08);
}

.mobile-brand {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.mobile-brand .juno-logo {
    width: 180px;
    margin: 0;
    filter: none;
}

.login-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 31.5rem);
    max-height: 100%;
    margin: auto 0;
    animation: loginRise 800ms ease 80ms both;
}

.account-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    margin-bottom: 0.5rem;
}

.account-logo {
    max-width: min(360px, 100%);
    max-height: 68px;
    margin-bottom: 0;
    object-fit: contain;
    filter: drop-shadow(0 16px 26px rgba(15, 23, 42, 0.12));
}

.form-container {
    width: 100%;
    padding: clamp(1.5rem, 3.2vw, 2.65rem);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: var(--login-radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9)),
        var(--login-surface);
    box-shadow: var(--login-shadow-soft);
    backdrop-filter: blur(22px);
}

@media (min-width: 992px) {
    .account-selection-active .right-form-section {
        align-items: flex-start;
        padding: clamp(0.85rem, 1.8vw, 1.5rem);
    }

    .account-selection-active .login-panel {
        width: min(100%, 29rem);
        margin-top: clamp(0.5rem, 1.4vh, 0.9rem);
        margin-bottom: 0;
    }

    .account-selection-active .form-container {
        padding: 1.1rem 1.15rem 1rem;
        border-radius: 1.35rem;
    }

    .account-selection-active .login-card-header {
        margin-bottom: 0.9rem;
    }

    .account-selection-active .login-eyebrow {
        margin-bottom: 0.42rem;
        font-size: 0.7rem;
    }

    .account-selection-active .login-heading {
        font-size: clamp(1.45rem, 1.9vw, 1.8rem);
    }

    .account-selection-active .login-card-header p {
        margin-top: 0.45rem;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .account-selection-active .form-field.mb-4,
    .account-selection-active #accountSelectionContainer.mb-4 {
        margin-bottom: 0.65rem !important;
    }

    .account-selection-active .form-label {
        margin-bottom: 0.32rem;
        font-size: 0.75rem;
    }

    .account-selection-active .form-control-custom {
        min-height: 2.7rem;
        font-size: 0.88rem;
    }

    .account-selection-active .account-selection {
        padding: 0.65rem;
        border-radius: 0.95rem;
    }

    .account-selection-active .account-selection .alert {
        margin-bottom: 0.5rem !important;
        padding: 0.5rem 0.65rem !important;
        font-size: 0.76rem;
    }

    .account-selection-active .login-options {
        margin-bottom: 0.6rem;
        font-size: 0.8rem;
    }

    .account-selection-active .form-check-label,
    .account-selection-active .forgot-password-link {
        font-size: 0.8rem;
    }

    .account-selection-active .btn-brand {
        min-height: 2.85rem;
        font-size: 0.9rem;
    }

    .account-selection-active .alert-danger {
        margin-bottom: 0.65rem !important;
        padding: 0.65rem !important;
        font-size: 0.8rem;
    }
}

@media (min-width: 992px) {
    body {
        overflow: hidden;
    }
}

@media (min-width: 992px) and (max-height: 880px) {
    .login-shell {
        padding: 0.65rem;
    }

    .login-layout {
        min-height: calc(100dvh - 1.3rem);
        max-height: calc(100dvh - 1.3rem);
    }

    .sidebar-content {
        padding: clamp(1.25rem, 2.2vw, 2.25rem);
    }

    .juno-logo {
        width: min(198px, 56vw);
        margin-bottom: 1.15rem;
    }

    .hero-copy h1 {
        font-size: clamp(1.85rem, 3vw, 3.1rem);
    }

    .hero-copy p {
        margin-top: 1.05rem;
        font-size: 0.94rem;
        line-height: 1.56;
    }

    .powered-by {
        padding: 0.58rem 0.8rem;
        font-size: 0.76rem;
    }

    .right-form-section {
        padding: clamp(1rem, 2.2vw, 1.8rem);
    }

    .account-logo {
        max-height: 58px;
    }

    .account-logo-frame {
        min-height: 70px;
        margin-bottom: 0.35rem;
    }

    .form-container {
        padding: clamp(1.25rem, 2.4vw, 1.9rem);
        border-radius: 1.6rem;
    }

    .login-card-header {
        margin-bottom: 1.25rem;
    }

    .login-eyebrow {
        margin-bottom: 0.55rem;
        font-size: 0.72rem;
    }

    .login-heading {
        font-size: clamp(1.65rem, 2.2vw, 2.15rem);
    }

    .login-card-header p {
        margin-top: 0.7rem;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .form-field.mb-4,
    #accountSelectionContainer.mb-4 {
        margin-bottom: 0.95rem !important;
    }

    .form-label {
        margin-bottom: 0.42rem;
        font-size: 0.79rem;
    }

    .form-control-custom {
        min-height: 3rem;
        font-size: 0.92rem;
    }

    .toggle-password {
        width: 2.2rem;
        height: 2.2rem;
    }

    .login-options {
        font-size: 0.84rem;
    }

    .form-check-label,
    .forgot-password-link {
        font-size: 0.84rem;
    }

    .btn-brand {
        min-height: 3.1rem;
        font-size: 0.95rem;
    }

    .alert-danger {
        margin-bottom: 0.9rem !important;
        padding: 0.8rem !important;
        font-size: 0.84rem;
    }
}

@media (min-width: 992px) and (max-height: 780px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-shell {
        min-height: auto;
        padding: 0.65rem;
    }

    .login-layout {
        min-height: calc(100dvh - 1.3rem);
        max-height: none;
    }

    .right-form-section {
        align-items: flex-start;
        padding: 0.9rem 1rem 1rem;
    }

    .login-panel {
        margin-top: 0.35rem;
        margin-bottom: 0.35rem;
        max-height: none;
    }

    .hero-copy h1 {
        font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    }

    .hero-copy p {
        font-size: 0.88rem;
        line-height: 1.44;
    }

    .form-container {
        padding: 1.05rem 1.2rem;
    }

    .login-card-header {
        margin-bottom: 1rem;
    }

    .form-field.mb-4,
    #accountSelectionContainer.mb-4 {
        margin-bottom: 0.75rem !important;
    }

    .form-control-custom {
        min-height: 2.8rem;
    }

    .btn-brand {
        min-height: 2.95rem;
    }
}

.login-card-header {
    margin-bottom: 2rem;
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    color: var(--brand-light);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.login-eyebrow::before {
    content: "";
    width: 1.8rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.login-heading {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.login-card-header p {
    margin: 0.95rem 0 0;
    color: var(--login-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.login-form {
    display: block;
}

.form-field {
    position: relative;
}

.form-label {
    margin-bottom: 0.55rem;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.05rem;
    z-index: 2;
    color: #94a3b8;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.input-wrapper:focus-within .input-icon {
    color: var(--brand);
    transform: translateX(2px);
}

.form-control-custom {
    min-height: 3.35rem;
    width: 100%;
    border: 1px solid var(--login-border);
    border-radius: var(--login-radius-md);
    background-color: rgba(248, 250, 252, 0.9);
    color: var(--login-ink);
    font-size: 0.96rem;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.form-control-custom::placeholder {
    color: #9aa8b9;
    font-weight: 500;
}

.form-control-custom:hover:not(:focus) {
    border-color: rgba(58, 90, 120, 0.48);
    background-color: #ffffff;
}

.form-control-custom:focus {
    border-color: var(--brand);
    background-color: #ffffff;
    box-shadow: 0 0 0 0.35rem var(--login-focus);
    outline: none;
    transform: translateY(-1px);
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    background-color: rgba(31, 51, 71, 0.08);
    color: var(--brand);
    outline: none;
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.96);
}

.eye-icon {
    font-size: 1rem;
}

.form-control-custom.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: none;
}

.form-control-custom.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.35rem rgba(220, 53, 69, 0.12);
}

#capsLockWarning {
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 0.75rem;
    background-color: rgba(245, 158, 11, 0.1);
    color: #a16207 !important;
    font-size: 0.8rem;
    font-weight: 700;
}

.account-selection {
    padding: 1rem;
    border: 1px solid rgba(14, 116, 144, 0.18);
    border-radius: var(--login-radius-lg);
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.72), rgba(248, 250, 252, 0.78));
}

.account-selection .alert {
    border: 0;
    border-radius: 0.9rem;
    background: rgba(14, 116, 144, 0.1);
    color: #155e75;
    font-size: 0.86rem;
    font-weight: 700;
}

.login-options {
    color: var(--login-muted);
    font-size: 0.9rem;
}

.form-check {
    min-height: auto;
}

.form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    border-color: rgba(100, 116, 139, 0.45);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.22rem var(--login-focus);
}

.form-check-label {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.forgot-password-link {
    color: var(--brand);
    font-size: 0.9rem;
    font-weight: 800;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.forgot-password-link:hover,
.forgot-password-link:focus-visible {
    color: var(--brand-light);
    opacity: 0.86;
    outline: none;
}

.btn-brand {
    position: relative;
    min-height: 3.45rem;
    overflow: hidden;
    border: 0;
    border-radius: 1rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 36%),
        linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
    box-shadow: 0 18px 34px rgba(31, 51, 71, 0.28);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
}

.btn-brand:hover,
.btn-brand:focus-visible {
    color: #ffffff;
    box-shadow: 0 24px 42px rgba(31, 51, 71, 0.34);
    filter: saturate(1.08);
    transform: translateY(-2px);
    outline: none;
}

.btn-brand:hover::after,
.btn-brand:focus-visible::after {
    transform: translateX(120%);
}

.btn-brand:active {
    transform: translateY(0) scale(0.99);
}

.btn-brand:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.submit-btn .btn-text,
.submit-btn .btn-loader {
    position: relative;
    z-index: 1;
}

.alert-danger {
    border: 1px solid rgba(220, 53, 69, 0.18);
    background: rgba(254, 242, 242, 0.9);
    color: #991b1b;
    font-weight: 700;
}

.modal-content {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 1.5rem;
    box-shadow: var(--login-shadow);
}

.modal-header,
.modal-body,
.modal-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@keyframes loginRise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 1199.98px) {
    .left-sidebar {
        width: 44%;
    }

    .right-form-section {
        width: 56%;
    }

    .sidebar-content {
        padding: 2.5rem;
    }

    .hero-copy h1 {
        font-size: 2.85rem;
    }
}

@media (max-width: 991.98px) {
    .login-shell {
        padding: 0;
    }

    .login-layout {
        min-height: 100vh;
        max-height: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .right-form-section {
        width: 100%;
        min-height: 100vh;
        padding: 7.5rem 1.25rem 2rem;
    }

    body {
        overflow-y: auto;
    }

    .login-panel {
        width: min(100%, 34rem);
    }
}

@media (max-width: 575.98px) {
    body::before {
        background-size: 42px 42px;
    }

    .right-form-section {
        padding: 6.5rem 0.9rem 1.35rem;
    }

    .mobile-brand {
        top: 1rem;
        left: 1rem;
    }

    .mobile-brand .juno-logo {
        width: 150px;
    }

    .account-logo {
        max-height: 52px;
    }

    .form-container {
        padding: 1.25rem;
        border-radius: 1.35rem;
    }

    .login-card-header {
        margin-bottom: 1.45rem;
    }

    .login-heading {
        font-size: 1.85rem;
    }

    .login-options {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.8rem;
    }
}
