:root {
    --login-navy: #050f24;
    --login-navy-mid: #0b162c;
    --login-teal: #10b981;
    --login-teal-dark: #059669;
    --login-teal-light: #10b981;
    --login-panel-bg: #f4f7fb;
    --login-input-bg: #eef3f8;
    --login-text-muted: #6b7a90;
    --login-text-light: #94a3b8;
    --login-heading: #0f2744;
    --login-footer-height: 64px;
}

html.login-html,
html.login-html body {
    height: 100%;
    overflow: hidden;
}

body.login-page {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--login-panel-bg);
    color: #334155;
}

.login-main {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100% - var(--login-footer-height));
    overflow: hidden;
}

.login-split-row {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.login-split-row > [class*="col-"] {
    height: 100%;
    min-height: 0;
}

/* ── Left brand panel ── */
.panel-brand {
    background: linear-gradient(165deg, var(--login-navy) 0%, var(--login-navy-mid) 55%, #0d1a30 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 2rem;
    height: 100%;
    min-height: 0;
}

.brand-wave {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 42%;
    pointer-events: none;
    z-index: 0;
}

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

.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.25rem;
    border-radius: 22px;
    border: 2px solid rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.12);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon svg {
    width: 42px;
    height: 42px;
    color: #fff;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.45));
}

.brand-header h1 {
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: #fff;
}

.brand-header h1 .brand-accent {
    color: var(--login-teal-light);
}

.brand-header p {
    font-size: 0.95rem;
    color: var(--login-text-light);
    line-height: 1.6;
    margin: 0;
}

.brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.brand-features li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent;
    border: 1.5px solid var(--login-teal-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feat-icon i {
    font-size: 1.15rem;
    color: var(--login-teal-light);
}

.feat-text h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #fff;
}

.feat-text p {
    font-size: 0.88rem;
    color: var(--login-text-light);
    line-height: 1.5;
    margin: 0;
}

/* ── Right form panel ── */
.panel-form {
    background: var(--login-panel-bg);
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.login-form-wrap {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-top: 3.25rem;
    padding-bottom: 1rem;
}

.utility-bar {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1.35rem 1.75rem;
    z-index: 5;
}

.lang-select {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-select:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--login-heading);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    padding: 2rem 2rem;
    border: 1px solid rgba(15, 23, 42, 0.04);
    max-height: 100%;
}

.auth-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: rgba(21, 165, 113, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon i {
    font-size: 1.65rem;
    color: var(--login-teal);
}

.auth-card h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--login-heading);
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
}

.auth-card .form-lead {
    text-align: center;
    font-size: 0.92rem;
    color: var(--login-text-muted);
    margin-bottom: 1.5rem;
}

.alert-validation {
    display: none;
    align-items: flex-start;
    gap: 0.6rem;
    background: #fef2f2;
    border-left: 3px solid #dc3545;
    border-radius: 0.4rem;
    padding: 0.75rem 1rem;
    font-size: 0.84rem;
    color: #991b1b;
    margin-bottom: 1.25rem;
}

.alert-validation.show {
    display: flex;
}

.alert-errors {
    font-size: 0.84rem;
    border-radius: 0.4rem;
    margin-bottom: 1.25rem;
}

.login-page .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--login-heading);
    margin-bottom: 0.4rem;
}

.input-wrap {
    position: relative;
}

.input-wrap .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.05rem;
    pointer-events: none;
    z-index: 2;
}

.input-wrap .toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: #94a3b8;
    font-size: 1.05rem;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    transition: color 0.2s ease;
}

.input-wrap .toggle-pw:hover {
    color: #64748b;
}

