.login-page,
.register-page,
.password-reset-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1.35rem 0.75rem 0.75rem;
    margin: 0;
    width: 100%;
    background: #0d224f;
}

.login-page::before,
.register-page::before,
.password-reset-page::before {
    content: '';
    position: absolute;
    inset: -24px;
    background: url('../images/login-bg.jpg') center center / cover no-repeat;
    filter: blur(7px);
    transform: scale(1.06);
    z-index: 0;
}

.login-page::after,
.register-page::after,
.password-reset-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(10, 31, 72, 0.82), rgba(14, 58, 116, 0.7)),
        radial-gradient(circle at 88% 6%, rgba(255, 216, 130, 0.24), transparent 34%);
    z-index: 1;
}

.login-box,
.register-box,
.password-reset-box {
    width: min(420px, 100%);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.login-logo,
.register-logo,
.password-reset-logo {
    margin-bottom: 0.9rem;
    text-align: center;
    transform: translateY(6px);
}

.login-logo a,
.register-logo a,
.password-reset-logo a {
    color: #f8fbff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.3px;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}

.login-box .card,
.register-box .card,
.password-reset-box .card {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.38);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(3px);
}

.login-card-body,
.register-card-body,
.password-reset-card-body {
    padding: 1.15rem;
}

.card-header {
    padding: 0.7rem 1rem;
}

.card-header .card-title {
    color: #0d2b63;
    font-weight: 700;
    font-size: 1rem;
}

.card-footer a {
    color: #123a76;
    font-weight: 600;
}

.card-footer {
    padding: 0.8rem 1rem 0.95rem;
}

.input-group-text {
    background: #f1f5fb;
    border-color: #dbe5f4;
    color: #35598f;
}

.form-control {
    border-color: #dbe5f4;
}

.form-control:focus {
    border-color: #2f5ea8;
    box-shadow: 0 0 0 0.2rem rgba(47, 94, 168, 0.15);
}

.btn.btn-primary,
.btn-flat.btn-primary {
    border: 0;
    background: linear-gradient(110deg, #0f2f68, #1f57a8);
    box-shadow: 0 10px 20px rgba(16, 49, 105, 0.28);
    font-weight: 600;
}

.btn.btn-primary:hover,
.btn-flat.btn-primary:hover {
    background: linear-gradient(110deg, #0d2858, #18498f);
}

.brand-hero {
    margin: 0 auto 0.8rem;
    padding: 0.58rem 0.7rem;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(228, 239, 255, 0.98), rgba(246, 250, 255, 0.98)),
        linear-gradient(90deg, rgba(18, 58, 118, 0.08), rgba(255, 209, 102, 0.08));
    border: 1px solid rgba(47, 94, 168, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    text-align: center;
}

.brand-hero img {
    width: 92px;
    height: auto;
    filter: drop-shadow(0 7px 14px rgba(16, 40, 85, 0.22));
}

.brand-hero p {
    margin: 0.24rem 0 0;
    font-size: 0.76rem;
    color: #2f568f;
    font-weight: 700;
}

.auth-helper-copy {
    margin: 0 0 0.9rem;
    padding: 0.72rem 0.8rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(237, 243, 251, 0.98), rgba(248, 251, 255, 0.98));
    border: 1px solid rgba(47, 94, 168, 0.14);
    color: #45689f;
    font-size: 0.84rem;
    line-height: 1.45;
}

.auth-primary-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.auth-primary-action .btn {
    min-width: 172px;
    width: auto;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
    border-radius: 10px;
}

.auth-inline-note {
    color: #45689f;
    font-size: 0.84rem;
    line-height: 1.5;
}

.auth-inline-note .btn-link,
.auth-inline-note a {
    color: #123a76;
    font-weight: 700;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.auth-actions .remember-wrap {
    flex: 1 1 150px;
    min-width: 150px;
}

.auth-actions .submit-wrap {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
}

.login-box .btn,
.register-box .btn,
.password-reset-box .btn {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.auth-actions .submit-wrap .btn {
    min-width: 152px;
    width: auto;
    padding-left: 1.05rem;
    padding-right: 1.05rem;
    border-radius: 10px;
    letter-spacing: 0.01em;
}

.login-page .login-box,
.register-page .register-box,
.password-reset-page .password-reset-box {
    left: auto;
    right: auto;
}

@media (max-height: 760px) {
    .login-page,
    .register-page,
    .password-reset-page {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 0.9rem;
        overflow-y: auto;
    }

    .login-logo,
    .register-logo,
    .password-reset-logo {
        margin-bottom: 0.55rem;
        transform: translateY(2px);
    }

    .login-logo a,
    .register-logo a,
    .password-reset-logo a {
        font-size: 1.5rem;
    }

    .login-card-body,
    .register-card-body,
    .password-reset-card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .login-logo,
    .register-logo,
    .password-reset-logo {
        margin-bottom: 0.65rem;
        transform: translateY(0);
    }

    .login-logo a,
    .register-logo a,
    .password-reset-logo a {
        font-size: 1.35rem;
    }

    .login-card-body,
    .register-card-body,
    .password-reset-card-body {
        padding: 1rem;
    }

    .auth-actions {
        gap: 0.55rem;
    }

    .auth-actions .remember-wrap,
    .auth-actions .submit-wrap {
        flex-basis: 100%;
        min-width: 100%;
        margin-left: 0;
    }

    .auth-actions .submit-wrap .btn {
        width: 100%;
        min-width: 0;
    }

    .auth-primary-action {
        justify-content: stretch;
    }

    .auth-primary-action .btn {
        width: 100%;
        min-width: 0;
    }
}