* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Nunito", Arial, sans-serif;
    color: #172033;
    background:
        linear-gradient(120deg, rgba(9, 18, 31, .86), rgba(19, 55, 73, .78)),
        var(--auth-bg, linear-gradient(135deg, #142033, #1c566d));
    background-size: cover;
    background-position: center;
}

.auth-shell {
    min-height: 100vh;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    align-items: center;
    padding: 24px 0;
}

.auth-card {
    width: 100%;
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(300px, .92fr) minmax(340px, 1.08fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 28px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 28px 75px rgba(0, 0, 0, .34);
}

.auth-card.compact {
    min-height: 560px;
    max-width: 980px;
    margin: 0 auto;
}

.auth-card.wide {
    grid-template-columns: .78fr 1.22fr;
    min-height: 680px;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 34px;
    color: #fff;
    background:
        linear-gradient(150deg, rgba(18, 28, 46, .88), rgba(6, 93, 130, .72)),
        var(--auth-panel-bg, transparent);
    background-size: cover;
    background-position: center;
}

.auth-visual:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 46%, rgba(0, 0, 0, .16));
    pointer-events: none;
}

.auth-brand,
.auth-hero {
    position: relative;
    z-index: 1;
}

.auth-logo {
    max-width: 190px;
    max-height: 76px;
    object-fit: contain;
    display: block;
    margin-bottom: 20px;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .2));
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .13);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.auth-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.05;
    font-weight: 900;
}

.auth-hero p {
    max-width: 440px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-size: 16px;
    line-height: 1.55;
}

.auth-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.auth-stat {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .18);
}

.auth-stat strong {
    display: block;
    font-size: 20px;
}

.auth-stat span {
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 5vw, 54px);
    background:
        radial-gradient(circle at top right, rgba(14, 116, 144, .12), transparent 34%),
        #f8fbff;
}

.auth-form.narrow {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

.auth-kicker {
    margin: 0 0 8px;
    color: #087aa0;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-title {
    margin: 0;
    color: #121a2a;
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.15;
    font-weight: 900;
}

.auth-subtitle {
    margin: 12px 0 26px;
    color: #5f6b7a;
    font-size: 15px;
    line-height: 1.55;
}

.auth-alert {
    margin: 0 0 16px;
    padding: 13px 15px;
    border-radius: 14px;
    font-weight: 800;
    border: 1px solid transparent;
}

.auth-alert.error {
    color: #9f1239;
    background: #fff1f2;
    border-color: #fecdd3;
}

.auth-alert.success {
    color: #166534;
    background: #ecfdf3;
    border-color: #bbf7d0;
}

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

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

.auth-field.full {
    grid-column: 1 / -1;
}

.auth-field label {
    display: block;
    margin: 0 0 7px;
    color: #253044;
    font-size: 13px;
    font-weight: 900;
}

.auth-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d7e1ec;
    border-radius: 14px;
    padding: 0 16px;
    color: #162033;
    background: #fff;
    font-size: 16px;
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.auth-input:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, .14);
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 18px;
    color: #526071;
    font-size: 14px;
    font-weight: 700;
}

.auth-button {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, #0f8bb4, #0f5e86);
    box-shadow: 0 16px 28px rgba(15, 94, 134, .24);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(15, 94, 134, .3);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e4ebf3;
}

.auth-links a {
    color: #0e7490;
    font-weight: 900;
    text-decoration: none;
}

.auth-links a:hover {
    color: #0f5e86;
    text-decoration: underline;
}

.auth-links-top {
    justify-content: flex-start;
    margin: 16px 0 18px;
    padding: 0;
    border-top: 0;
}

.auth-links-top a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #0f5e86;
    background: #e8f7fb;
    border: 1px solid #c8edf6;
    text-decoration: none;
}

.auth-links-top a:hover {
    color: #fff;
    background: #0f8bb4;
    border-color: #0f8bb4;
    text-decoration: none;
}

.auth-demo-form {
    margin-top: 12px;
}

.auth-demo-button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 15px;
    color: #7c2d12;
    background: linear-gradient(135deg, #fef3c7, #fdba74);
    box-shadow: 0 14px 24px rgba(249, 115, 22, .2);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.auth-demo-button:hover {
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .auth-shell {
        width: min(100% - 22px, 620px);
        padding: 12px 0;
    }

    .auth-card,
    .auth-card.wide {
        min-height: auto;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .auth-visual {
        min-height: 230px;
        padding: 22px;
    }

    .auth-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .auth-form {
        padding: 24px;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        width: 100%;
        padding: 0;
    }

    .auth-card,
    .auth-card.compact,
    .auth-card.wide {
        min-height: 100vh;
        border-radius: 0;
        border: 0;
    }

    .auth-visual {
        min-height: 190px;
    }

    .auth-logo {
        max-width: 150px;
        max-height: 58px;
        margin-bottom: 12px;
    }

    .auth-hero h1 {
        font-size: 28px;
    }

    .auth-stats {
        display: none;
    }

    .auth-form {
        justify-content: flex-start;
        padding: 22px 16px 26px;
    }

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