* {
    box-sizing: border-box;
}

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

body.auth-page {
    margin: 0;
    min-height: 100vh;
    color: #f8fafc;
    background: #050609;
    font-family: Inter, Arial, "Helvetica Neue", sans-serif;
}

button,
.auth-submit,
.auth-tabs,
.auth-tabs::before,
.auth-tabs button {
    border-radius: 6px !important;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 2fr;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.42) saturate(1.02);
    transform: scale(1.01);
}

.auth-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 28%, rgba(43, 72, 122, .12), transparent 36%), rgba(0, 0, 0, .16);
    pointer-events: none;
}

.auth-side {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 24px 40px 40px;
    background: rgba(10, 12, 16, .62);
    backdrop-filter: blur(8px);
    border-right: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-brand {
    align-self: center;
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 850;
    letter-spacing: 0;
}

.auth-brand img {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
}

.auth-center {
    flex: 1;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 360px);
    display: grid;
    gap: 24px;
}

.auth-header {
    display: grid;
    gap: 8px;
    text-align: center;
}

.auth-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-header p {
    margin: 0;
    color: rgba(248, 250, 252, .70);
    font-size: 14px;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.auth-register-form {
    gap: 16px;
}

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

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

.auth-form label {
    min-width: 0;
    color: #f8fafc;
    display: grid;
    gap: 9px;
    font-size: 14px;
    font-weight: 600;
}

.auth-form input:not([type="checkbox"]) {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 7px;
    padding: 0 12px;
    color: #f8fafc;
    background: rgba(18, 20, 25, .48);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    outline: none;
    font: inherit;
    font-size: 14px;
}

.auth-form input::placeholder {
    color: rgba(248, 250, 252, .42);
}

.auth-form input:not([type="checkbox"]):focus {
    border-color: rgba(255, 255, 255, .42);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}

.auth-tabs {
    position: relative;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 9px;
    padding: 3px;
    background: rgba(18, 20, 25, .40);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    overflow: hidden;
}

.auth-tabs::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: calc((100% - 12px) / 3);
    height: calc(100% - 6px);
    border-radius: 6px;
    background: rgba(255, 255, 255, .10);
    box-shadow: 0 1px 8px rgba(0, 0, 0, .18);
    transition: transform .24s ease;
}

.auth-tabs[data-active-mode="phone"]::before {
    transform: translateX(calc(100% + 3px));
}

.auth-tabs[data-active-mode="email"]::before {
    transform: translateX(calc((100% + 3px) * 2));
}

.auth-tabs button {
    position: relative;
    z-index: 1;
    border: 0;
    border-radius: 6px;
    color: rgba(248, 250, 252, .66);
    background: transparent;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: color .2s ease;
}

.auth-tabs button.is-active {
    color: #f8fafc;
}

.auth-check {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px;
    color: rgba(248, 250, 252, .88);
    font-size: 14px;
}

.auth-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #f8fafc;
}

.auth-submit {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 7px;
    padding: 0 16px;
    color: #101114;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.auth-submit.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.auth-submit.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 17, 20, .22);
    border-top-color: #101114;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -8px 0 0 -8px;
    animation: auth-button-spin .75s linear infinite;
}

.auth-submit:hover {
    background: #e8edf4;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-notice {
    border: 1px solid rgba(255, 126, 148, .34);
    border-radius: 10px;
    padding: 11px 12px;
    color: #ffd0d8;
    background: rgba(128, 22, 42, .22);
    font-size: 13px;
    line-height: 1.45;
}

.auth-notice-success {
    border-color: rgba(94, 207, 130, .35);
    color: #d7f7e0;
    background: rgba(31, 113, 57, .2);
}

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

.auth-reset-button {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 8px;
    color: rgba(248, 250, 252, .72);
    background: rgba(255, 255, 255, .035);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.auth-reset-button:hover {
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.auth-reset-button:disabled {
    opacity: .55;
    cursor: wait;
}

.auth-divider {
    margin: 16px 0;
    color: rgba(248, 250, 252, .52);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: rgba(255, 255, 255, .12);
    flex: 1;
}

.auth-arisid {
    width: 100%;
    justify-content: center;
}

@keyframes auth-button-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-side {
        width: min(100%, 480px);
        padding: 24px;
    }
}

@media (max-width: 620px) {
    .auth-shell {
        display: block;
    }

    .auth-side {
        width: 100%;
        min-height: 100vh;
        padding: 20px;
    }

    .auth-card {
        width: 100%;
    }

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