/* auth.css - Стили для новой системы авторизации */

.auth-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    margin: 0;
}

.auth-main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 30px 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: cardAppear 0.4s ease;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form {
    margin-bottom: 25px;
}

.auth-form h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    font-size: 16px;
    height: 50px;
    padding: 0 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Кнопки */
.btn-auth {
    width: 100%;
    padding: 15px 20px;
    height: 50px;
    background: linear-gradient(135deg, #27ae60, #219653);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 15px 20px;
    height: 50px;
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.btn-back {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s;
    width: 100%;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.btn-back:hover {
    color: #3498db;
}

/* Разделитель */
.auth-divider {
    margin: 25px 0;
    position: relative;
    text-align: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
}

.auth-divider span {
    background: white;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    position: relative;
}

/* Шаги регистрации */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: stepAppear 0.4s ease;
}

@keyframes stepAppear {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== СТИЛИ ДЛЯ ПОЛЯ ВВОДА КОДА ========== */
#codeSection {
    border-top: 1px solid #eee;
    margin-top: 25px;
    padding-top: 25px;
}

#codeSection p {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 500;
}

#verificationCode {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: monospace;
}

#verifyCodeBtn[disabled] {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

#verifyCodeBtn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

.code-timer {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.code-timer span {
    font-weight: bold;
    color: #e74c3c;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
    display: inline-block;
}

/* Таймер кода (старые стили, оставляем для совместимости) */
.code-timer {
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

.code-timer span {
    font-weight: bold;
    color: #e74c3c;
}

/* Успешная регистрация */
.success-icon {
    font-size: 60px;
    margin: 15px 0;
    animation: successPulse 1.5s ease infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.access-code-display {
    background: #f8f9fa;
    border: 2px dashed #27ae60;
    border-radius: 8px;
    padding: 15px;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #2c3e50;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.small-text {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

/* СТАТУС АВТОРИЗАЦИИ */
.auth-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
    text-align: center;
}

.auth-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auth-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Загрузка */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 350px) {
    .auth-card {
        padding: 20px 15px;
    }
    
    .auth-form h3 {
        font-size: 18px;
    }
    
    .input-group input {
        height: 45px;
        font-size: 15px;
    }
    
    .btn-auth, .btn-secondary {
        height: 45px;
        font-size: 15px;
    }

    #verificationCode {
        font-size: 20px;
        letter-spacing: 6px;
    }
}

@media (min-width: 768px) {
    .auth-card {
        padding: 40px;
    }
    
    .auth-form h3 {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .input-group input {
        height: 55px;
        font-size: 18px;
    }
    
    .btn-auth, .btn-secondary {
        height: 55px;
        font-size: 18px;
    }
    
    .access-code-display {
        font-size: 26px;
        padding: 20px;
    }

    #verificationCode {
        font-size: 28px;
        letter-spacing: 10px;
        height: 60px;
    }
}

/* Дополнительные стили для новой системы авторизации */
.error-icon {
    font-size: 60px;
    margin: 15px 0;
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#cachedActions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#cachedUserName {
    font-weight: bold;
    color: #27ae60;
}

/* Улучшенная анимация для карточек */
.auth-card {
    transition: all 0.3s ease;
}

/* Стили для статуса загрузки */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

/* Исправление для iOS */
@supports (-webkit-touch-callout: none) {
    input[type="tel"],
    input[type="text"] {
        font-size: 16px !important;
    }
}
/* ДОБАВИТЬ В КОНЕЦ ФАЙЛА auth.css */

/* Стили для поля ввода кода */
#codeFieldContainer {
    margin-top: 10px;
}

#verificationCode {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: monospace;
}


#loginBtn[disabled] {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

#loginBtn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

#codeSection {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

#verificationCode {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: monospace;
}

#loginBtn[disabled] {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

#loginBtn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

#nextBtn {
    margin-bottom: 0;
}