﻿/* ============================================
   auth-modal.css
   Стили модального окна аутентификации
   ============================================ */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal {
    background: var(--background-color-blue-30, #e3e7ea);
    border-radius: 24px;
    padding: 16px;
    width: 100%;
    max-width: 356px;
    min-height: 408px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    z-index: 1;
}

    .auth-close:hover {
        background: var(--background-color-blue-40, #d4dade);
    }

    .auth-close img {
        width: 20px;
        height: 20px;
    }

.auth-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.auth-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.auth-title {
    color: var(--text-color-black-100, #1c1f26);
    text-align: center;
    font-family: 'OpenRunde-Bold', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 150%;
    letter-spacing: -0.011em;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 316px;
}

.auth-description {
    color: var(--text-color-black-60, #77797d);
    text-align: center;
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 150%;
    letter-spacing: -0.011em;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-input {
    background: var(--background-color-blue-20, #f4f6f7);
    border-radius: 16px;
    padding: 8px 16px;
    height: 40px;
    border: none;
    outline: none;
    font-family: 'OpenRunde-Regular', sans-serif;
    font-size: 14px;
    color: var(--text-color-black-100, #1c1f26);
    width: 100%;
}

    .auth-input::placeholder {
        color: var(--text-color-black-40, #a4a5a8);
    }

    .auth-input:focus {
        box-shadow: 0 0 0 2px var(--background-color-blue-60, #a8b4be);
    }

.auth-error {
    color: var(--background-color-red-100, #b50042);
    font-family: 'OpenRunde-Regular', sans-serif;
    font-size: 12px;
    padding: 8px 0;
    display: none;
    text-align: center;
}

    .auth-error.visible {
        display: block;
        animation: shake 0.3s ease-in-out;
    }

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.auth-submit-btn {
    background: var(--background-color-blue-40, #d4dade);
    border-radius: 16px;
    padding: 8px 16px;
    height: 40px;
    border: none;
    cursor: pointer;
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color-black-60, #77797d);
    width: 100%;
    transition: background 0.2s ease, color 0.2s ease;
}

    .auth-submit-btn:not(:disabled) {
        background: var(--background-color-blue-100, #26445c);
        color: var(--text-color-black-10, #f4f4f4);
    }

        .auth-submit-btn:not(:disabled):hover {
            background: var(--background-color-blue-80, #51697d);
        }

.auth-submit-btn--primary {
    background: var(--background-color-blue-100, #26445c) !important;
    color: var(--text-color-black-10, #f4f4f4) !important;
}

    .auth-submit-btn--primary:hover {
        background: var(--background-color-blue-80, #51697d) !important;
    }

/* Чекбокс согласия */
.auth-consent {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: center;
}

.auth-checkbox-label {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .auth-checkbox-label input[type="checkbox"] {
        display: none;
    }

.auth-checkbox-custom {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--background-color-blue-60, #a8b4be);
    display: block;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-checkbox-label input[type="checkbox"]:checked + .auth-checkbox-custom {
    background: var(--background-color-blue-100, #26445c);
    border-color: var(--background-color-blue-100, #26445c);
}

    .auth-checkbox-label input[type="checkbox"]:checked + .auth-checkbox-custom::after {
        content: '';
        position: absolute;
        left: 4px;
        top: 1px;
        width: 5px;
        height: 9px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

.auth-consent-text {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    font-family: 'OpenRunde-Regular', sans-serif;
    font-size: 10px;
    color: var(--text-color-black-60, #77797d);
}

.auth-link {
    color: var(--text-color-black-60, #77797d);
    text-decoration: underline;
    font-family: 'OpenRunde-Regular', sans-serif;
    font-size: 10px;
}

    .auth-link:hover {
        color: var(--text-color-black-100, #1c1f26);
    }

/* Нижняя ссылка */
.auth-register {
    padding: 4px 0;
    text-align: center;
}

.auth-link-underline {
    color: var(--text-color-black-60, #77797d);
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}

    .auth-link-underline:hover {
        color: var(--text-color-black-100, #1c1f26);
    }

/* Состояние 2: Ввод кода */
.auth-code-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.auth-code-sent {
    text-align: center;
    font-family: 'OpenRunde-Regular', sans-serif;
    font-size: 12px;
    color: var(--text-color-black-60, #77797d);
}

.auth-email-highlight {
    color: var(--text-color-black-100, #1c1f26);
}

.auth-timer {
    color: var(--text-color-black-60, #77797d);
    text-align: center;
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.auth-code-inputs {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.auth-code-group {
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.auth-code-input {
    background: var(--background-color-blue-20, #f4f6f7);
    border-radius: 16px;
    width: 40px;
    height: 40px;
    border: none;
    text-align: center;
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 16px;
    color: var(--text-color-black-40, #a4a5a8);
    outline: none;
}

    .auth-code-input:focus {
        box-shadow: 0 0 0 2px var(--background-color-blue-60, #a8b4be);
    }

    .auth-code-input.filled {
        color: var(--text-color-black-100, #1c1f26);
    }

/* Состояние 3: Успех */
.auth-success-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.auth-success-text {
    color: var(--text-color-black-60, #77797d);
    text-align: center;
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.auth-email-display {
    color: var(--text-color-black-100, #1c1f26);
    text-align: center;
    font-family: 'OpenRunde-Medium', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 480px) {
    .auth-modal {
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 24px 16px;
        justify-content: flex-start;
        padding-top: 80px;
    }

    .auth-close {
        top: 16px;
        right: 16px;
    }
}
