html.auth-bg,
body.auth-bg {
    min-height: 100svh;
}

body.auth-bg {
    margin: 0;
    overflow-y: auto;
}

#m_login {
    min-height: 100svh;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
    box-sizing: border-box;
}

.login-layout {
    width: min(480px, 100%);
    margin-block: auto;
}

.login-brand-panel,
.login-form-panel {
    position: relative;
    min-height: 0;
    height: 100%;
    border-radius: 1.4rem;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.35rem;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.52) 36%, rgba(211, 238, 244, 0.42) 100%),
        linear-gradient(160deg, #d7edf2 0%, #f5fbfc 100%);
}

.login-brand-panel__image-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-brand-panel__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

.login-brand-panel__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0.34) 100%);
}

.login-brand-panel__footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.login-version-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 310px;
    padding: 0.75rem 0.9rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.8);
    color: #5f6b7a;
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.16);
}

.login-version-badge__text {
    font-size: 0.76rem;
    font-weight: 700;
}

.login-form-panel__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-field {
    position: relative;
}

.login-field .field-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.login-field .form-control {
    height: 45px;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.94);
    color: #1f2937;
    padding: 0 1rem 0 2.9rem;
    box-shadow: none;
}

.login-field .form-control:focus {
    border-color: #04acae;
    background: #ffffff;
    box-shadow: 0 0 0 0.18rem rgba(4, 172, 174, 0.14);
}

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

.login-year-select {
    padding-left: 1rem !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.login-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.12rem 0 0.65rem;
    flex-wrap: wrap;
}

.login-meta-row .m-checkbox > input:checked ~ span {
    border-color: #2d949e !important;
    background: #2d949e !important;
}

.login-form-title .highlight {
  color: #f08519;
}

.login-link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

.login-link:hover,
.login-link:focus {
    color: #0a5f8a;
    text-decoration: none;
}

.login-primary-btn {
    width: 100%;
    max-width: 240px;
    min-height: 44px;
    margin: 2rem auto 0;
    display: block;
    border: 0;
    border-radius: 1rem;
    background: linear-gradient(135deg, #39b5c1 0%, #2d949e 100%) !important;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(57, 181, 193, 0.24);
    cursor: pointer;
}

.login-secondary-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.55rem;
    flex-wrap: wrap;
}

.login-secondary-btn {
    flex: 1 1 0;
    min-height: 40px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    padding: 0.52rem 0.78rem;
}

.login-secondary-btn--warn {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border: 0;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.2);
}

.login-registration-prompt {
    margin-top: 1.5rem;
    text-align: center;
    color: #3f4047;
    font-size: 0.88rem;
}

.login-registration-prompt label {
    margin-bottom: 0;
    color: inherit;
}

.login-registration-link {
    margin-left: 0.25rem;
    color: #f08519;
    font-weight: 700;
    text-decoration: none;
}

.login-registration-link:hover,
.login-registration-link:focus {
    color: #d96f10;
    text-decoration: none;
}

.login-help-box {
    margin-top: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.58rem 0.68rem;
    border-radius: 1rem;
    background: #f8fbfd;
    border: 1px solid #d8e9ec;
    color: #4b5563;
    font-size: 0.76rem;
    line-height: 1.32;
}

.login-help-box i {
    color: #04acae;
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

.login-version-text {
    margin-top: 0.7rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
}

.login-form .form-group {
    margin-bottom: 0.85rem;
}

.login-form-panel {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    padding: 1.35rem 1.3rem 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: auto;
    min-height: 0;
}

.login-form-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.86)),
        url('../../app/media/img/login-card-bg.png') no-repeat center top;
    background-size: cover;
    opacity: 0.34;
    pointer-events: none;
}

.login-form-header {
    text-align: center;
    margin-bottom: 0.95rem;
}

.login-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

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

.login-logo--ma {
    height: 66px;
}

.login-logo--esadewa {
    height: 70px;
}

.login-logo-separator {
    width: 1px;
    height: 62px;
    background: #d7e1e8;
    display: block;
}

.login-form-title {
    color: #1e293b;
    font-size: 1.18rem;
    line-height: 1.15;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

@media (max-width: 991.98px) {
    body.auth-bg {
        overflow-y: auto;
    }

    #m_login {
        height: auto;
        min-height: 100svh;
        padding: 1rem 0.75rem;
        align-items: flex-start;
        overflow: visible;
    }

    .login-layout {
        width: min(100%, 460px);
    }

    .login-form-panel {
        padding: 1.2rem 1rem;
    }

    .login-form-panel__inner {
        width: 100%;
        min-height: auto;
    }

    #m_login {
        overflow: visible;
    }
}

@media (max-width: 575.98px) {
    #m_login {
        padding: 0.75rem;
    }

    .login-logo-row {
        gap: 0.75rem;
    }

    .login-logo--ma {
        height: 50px;
    }

    .login-logo--esadewa {
        height: 54px;
    }

    .login-logo-separator {
        height: 48px;
    }

    .login-form-title {
        font-size: 1.05rem;
    }
}
