:root {
    --auth-ink: #1f2937;
    --auth-muted: #5d6878;
    --auth-line: #d8dee8;
    --auth-page: #eef2f5;
    --auth-paper: #ffffff;
    --auth-navy: #173a5e;
    --auth-navy-dark: #102b47;
    --auth-teal: #146c67;
    --auth-gold: #b7791f;
    --auth-link: #0f5f9c;
}

* {
    box-sizing: border-box;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-ink);
    background: var(--auth-page);
    font-family: "Source Sans Pro", Arial, sans-serif;
}

.auth-topbar {
    color: #ffffff;
    background: var(--auth-navy-dark);
    border-bottom: 4px solid var(--auth-gold);
}

.auth-width {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
}

.auth-topbar .auth-width {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-shell {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    min-height: calc(100vh - 70px);
    margin-top: 16px;
    margin-bottom: 16px;
    background: var(--auth-paper);
    border: 1px solid var(--auth-line);
    box-shadow: 0 8px 24px rgba(22, 38, 56, 0.08);
}

.auth-shell.auth-register {
    grid-template-columns: 320px minmax(0, 1fr);
}

.auth-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 28px;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(16, 43, 71, 0.94), rgba(20, 108, 103, 0.88)),
        url("../images/banner.jpg") center / cover;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.auth-brand strong,
.auth-brand small {
    display: block;
    line-height: 1.2;
}

.auth-brand strong {
    font-size: 1.08rem;
    font-weight: 700;
}

.auth-brand small {
    margin-top: 3px;
    color: #dcecf6;
}

.auth-side h1 {
    margin: 34px 0 10px;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.16;
}

.auth-side p {
    margin: 0;
    color: #e8f4f8;
    line-height: 1.55;
}

.auth-note {
    padding: 14px;
    border-left: 4px solid #f2c14e;
    background: rgba(255, 255, 255, 0.13);
    color: #fff6dd;
    font-weight: 600;
    line-height: 1.45;
}

.auth-main {
    padding: 34px;
    align-self: center;
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
    border: 1px solid var(--auth-line);
    background: #ffffff;
}

.auth-card.auth-card-wide {
    max-width: 760px;
}

.auth-card-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--auth-line);
    background: #f8fafc;
}

.auth-card-header h2 {
    margin: 0;
    color: var(--auth-navy-dark);
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-card-header p {
    margin: 5px 0 0;
    color: var(--auth-muted);
}

.auth-card-body {
    padding: 22px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label,
.auth-label {
    display: block;
    margin-bottom: 6px;
    color: #26364a;
    font-weight: 700;
}

.auth-field .form-control {
    min-height: 42px;
    border-color: #ccd6e2;
    border-radius: 0;
}

.auth-field .input-group-text {
    min-width: 44px;
    justify-content: center;
    color: var(--auth-navy);
    background: #eef4f8;
    border-color: #ccd6e2;
    border-radius: 0;
}

.captcha-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
}

.captcha-code {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    color: #1d3557;
    background: #fff9ea;
    border: 1px solid #d9bc77;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid var(--auth-navy);
    color: #ffffff;
    background: var(--auth-navy);
    font-weight: 700;
}

.auth-btn:hover,
.auth-btn:focus-visible {
    color: #ffffff;
    background: var(--auth-navy-dark);
    outline: none;
}

.auth-btn-secondary {
    color: var(--auth-navy);
    background: #ffffff;
}

.auth-btn-secondary:hover,
.auth-btn-secondary:focus-visible {
    color: var(--auth-navy-dark);
    background: #edf4fa;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-line);
}

.auth-links a,
.auth-inline-link {
    color: var(--auth-link);
    font-weight: 700;
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

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

.register-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.auth-error-block {
    margin-top: 12px;
}

.otp-modal .modal-content {
    border: 0;
    border-radius: 0;
    box-shadow: 0 18px 48px rgba(16, 43, 71, 0.24);
}

.otp-modal .modal-header {
    align-items: flex-start;
    color: #ffffff;
    background: var(--auth-navy);
    border-bottom: 4px solid var(--auth-gold);
}

.otp-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.otp-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--auth-navy);
    background: #ffffff;
}

.otp-title h5 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.otp-title span {
    display: block;
    margin-top: 2px;
    color: #dcecf6;
    font-size: 0.92rem;
}

.otp-modal .modal-body {
    padding: 24px;
}

.otp-modal .modal-footer {
    justify-content: space-between;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--auth-line);
}

.otp-input {
    max-width: 220px;
    min-height: 46px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 3px;
}

.otp-resend {
    color: #4a3106;
    background: #f3c96a;
    border-color: #d5a83f;
}

.otp-resend:hover,
.otp-resend:focus-visible {
    color: #3d2804;
    background: #e9bb52;
}

@media (max-width: 991.98px) {
    .auth-width {
        width: 100%;
    }

    .auth-topbar .auth-width {
        padding: 0 14px;
    }

    .auth-shell,
    .auth-shell.auth-register {
        grid-template-columns: 1fr;
        margin: 0;
        border-left: 0;
        border-right: 0;
    }

    .auth-side {
        min-height: auto;
    }

    .auth-side h1 {
        margin-top: 24px;
    }

    .auth-main {
        padding: 24px 14px;
    }
}

@media (max-width: 767.98px) {
    .register-grid {
        grid-template-columns: 1fr;
    }

    .auth-card-body {
        padding: 18px;
    }

    .auth-links,
    .register-footer,
    .otp-modal .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-actions,
    .auth-btn,
    .auth-btn-secondary,
    .otp-modal .modal-footer .btn {
        width: 100%;
    }

    .captcha-row {
        grid-template-columns: 1fr;
    }
}
