/* ============================================
   KLUKVA CAFE - AUTH MODAL STYLES
   ============================================ */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-modal__dialog {
    position: relative;
    max-width: 400px;
    width: calc(100% - 32px);
    margin: 10vh auto;
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}

.auth-modal.is-open .auth-modal__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Акцентная полоса сверху */
.auth-modal__dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #C8102E, #FF6900);
    border-radius: 20px 20px 0 0;
}

/* Мобильная версия - снизу экрана */
@media (max-width: 500px) {
    .auth-modal__dialog {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        transform: translateY(100%);
    }
    
    .auth-modal.is-open .auth-modal__dialog {
        transform: translateY(0);
    }
}

/* Кнопка закрытия */
.auth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 20px;
    line-height: 34px;
    text-align: center;
    color: #666;
    transition: all 0.2s;
}

.auth-modal__close:hover {
    background: #C8102E;
    color: #fff;
    transform: rotate(90deg);
}

/* Заголовки */
.auth-modal__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1a1a1a;
}

.auth-modal__subtitle {
    font-size: 13px;
    color: #777;
    margin: 0 0 18px;
}

/* Табы */
.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 12px;
}

.auth-tabs__btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #888;
    transition: all 0.2s;
}

.auth-tabs__btn:hover:not(.is-active) {
    color: #333;
    background: rgba(200, 16, 46, 0.05);
}

.auth-tabs__btn.is-active {
    background: linear-gradient(135deg, #C8102E, #FF6900);
    color: #fff;
    box-shadow: 0 3px 10px rgba(200, 16, 46, 0.3);
}

/* Контент табов */
.auth-tab {
    display: none;
    animation: authFade 0.25s ease;
}

.auth-tab.is-active {
    display: block;
}

@keyframes authFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Подсказка */
.auth-note {
    background: #FFF5F0;
    border-left: 3px solid #FF6900;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.auth-note strong {
    color: #C8102E;
}

/* Кнопки */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #C8102E, #FF6900);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(200, 16, 46, 0.35);
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn--outline {
    background: #fff;
    color: #333;
    border: 2px solid #ddd;
    box-shadow: none;
    width: auto;
    flex: 1;
}

.auth-btn--outline:hover {
    border-color: #C8102E;
    color: #C8102E;
    background: #FFF5F0;
}

.auth-btn--vk {
    background: linear-gradient(135deg, #0077FF, #0055CC);
}

.auth-btn--vk:hover {
    box-shadow: 0 6px 18px rgba(0, 119, 255, 0.35);
}

/* SMS форма */
.auth-sms {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-sms__input-wrap {
    position: relative;
}

.auth-sms__input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 15px;
}

.auth-sms input {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    padding: 0 14px 0 42px;
    font-size: 16px;
    color: #333;
    transition: all 0.2s;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.auth-sms input:focus {
    outline: none;
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.auth-sms input::placeholder {
    color: #bbb;
}

.auth-sms__row {
    display: flex;
    gap: 10px;
}

#sms_code {
    flex: 0 0 110px;
    text-align: center;
    letter-spacing: 3px;
    font-weight: 600;
    padding-left: 14px;
}

.auth-sms__msg {
    min-height: 18px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
}

.auth-sms__msg:not(:empty) {
    background: #f5f5f5;
}

/* Telegram виджет */
.auth-tab#tab-tg {
    text-align: center;
}

.auth-tab#tab-tg iframe {
    margin: 8px auto;
}

/* Футер модалки */
.auth-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 11px;
    color: #999;
    line-height: 1.5;
}

.auth-footer a {
    color: #C8102E;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}