:root {
    --auth-navy: #0a1628;
    --auth-navy-mid: #112240;
    --auth-navy-light: #0d2952;
    --auth-gold: #c9a84c;
    --auth-gold-light: #e8c97a;
    --auth-gold-pale: #f5e6c3;
    --auth-cream: #faf8f3;
    --auth-text: #0d1b2a;
    --auth-muted: #55556a;
    --auth-border: #e8e8ec;
    --auth-success: #1db86d;
    --auth-shadow-sm: 0 2px 8px rgba(10, 22, 40, 0.08);
    --auth-shadow-md: 0 8px 24px rgba(10, 22, 40, 0.14);
    --auth-shadow-lg: 0 20px 50px rgba(10, 22, 40, 0.2);
    --auth-shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.25);
}

body.login-page,
body.register-page,
body.password-page,
body.lockscreen {
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg, var(--auth-navy) 0%, var(--auth-navy-light) 100%);
    position: relative;
    overflow-x: hidden;
}

body.register-page {
    align-items: flex-start;
    overflow-y: auto;
    padding: 0;
}

body.login-page::before,
body.register-page::before,
body.password-page::before,
body.lockscreen::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 30%, rgba(201, 168, 76, 0.14) 0%, transparent 38%),
        radial-gradient(circle at 86% 10%, rgba(232, 201, 122, 0.12) 0%, transparent 32%);
}

.auth-page-shell {
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.auth-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    background: #f4efe4;
}

body.register-page .auth-layout {
    min-height: 100vh;
}

.auth-form-panel {
    position: relative;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 3rem clamp(1.5rem, 5vw, 5rem);
    background: #f4efe4;
}

.auth-shell {
    width: min(1080px, calc(100vw - 1.5rem));
    border-radius: 20px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 0.95fr 1fr;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--auth-shadow-lg);
    position: relative;
    z-index: 1;
}

body.register-page .auth-shell {
    width: min(1200px, calc(100vw - 1.5rem));
    grid-template-columns: 1fr 1fr;
}

.auth-visual {
    min-height: 100vh;
    background: linear-gradient(155deg, var(--auth-navy) 0%, var(--auth-navy-light) 100%);
    padding: clamp(3rem, 7vw, 7rem);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(232, 201, 122, 0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.auth-visual::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    left: -125px;
    bottom: -145px;
    pointer-events: none;
    border: 1px solid rgba(232, 201, 122, 0.28);
    border-radius: 50%;
    box-shadow:
        0 0 0 58px rgba(232, 201, 122, 0.07),
        0 0 0 116px rgba(232, 201, 122, 0.035);
}

.auth-visual > * {
    position: relative;
    z-index: 1;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.38rem 0.78rem;
    margin-bottom: 1.15rem;
    background: rgba(232, 201, 122, 0.18);
    color: var(--auth-gold-light);
    border: 1px solid rgba(232, 201, 122, 0.26);
}

.auth-visual h2 {
    color: #ffffff;
    font-family: "Playfair Display", serif;
    font-size: clamp(1.65rem, 2vw, 2rem);
    margin-bottom: 0.7rem;
    line-height: 1.2;
}

.auth-visual p {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.7;
    margin-bottom: 1.4rem;
}

.auth-visual-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.auth-visual-stat {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 0.85rem;
    min-width: 120px;
}

.auth-visual-stat strong {
    display: block;
    color: var(--auth-gold-light);
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.24rem;
}

.auth-visual-stat span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.58);
}

.auth-visual-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.auth-visual-points li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
}

.auth-visual-points i {
    color: var(--auth-gold-light);
}

.auth-visual-quote {
    margin-top: 1.2rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(232, 201, 122, 0.28);
    background: rgba(232, 201, 122, 0.1);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.84rem;
    font-style: italic;
}

.auth-visual-quote-author {
    display: block;
    margin-top: 0.35rem;
    text-align: right;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
    font-style: normal;
}

.login-box,
.register-box,
.password-box {
    width: 100%;
    margin: 0 !important;
    max-width: 520px;
    padding: 0;
    position: relative;
    z-index: 1;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.register-box {
    align-items: stretch;
    max-width: 680px;
}

.login-logo,
.register-logo,
.password-logo {
    text-align: center;
    margin-bottom: 1.15rem;
}

.auth-page-heading {
    width: min(460px, 100%);
    margin: 0 auto 1rem;
    text-align: center;
}

.register-box .auth-page-heading {
    width: 100%;
}

.auth-page-heading h3 {
    margin: 0;
    color: var(--auth-navy);
    font-family: "Playfair Display", serif;
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
}

.login-logo a,
.register-logo a,
.password-logo a {
    color: var(--auth-text) !important;
    font-family: "Playfair Display", serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.login-box .card,
.register-box .card,
.password-box .card {
    width: min(460px, 100%);
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(10, 22, 40, 0.08);
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(10, 22, 40, 0.12);
}

.register-box .card {
    width: 100%;
    max-width: none;
    margin: 0;
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
}

.register-box .card-header,
.register-box .card-footer {
    flex: 0 0 auto;
}

.register-box .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 0.85rem;
}

.card-header,
.card-body,
.card-footer {
    background: #ffffff;
    border: 0;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}

.card-header {
    padding-top: 1.55rem;
    padding-bottom: 0.45rem;
}

.card-title {
    float: none !important;
    text-align: center;
    color: var(--auth-text);
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 1.42rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.register-auth-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.7rem;
}

.register-auth-form .auth-field {
    margin-bottom: 0;
}

.register-auth-form .register-submit-btn {
    grid-column: 1 / -1;
    margin-top: 0.25rem;
}

.auth-field {
    margin-bottom: 0.1rem;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-muted);
    margin-bottom: 0.28rem;
}

