.auth {
    display: grid;
    grid-template-columns: 752fr 688fr;
    min-height: 100dvh;
    * {
        font-family: 'Wix Madefor Text', 'Inter', sans-serif;
        letter-spacing: 0;
    }
}
.auth .photo {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 32px;
    img {
        height: 100%;
        border-radius: 24px;
    }
}
.auth .body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 80px;
}
.auth .step {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    max-width: 416px;
    &.active {
        display: flex;
    }
}
.auth .card {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
    padding: 32px;
    border: 1px solid var(--border-5);
    border-radius: 24px;
    background: var(--bg-13);
}
.auth .titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    h1, h2 {
        font-size: 20px;
        font-weight: 600;
        line-height: 28px;
        letter-spacing: -0.3px;
    }
    p, span {
        font-size: 13px;
        line-height: 18px;
        color: var(--text-4);
    }
}
.auth .fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.auth form[name="code"] .fields {
    gap: 12px;
}
.auth form[data-channel="email"] span.phone, .auth form[data-channel="phone"] span.email, .auth form[name="login"][data-channel="email"] .field.phone, .auth form[name="login"][data-channel="phone"] .field.email {
    display: none;
}
.auth .tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-5);
    border-radius: 12px;
    button {
        padding: 8px 16px;
        border-radius: 8px;
        background: none;
        font-size: 13px;
        line-height: 18px;
        color: var(--text-10);
        transition: background 0.3s, color 0.3s;
        &.active {
            background: var(--bg-4);
            font-weight: 500;
            color: var(--text-1);
        }
    }
}
.auth .role {
    display: flex;
    flex-direction: column;
    gap: 6px;
    p {
        font-size: 13px;
        font-weight: 500;
        line-height: 18px;
        color: var(--text-4);
    }
}
.auth .name {
    display: flex;
    gap: 16px;
    .field {
        flex: 1;
        min-width: 0;
    }
}
.auth .row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    .field {
        width: 100%;
    }
}
.auth .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    label {
        font-size: 13px;
        font-weight: 500;
        line-height: 18px;
        color: var(--text-4);
    }
    .control {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 44px;
        padding: 0 12px;
        border: 1px solid var(--border-2);
        border-radius: 8px;
        transition: border-color 0.3s;
        &:focus-within {
            border-color: var(--border-8);
        }
    }
    input {
        flex: 1;
        min-width: 0;
        height: 100%;
        border: 0;
        background: none;
        font-size: 14px;
        line-height: 20px;
        &::placeholder {
            color: var(--text-10);
        }
        &:-webkit-autofill {
            -webkit-box-shadow: inset 0 0 0 50px var(--bg-13) !important;
            box-shadow: inset 0 0 0 50px var(--bg-13) !important;
            -webkit-text-fill-color: var(--text-1);
        }
    }
    .eye {
        order: 2;
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        background: var(--text-10);
        mask: url(../images/auth-eye.svg) center / contain no-repeat;
        &[aria-pressed="true"] {
            mask-image: url(../images/auth-eye-off.svg);
        }
    }
    .hint {
        font-size: 12px;
        line-height: 16px;
        color: var(--text-10);
        &:empty {
            display: none;
        }
    }
    &.error {
        .control, input {
            border-color: var(--border-9);
        }
        .control::before {
            content: '';
            order: 1;
            flex-shrink: 0;
            width: 18px;
            height: 18px;
            background: var(--text-12);
            mask: url(../images/auth-error.svg) center / contain no-repeat;
        }
        .hint {
            color: var(--text-12);
        }
    }
}
.auth .code {
    .cells {
        display: flex;
        gap: 12px;
    }
    input {
        flex: 1;
        width: 100%;
        height: 64px;
        border: 1px solid var(--border-2);
        border-radius: 8px;
        text-align: center;
        font-size: 20px;
        font-weight: 600;
        line-height: 28px;
        caret-color: var(--text-11);
        transition: border-color 0.3s, box-shadow 0.3s;
        &:focus {
            border-color: var(--border-8);
            box-shadow: inset 0 0 0 0.5px var(--border-8);
        }
    }
    &.error input {
        border-color: var(--border-9);
    }
}
.auth .resend {
    p {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        line-height: 18px;
        color: var(--text-10);
    }
    .timer::before {
        content: '\e008';
        font-family: 'icon';
        font-size: 16px;
        color: var(--text-10);
    }
    span {
        font: inherit;
        color: inherit;
    }
    .again, &.ended .timer {
        display: none;
    }
    &.ended .again {
        display: flex;
        align-items: center;
        gap: 4px;
    }
}
.auth .footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth .submit {
    height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--bg-8);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--text-5);
    transition: background 0.3s, color 0.3s, opacity 0.3s;
    &:disabled {
        background: var(--bg-15);
        color: var(--border-4);
        cursor: default;
    }
    &.loading {
        opacity: 0.6;
        pointer-events: none;
    }
}
.auth .consent, .auth .message {
    font-size: 12px;
    line-height: 16px;
    color: var(--text-10);
}
.auth .message {
    color: var(--text-12);
    &:empty {
        display: none;
    }
}
.auth .account, .auth .change {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
    line-height: 18px;
    color: var(--text-10);
    span {
        font: inherit;
        color: var(--text-4);
    }
}
.auth .link {
    padding: 2px 0;
    background: none;
    font-size: 13px;
    line-height: 18px;
    color: var(--text-11);
    text-underline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
    .auth .photo img {
        animation: auth-photo 1.2s cubic-bezier(0.65, 0, 0.35, 1) both;
    }
    .auth .step.active {
        animation: auth-rise 0.6s ease both;
    }
}
@keyframes auth-photo {
    from {
        clip-path: inset(0 0 100% 0 round 24px);
    }
    to {
        clip-path: inset(0 round 24px);
    }
}
@keyframes auth-rise {
    from {
        opacity: 0;
        translate: 0 24px;
    }
}
@media screen and (max-width: 1279px) {
    .auth .body {
        padding: 40px 48px;
    }
}
@media screen and (max-width: 1023px) {
    .auth {
        display: flex;
        flex-direction: column;
    }
    .auth .photo {
        position: static;
        height: auto;
        padding: 20px 16px 0;
        img {
            height: 280px;
            border-radius: 12px;
        }
    }
    .auth .body {
        flex: 1;
        align-items: flex-start;
        padding: 32px 16px 40px;
    }
}
@media screen and (max-width: 767px) {
    .auth .photo img {
        height: 200px;
    }
    .auth .body {
        padding: 20px 16px;
    }
    .auth .step {
        gap: 20px;
    }
    .auth .card {
        gap: 20px;
        padding: 20px;
    }
    .auth .titles :is(h1, h2) {
        font-size: 18px;
        line-height: 26px;
        letter-spacing: -0.2px;
    }
    .auth .fields {
        gap: 16px;
    }
    .auth .row {
        gap: 8px;
    }
    .auth .field .control, .auth .submit {
        height: 48px;
    }
    .auth .footer {
        gap: 12px;
    }
    .auth .code input {
        height: 56px;
    }
}
@media (hover: hover) {
    .auth .tabs button:not(.active):hover {
        color: var(--text-1);
    }
    .auth .field .control:not(:focus-within):hover {
        border-color: var(--border-4);
    }
    .auth .field.error .control:hover {
        border-color: var(--border-9);
    }
    .auth .submit:not(:disabled):hover {
        background: var(--bg-2);
    }
    .auth .link:hover {
        text-decoration: underline;
    }
}
