.auth-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 8, 10, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9999;
}

.auth-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal__overlay {
    position: absolute;
    inset: 0;
}

.auth-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 18px;
    width: min(520px, calc(100% - 32px));
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(6, 9, 20, 0.23);
    padding: 32px;
}

.auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.auth-modal__header h3 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0.02em;
}

.auth-modal__header p {
    margin: 8px 0 24px;
    color: #5d5d5d;
    font-size: 15px;
}

.auth-modal__product {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9c7f3c;
}

.auth-modal__tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    padding: 4px;
    gap: 6px;
}

.auth-modal__tab {
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 10px 0;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-modal__tab.is-active {
    background: #111;
    color: #fff;
}

.auth-modal__body {
    margin-top: 28px;
}

.auth-form {
    display: none;
}

.auth-form.is-active {
    display: block;
}

.auth-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.auth-form__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.auth-field input {
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
    border-color: #111;
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.auth-field__error {
    min-height: 16px;
    font-size: 12px;
    color: #b3261e;
}

.auth-field--invalid input {
    border-color: #b3261e;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #3f3f3f;
}

.auth-form__message {
    min-height: 20px;
    margin: 10px 0;
    font-size: 14px;
    color: #b3261e;
}

.auth-form__message.is-success {
    color: #1d7a32;
}

.auth-form__submit {
    width: 100%;
    border: none;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 14px 18px;
    font-size: 16px;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-form__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.9s linear infinite;
    display: none;
}

.auth-form__submit.is-loading .auth-form__spinner {
    display: inline-block;
}

.auth-form__submit.is-loading span:first-child {
    opacity: 0.7;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .auth-modal__dialog {
        padding: 24px 20px;
    }

    .auth-modal__header h3 {
        font-size: 24px;
    }
}