.login-page .form-control {
    border: 1px solid #dbe3ec;
    border-radius: 0.5rem;
    padding: 0.72rem 1rem 0.72rem 2.75rem;
    font-size: 0.95rem;
    color: #334155;
    background: var(--login-input-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-page .form-control.pw-input {
    padding-right: 2.75rem;
}

.login-page .form-control:focus {
    border-color: var(--login-teal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(21, 165, 113, 0.12);
}

.login-page .form-control::placeholder {
    color: #94a3b8;
}

.form-options {
    display: flex;
    align-items: center;
}

.login-page .form-check-input {
    width: 1rem;
    height: 1rem;
    border-color: #cbd5e1;
    cursor: pointer;
}

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

.login-page .form-check-input:focus {
    border-color: var(--login-teal);
    box-shadow: 0 0 0 0.2rem rgba(21, 165, 113, 0.2);
}

.login-page .form-check-label {
    font-size: 0.88rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.btn-brand {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--login-teal);
    border: none;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.btn-brand:hover {
    background: var(--login-teal-dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(21, 165, 113, 0.28);
    transform: translateY(-1px);
}

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

.or-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.1rem 0;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.or-divider span {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: lowercase;
}

.btn-sso {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1.5px solid var(--login-teal);
    border-radius: 0.5rem;
    color: var(--login-heading);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-decoration: none;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.btn-sso:hover {
    background: rgba(21, 165, 113, 0.06);
    border-color: var(--login-teal-dark);
    color: var(--login-heading);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(21, 165, 113, 0.12);
}

.btn-sso i {
    color: var(--login-teal);
    font-size: 1.05rem;
}

.login-coming-soon-modal {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.15);
}

.login-coming-soon-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--login-teal);
    font-size: 1.5rem;
}

.login-coming-soon-modal .modal-title {
    font-weight: 700;
    color: var(--login-heading);
}

.login-coming-soon-modal .btn-brand {
    width: auto;
    min-width: 120px;
}

.site-footer {
    flex: 0 0 var(--login-footer-height);
    height: var(--login-footer-height);
    text-align: center;
    padding: 0.75rem 1rem;
    color: #64748b;
    font-size: 0.82rem;
    background: var(--login-panel-bg);
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.site-footer .foot-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--login-heading);
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.site-footer .foot-brand i {
    color: var(--login-teal);
    font-size: 1.1rem;
}

/* ── Animations ── */
@keyframes loginFadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginFadeInRight {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginScaleIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loginGlowPulse {
    0%, 100% {
        box-shadow: 0 0 28px rgba(16, 185, 129, 0.25);
    }
    50% {
        box-shadow: 0 0 36px rgba(16, 185, 129, 0.42);
    }
}

.animate-brand-header {
    animation: loginFadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-brand-feature {
    animation: loginFadeInUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-brand-feature:nth-child(1) { animation-delay: 0.15s; }
.animate-brand-feature:nth-child(2) { animation-delay: 0.3s; }
.animate-brand-feature:nth-child(3) { animation-delay: 0.45s; }

.animate-auth-card {
    animation: loginScaleIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.animate-form-panel {
    animation: loginFadeInRight 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-icon {
    animation: loginGlowPulse 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .animate-brand-header,
    .animate-brand-feature,
    .animate-auth-card,
    .animate-form-panel,
    .brand-icon {
        animation: none !important;
    }

    .btn-brand:hover,
    .btn-sso:hover {
        transform: none;
    }
}

@media (max-height: 820px) and (min-width: 992px) {
    .panel-brand {
        padding: 1.25rem 1.5rem;
    }

    .brand-header {
        margin-bottom: 1.25rem;
    }

    .brand-header h1 {
        font-size: 2rem;
    }

    .brand-icon {
        width: 72px;
        height: 72px;
        margin-bottom: 1rem;
    }

    .brand-features {
        gap: 0.85rem;
    }

    .auth-card {
        padding: 1.5rem 1.75rem;
    }

    .auth-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 0.85rem;
    }

    .auth-icon i {
        font-size: 1.4rem;
    }

    .auth-card h2 {
        font-size: 1.5rem;
    }

    .auth-card .form-lead {
        margin-bottom: 1rem;
    }

    .login-form-wrap {
        padding-top: 2.75rem;
    }
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    :root {
        --login-footer-height: 56px;
    }

    html.login-html,
    html.login-html body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.login-page {
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-main {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 0;
        overflow: visible;
    }

    .login-split-row {
        height: auto !important;
        min-height: 0;
    }

    .login-split-row > [class*="col-"] {
        height: auto;
        min-height: 0;
    }

    .panel-brand {
        padding: 1.75rem 1.5rem 2rem;
    }

    .panel-form {
        min-height: 0;
        flex: 1 1 auto;
    }

    .login-form-wrap {
        height: auto;
        min-height: 0;
        overflow: visible;
        align-items: stretch !important;
        padding-top: 0.5rem;
        padding-bottom: 1.25rem;
    }

    .utility-bar {
        position: relative;
        display: flex;
        justify-content: flex-end;
        padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem 0;
    }

    .auth-card {
        max-height: none;
        margin-inline: auto;
    }

    .brand-content {
        max-width: 520px;
        margin-inline: auto;
    }

    .brand-header {
        margin-bottom: 1.25rem;
    }

    .brand-header h1 {
        font-size: 1.85rem;
    }

    .brand-icon {
        width: 68px;
        height: 68px;
        margin-bottom: 1rem;
    }

    .brand-icon svg {
        width: 34px;
        height: 34px;
    }

    .brand-features {
        gap: 0.9rem;
    }

    .feat-text p {
        font-size: 0.84rem;
    }

    .animate-form-panel {
        animation-name: loginFadeInUp;
    }
}

@media (max-width: 767.98px) {
    .panel-brand {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .brand-wave {
        height: 32%;
    }

    .brand-header {
        margin-bottom: 1rem;
    }

    .brand-header h1 {
        font-size: 1.65rem;
    }

    .brand-header p {
        font-size: 0.88rem;
    }

    .brand-features {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .brand-features li {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.45rem;
    }

    .feat-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .feat-icon i {
        font-size: 1rem;
    }

    .feat-text h3 {
        font-size: 0.82rem;
        margin-bottom: 0;
    }

    .feat-text p {
        display: none;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 1rem;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
    }

    .auth-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 1rem;
    }

    .auth-icon i {
        font-size: 1.4rem;
    }

    .auth-card h2 {
        font-size: 1.45rem;
    }

    .auth-card .form-lead {
        font-size: 0.88rem;
        margin-bottom: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    :root {
        --login-footer-height: 52px;
    }

    .utility-bar {
        padding: 0.65rem 0.75rem 0;
    }

    .login-form-wrap {
        padding-inline: 0.75rem !important;
        padding-bottom: 1rem;
    }

    .auth-card {
        padding: 1.35rem 1rem;
        border-radius: 0.85rem;
    }

    .auth-card h2 {
        font-size: 1.35rem;
    }

    .panel-brand {
        padding: 1.25rem 1rem 1.5rem;
    }

    .brand-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .brand-header h1 {
        font-size: 1.5rem;
    }

    .brand-features {
        gap: 0.5rem;
    }

    .feat-icon {
        width: 32px;
        height: 32px;
    }

    .feat-text h3 {
        font-size: 0.76rem;
    }

    .site-footer {
        font-size: 0.76rem;
        padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    }

    .site-footer .foot-brand {
        font-size: 0.82rem;
    }
}

@media (max-width: 399.98px) {
    .lang-select span {
        display: none;
    }

    .auth-card {
        padding: 1.15rem 0.85rem;
    }

    .login-page .form-control {
        font-size: 16px;
        padding-top: 0.68rem;
        padding-bottom: 0.68rem;
    }
}

@media (max-width: 991.98px) and (max-height: 480px) {
    .panel-brand {
        padding: 1rem 1.25rem;
    }

    .brand-header {
        margin-bottom: 0.75rem;
    }

    .brand-header p,
    .brand-features {
        display: none;
    }

    .brand-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.65rem;
    }

    .auth-card {
        padding: 1.15rem 1rem;
    }

    .auth-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }

    .auth-card .form-lead {
        margin-bottom: 0.85rem;
    }
}
