/* ============================================
   MetaCoin Invest - Auth Modal Styles
   ============================================ */

/* Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-overlay.active {
    opacity: 1;
}

/* Modal Container */
.auth-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: none;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.auth-modal.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Close Button */
.auth-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-close:hover {
    background: rgba(255, 107, 107, 0.8);
    transform: rotate(90deg);
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   УЛУЧШЕННЫЕ ПОЛЯ ВВОДА
   ============================================ */

.auth-field {
    margin-bottom: 20px;
    position: relative;
}

.auth-field label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-field input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-field input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-field input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* Поле с паролем - контейнер */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 50px; /* Место для кнопки */
}

/* ============================================
   КНОПКА ПОКАЗА/СКРЫТИЯ ПАРОЛЯ (ИСПРАВЛЕННАЯ)
   ============================================ */

.toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 12px; /* Компенсация для label */
}

.toggle-pass:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-50%) scale(1.05);
}

.toggle-pass:active {
    transform: translateY(-50%) scale(0.95);
}

.toggle-pass i {
    font-size: 16px;
    transition: all 0.3s ease;
}

/* Анимация при переключении */
.toggle-pass.active i {
    transform: scale(1.1);
}

/* Code field */
.code-field input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 700;
    padding: 16px;
    font-family: 'Courier New', monospace;
}

/* Primary Button */
.auth-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.auth-btn:hover::before {
    left: 100%;
}

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

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Links Section */
.auth-links {
    margin-top: 25px;
    text-align: center;
}

.divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.divider span {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    position: relative;
}

.link-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.link-btn:hover {
    color: #764ba2;
    background: rgba(102, 126, 234, 0.1);
}

.link-btn.text-link {
    color: rgba(255, 255, 255, 0.7);
}

.link-btn.text-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.dual-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Telegram Link */
.auth-telegram {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.auth-telegram a {
    color: #0088cc;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.auth-telegram a:hover {
    background: rgba(0, 136, 204, 0.1);
    transform: translateY(-1px);
}

/* Toast Notifications */
.auth-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.auth-toast.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.auth-toast.success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
}

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

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

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .auth-title {
        font-size: 22px;
    }
    
    .auth-field input {
        padding: 12px 14px;
    }
    
    .toggle-pass {
        width: 32px;
        height: 32px;
        right: 10px;
    }
}

/* Scrollbar for modal */
.auth-modal::-webkit-scrollbar {
    width: 8px;
}

.auth-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.auth-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.auth-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}