@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* ==========================================
   🎨 1. ПЕРЕМЕННЫЕ И БАЗА
   ========================================== */
:root {
    --primary: #F48FB1;
    --primary-dark: #D81B60;
    --bg: #FFF5F7;
    --text-main: #2C3E50;
    --text-muted: #64748B;
    --gray: #94A3B8;
    --card-bg: #FFFFFF;
    --shadow: 0 20px 40px rgba(216, 27, 96, 0.08);
    --transition: all 0.3s ease;
}

body, html { 
    margin: 0; padding: 0; 
    font-family: 'Montserrat', 'Segoe UI', sans-serif; 
    background: var(--bg);
    color: var(--text-main);
    overflow-x: hidden; 
}

/* ==========================================
   📦 2. ГЛАВНАЯ КАРТОЧКА ВХОДА
   ========================================== */
.login-wrapper {
    display: flex; justify-content: center; align-items: center; 
    min-height: 100vh; padding: 20px;
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card {
    background: var(--card-bg); padding: 40px; 
    border-radius: 24px; box-shadow: var(--shadow); 
    width: 100%; max-width: 380px; text-align: center;
    border: 1px solid rgba(244, 143, 177, 0.2);
}

.brand { margin-bottom: 25px; }
.logo-icon { 
    font-size: 3rem; display: inline-block; margin-bottom: 10px; 
    animation: bounce 2.5s infinite ease-in-out; 
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.brand h2 { margin: 0; color: var(--primary-dark); font-size: 1.8em; letter-spacing: -0.5px; }
.brand-subtitle { margin: 5px 0 0 0; font-size: 0.85em; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px;}

/* ==========================================
   🔘 3. ТАБЫ И ФОРМА
   ========================================== */
.tabs { 
    display: flex; margin-bottom: 25px; background: #f8fafc; 
    border-radius: 12px; padding: 5px; 
}

.tab {
    flex: 1; padding: 12px; cursor: pointer; color: var(--gray);
    background: transparent; border: none; font-family: inherit;
    font-size: 0.95em; font-weight: 600; border-radius: 8px; transition: var(--transition);
}

.tab:hover { color: var(--text-main); }
.tab.active { color: var(--primary-dark); background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.auth-form { display: flex; flex-direction: column; gap: 15px; }

.input-group { position: relative; }
.input-group i { 
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%); 
    color: var(--gray); transition: var(--transition); 
}

.input-group input {
    width: 100%; padding: 14px 15px 14px 45px; 
    border: 1px solid #e2e8f0; border-radius: 12px; 
    box-sizing: border-box; font-size: 1rem; outline: none; 
    transition: var(--transition); font-family: inherit; background: #f8fafc;
}

.input-group input:focus { 
    border-color: var(--primary); background: white; 
    box-shadow: 0 0 0 4px rgba(244, 143, 177, 0.15); 
}
.input-group input:focus + i { color: var(--primary); }

.btn-login {
    width: 100%; padding: 15px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; border: none; border-radius: 12px; cursor: pointer; font-size: 1.05rem; 
    font-weight: 700; margin-top: 10px; transition: var(--transition); box-shadow: 0 4px 15px rgba(216, 27, 96, 0.25);
}

.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(216, 27, 96, 0.35); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

.info-msg { min-height: 20px; font-size: 0.9rem; margin-top: 15px; transition: var(--transition); font-weight: 600; }

/* ==========================================
   🪟 4. МОДАЛКА (КОД ПОДТВЕРЖДЕНИЯ)
   ========================================== */
.code-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}

.code-modal-box {
    background: white; padding: 40px 30px; border-radius: 24px; text-align: center;
    width: 90%; max-width: 380px; box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-icon { font-size: 3.5em; color: #3b82f6; margin-bottom: 20px; }
.code-modal-box h3 { margin: 0 0 10px; color: var(--text-main); font-size: 1.6em; }
.code-modal-box p { color: var(--text-muted); font-size: 0.95em; margin-bottom: 25px; line-height: 1.5; }

#verification-code {
    width: 180px; font-size: 2.5em; text-align: center; letter-spacing: 15px;
    padding: 15px 0; border: 2px solid #e2e8f0; border-radius: 16px; margin-bottom: 30px;
    outline: none; transition: var(--transition); font-weight: 700; color: #3b82f6;
    font-family: 'Courier New', Courier, monospace; background: #f8fafc;
}

#verification-code:focus { background: white; border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); }

.code-modal-buttons { display: flex; gap: 15px; }
.code-modal-buttons button {
    flex: 1; padding: 14px; border: none; border-radius: 12px; font-weight: 700;
    cursor: pointer; transition: var(--transition); font-size: 1em; font-family: inherit;
}

.btn-cancel { background: #f1f5f9; color: var(--text-muted); }
.btn-cancel:hover { background: #e2e8f0; color: var(--text-main); }
.btn-confirm { background: #3b82f6; color: white; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); }
.btn-confirm:hover { background: #2563eb; transform: translateY(-2px); }

/* ==========================================
   👁️ ИКОНКА ПОКАЗА ПАРОЛЯ
   ========================================== */
.input-group i.toggle-password {
    left: auto;
    right: 15px;
    cursor: pointer;
    pointer-events: auto;
    color: var(--gray);
}
.input-group i.toggle-password:hover {
    color: var(--primary-dark);
}