:root {
    color-scheme: dark;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 109, 61, .28), transparent 34%),
        radial-gradient(circle at 82% 0%, rgba(229, 57, 53, .18), transparent 30%),
        #151318;
}

.auth-card {
    width: min(100%, 430px);
    background: rgba(33, 30, 39, .92);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 30px;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
    backdrop-filter: blur(18px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
    text-decoration: none;
    margin-bottom: 16px;
}

.auth-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(255, 109, 61, .18);
}

.auth-card h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.auth-card .muted {
    color: rgba(255, 255, 255, .68);
}

.auth-card form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.auth-card label {
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    font-weight: 800;
    display: grid;
    gap: 8px;
}

.auth-card input:not([type="checkbox"]) {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .065);
    color: #fff;
    border-radius: 18px;
    padding: 15px 16px;
    font-size: 16px;
    outline: none;
}

.auth-card input:not([type="checkbox"]):focus {
    border-color: rgba(255, 109, 61, .72);
    box-shadow: 0 0 0 4px rgba(255, 109, 61, .12);
}

.auth-card input::placeholder {
    color: rgba(255, 255, 255, .34);
}

.auth-field-error {
    margin: 2px 0 0;
    color: #ff6b6b;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 850;
}

.auth-field-error[hidden] {
    display: none !important;
}

.auth-card input.is-invalid:not([type="checkbox"]) {
    border-color: rgba(255, 85, 85, .82);
    box-shadow: 0 0 0 4px rgba(255, 85, 85, .12);
}

.password-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.auth-card .password-input-wrap input:not([type="checkbox"]) {
    padding-right: 54px;
}

.password-toggle {
    appearance: none;
    position: absolute;
    top: 50%;
    right: 10px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, .58);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(255, 109, 61, .75);
    outline-offset: 2px;
}

.password-toggle:active {
    transform: translateY(-50%) scale(.96);
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle-icon-eye-off {
    display: none;
}

.password-toggle.is-visible .password-toggle-icon-eye {
    display: none;
}

.password-toggle.is-visible .password-toggle-icon-eye-off {
    display: block;
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 10px !important;
    align-items: flex-start;
    margin: 8px 0 2px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    font-weight: 700;
}

.check-row input {
    width: auto;
    min-width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #FF6D3D;
}

.check-row span {
    flex: 1;
}

.btn {
    border: 0;
    border-radius: 20px;
    padding: 15px 18px;
    min-height: 52px;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.btn:active {
    transform: scale(.98);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #FF6D3D, #E53935);
    box-shadow: 0 18px 40px rgba(229, 57, 53, .26);
}

.btn-primary:hover {
    filter: brightness(1.05);
}


.btn-google {
    width: 100%;
    margin-top: 18px;
    gap: 12px;
    color: #111827 !important;
    background: #fff;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

.btn-google:hover {
    filter: brightness(.98);
}

.auth-google-button {
    text-decoration: none !important;
}

.auth-google-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 950;
    font-size: 16px;
    line-height: 1;
    color: #4285F4;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, .14);
}

.auth-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 2px;
    color: rgba(255, 255, 255, .46);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}

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

.auth-divider span {
    padding: 0 12px;
}

.auth-google-legal {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.45;
}

.center {
    text-align: center;
}

.center a,
.auth-card a:not(.back-link) {
    color: #FF6D3D;
    font-weight: 900;
    text-decoration: none;
}

.auth-help {
    margin: -2px 0 2px;
    text-align: right;
    font-size: 13px;
}

.auth-error,
.auth-success {
    display: none;
    border-radius: 16px;
    padding: 12px 14px;
    color: #fff;
    margin-top: 14px;
}

.auth-error {
    background: rgba(229, 57, 53, .14);
    border: 1px solid rgba(229, 57, 53, .3);
}

.auth-success {
    background: rgba(52, 168, 83, .16);
    border: 1px solid rgba(52, 168, 83, .32);
}

.auth-error.is-visible,
.auth-success.is-visible {
    display: block;
}

@media (max-width: 420px) {
    .auth-shell {
        padding: 14px;
        align-items: stretch;
    }

    .auth-card {
        border-radius: 26px;
        padding: 20px;
        min-height: calc(100dvh - 28px);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}