.auth-input-group .form-control {
    border: 1.5px solid var(--auth-border);
    border-radius: 10px 0 0 10px;
    height: 44px;
    font-size: 0.92rem;
    box-shadow: none;
}

.auth-input-group .input-group-text {
    border: 1.5px solid var(--auth-border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #fbfbfd;
    color: #9a9cb0;
}

.auth-input-group .form-control:focus {
    border-color: var(--auth-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.14);
}

.auth-input-group .form-control:focus + .input-group-append .input-group-text {
    border-color: var(--auth-gold);
}

.auth-box .btn,
.login-box .btn,
.register-box .btn,
.password-box .btn {
    border-radius: 10px;
    font-weight: 700;
}

.btn-primary,
.btn-flat.btn-primary {
    border: 0 !important;
    color: #ffffff !important;
    background: #1a3a6b !important;
}

.btn-primary:hover,
.btn-flat.btn-primary:hover,
.btn-primary:focus,
.btn-flat.btn-primary:focus {
    color: #ffffff !important;
    background: #16355f !important;
    box-shadow: 0 10px 20px rgba(10, 22, 40, 0.18) !important;
}

.auth-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.auth-meta-row .btn {
    min-width: 165px;
}

.auth-meta-row .icheck-primary {
    min-width: 0;
}

.icheck-primary label {
    font-size: 0.84rem;
    color: var(--auth-muted);
}

.auth-remember-wrap {
    margin-top: 0.15rem;
    margin-bottom: 0.55rem;
}

.icheck-primary > input:first-child:checked + label::before,
.icheck-primary > input:first-child:not(:checked):not(:disabled):hover + label::before {
    border-color: var(--auth-gold);
}

.icheck-primary > input:first-child:checked + label::after {
    background-color: var(--auth-gold);
    border-color: var(--auth-gold);
}

.card-footer {
    padding-top: 0.2rem;
    padding-bottom: 1.2rem;
}

.card-footer p {
    text-align: center;
    margin-bottom: 0.42rem;
}

.auth-footer-link a {
    font-size: 0.78rem;
    font-weight: 500;
}

.card-footer a,
.login-box a,
.register-box a,
.password-box a,
.lockscreen-wrapper a {
    color: #9a7718 !important;
    font-weight: 600;
    text-decoration: none;
}

.card-footer a:hover,
.login-box a:hover,
.register-box a:hover,
.password-box a:hover,
.lockscreen-wrapper a:hover {
    color: #7d620f !important;
}

.invalid-feedback strong {
    font-size: 0.8rem;
}

.alert {
    border-radius: 10px;
}

.lockscreen-wrapper {
    width: min(440px, 100%);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--auth-border);
    box-shadow: var(--auth-shadow-lg);
    padding: 1.35rem;
}

.lockscreen-logo {
    margin-bottom: 0.8rem;
    text-align: center;
}

.lockscreen-logo a {
    color: var(--auth-text) !important;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: 1.25rem;
}

.lockscreen-logo img {
    border-radius: 8px;
    margin-bottom: 8px;
}

.lockscreen-name {
    color: var(--auth-muted);
}

@media (max-width: 991.98px) {
    .auth-layout {
        min-height: auto;
        background: #f4efe4;
    }

    .auth-form-panel {
        min-height: 100vh;
        padding: 2rem 1.25rem;
    }

    .auth-shell {
        width: min(560px, calc(100vw - 1rem));
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .login-box,
    .register-box,
    .password-box {
        padding: 1rem;
    }

    .register-box .card {
        max-height: none;
    }

    .register-box .card-body {
        overflow-y: visible;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    body.login-page,
    body.register-page,
    body.password-page,
    body.lockscreen {
        padding: 0;
    }

    .auth-shell {
        width: calc(100vw - 0.4rem);
        border-radius: 12px;
    }

    .auth-form-panel {
        padding: 1.25rem 0.75rem;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .card-title {
        font-size: 1.06rem;
    }

    .auth-meta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-meta-row .btn {
        width: 100%;
        min-width: 0;
    }

    .auth-label {
        font-size: 0.78rem;
    }

    .auth-input-group .form-control {
        height: 41px;
        font-size: 0.88rem;
    }

    .register-auth-form {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}
