/* ============================================================
   ПЛАН Б — PREMIUM DESIGN SYSTEM
   ============================================================ */

:root {
    --bg-primary: #070B14;
    --bg-secondary: #0D1422;
    --bg-card: rgba(20, 30, 48, 0.6);
    --bg-card-solid: #141E30;
    --bg-hover: rgba(30, 45, 70, 0.8);
    --border: rgba(56, 78, 112, 0.4);
    --border-light: rgba(96, 128, 176, 0.5);
    --text-primary: #F4F7FB;
    --text-secondary: #9DB2CE;
    --text-muted: #64748B;
    --emerald: #10B981;
    --emerald-dark: #059669;
    --emerald-light: #6EE7B7;
    --emerald-glow: rgba(16, 185, 129, 0.5);
    --gold: #FBBF24;
    --gold-glow: rgba(251, 191, 36, 0.5);
    --red: #EF4444;
    --orange: #F59E0B;
    --blue: #3B82F6;
    --purple: #A855F7;
    --cyan: #06B6D4;
    --gradient-emerald: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-emerald-light: linear-gradient(135deg, #6EE7B7 0%, #10B981 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    background: var(--bg-primary);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(16, 185, 129, 0.15), transparent 60%),
        radial-gradient(ellipse 70% 50% at 80% 20%, rgba(168, 85, 247, 0.12), transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(6, 182, 212, 0.1), transparent 60%),
        var(--bg-primary);
    animation: bgShift 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle 200px at 15% 25%, rgba(16, 185, 129, 0.08), transparent 70%),
        radial-gradient(circle 250px at 85% 60%, rgba(168, 85, 247, 0.06), transparent 70%),
        radial-gradient(circle 180px at 50% 85%, rgba(6, 182, 212, 0.06), transparent 70%);
    animation: floatGlow 15s ease-in-out infinite;
}

@keyframes bgShift {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, -20px); }
    66% { transform: translate(-15px, 15px); }
}

/* ЗАСТАВКА */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(ellipse at center, #0D1422 0%, #070B14 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transition: opacity 600ms ease, transform 600ms ease;
}

.splash-screen.hidden {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.splash-logo {
    font-size: 72px;
    line-height: 1;
    animation: splashLogoIn 1200ms cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 32px rgba(16, 185, 129, 0.6));
}

@keyframes splashLogoIn {
    0% { opacity: 0; transform: scale(0.3) rotate(-180deg); }
    60% { transform: scale(1.15) rotate(10deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.splash-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #6EE7B7 0%, #10B981 30%, #059669 60%, #6EE7B7 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: splashTextIn 1000ms ease 400ms both, gradientShift 4s linear infinite;
    letter-spacing: -1px;
    text-align: center;
}

@keyframes splashTextIn {
    0% { opacity: 0; transform: translateY(30px); filter: blur(10px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.splash-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: splashTextIn 800ms ease 900ms both;
}

.splash-loader {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    opacity: 0;
    animation: splashTextIn 600ms ease 1200ms both;
}

.splash-loader span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 16px var(--emerald-glow);
    animation: splashBounce 1.4s ease-in-out infinite;
}

.splash-loader span:nth-child(2) { animation-delay: 0.2s; background: var(--emerald-light); }
.splash-loader span:nth-child(3) { animation-delay: 0.4s; background: var(--cyan); }

@keyframes splashBounce {
    0%, 60%, 100% { transform: translateY(0) scale(1); opacity: 0.5; }
    30% { transform: translateY(-16px) scale(1.2); opacity: 1; }
}

/* LOADER */
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid transparent;
    border-top-color: var(--emerald);
    border-right-color: var(--emerald-light);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
    box-shadow: 0 0 24px var(--emerald-glow);
}

/* КАРТОЧКИ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    animation: cardIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(110, 231, 183, 0.4), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 32px rgba(16, 185, 129, 0.1);
}

.card:hover::before { opacity: 1; }

@keyframes cardIn {
    0% { opacity: 0; transform: translateY(20px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ИНФО-КАРТОЧКИ */
.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: cardIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.info-card:hover {
    border-color: var(--emerald);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

.info-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.4));
    animation: float 4s ease-in-out infinite;
}

/* КНОПКИ */
.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--gradient-emerald);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 600ms ease;
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.6);
}

.btn-primary:hover::before { left: 100%; }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
    background: rgba(30, 45, 70, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(40, 60, 90, 0.8);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

/* ПОЛЯ ВВОДА */
.form-group input,
.form-group textarea,
.form-group select,
.test-input {
    background: rgba(13, 20, 34, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.test-input:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), 0 0 24px rgba(16, 185, 129, 0.2);
    background: rgba(13, 20, 34, 0.95);
}

/* ТОПБАР */
.topbar-greeting h1 {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--emerald-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.topbar-avatar {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3), 0 0 24px rgba(16, 185, 129, 0.3);
    transition: all var(--transition);
}

.topbar-avatar:hover {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5), 0 0 32px rgba(16, 185, 129, 0.5);
    transform: scale(1.08);
}

/* МЕНЮ-КАРТОЧКИ */
.menu-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-bounce);
}

.menu-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glass);
    pointer-events: none;
}

.menu-card:hover {
    border-color: var(--emerald);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 48px rgba(16, 185, 129, 0.25);
}

.menu-icon {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    transition: all var(--transition-bounce);
}

.menu-card:hover .menu-icon {
    transform: scale(1.15) rotate(-5deg);
}

.menu-card-coach {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.05));
    border-color: rgba(16, 185, 129, 0.4);
}

.menu-card-test {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.05));
    border-color: rgba(251, 191, 36, 0.5);
    animation: cardIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 180ms both,
               pulseGold 2.5s ease-in-out infinite;
}

.menu-card-test .menu-title { color: var(--gold); }

@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5), 0 8px 32px rgba(251, 191, 36, 0.2); }
    50% { box-shadow: 0 0 0 12px rgba(251, 191, 36, 0), 0 8px 32px rgba(251, 191, 36, 0.4); }
}

/* НАВИГАЦИЯ */
.bottom-nav {
    background: rgba(13, 20, 34, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

.nav-item {
    position: relative;
    transition: all var(--transition);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--gradient-emerald);
    box-shadow: 0 0 16px var(--emerald-glow);
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 12px var(--emerald-glow));
    transform: scale(1.1);
}

/* ФИЛЬТРЫ */
.filter-btn {
    background: rgba(20, 30, 48, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-btn.active {
    background: var(--gradient-emerald);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* ПРОГРЕСС */
.progress-fill {
    background: linear-gradient(90deg, #10B981, #6EE7B7, #10B981);
    background-size: 200% 100%;
    animation: progressShine 2s linear infinite;
    box-shadow: 0 0 12px var(--emerald-glow);
}

@keyframes progressShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* КАЛЕНДАРЬ */
.cal-cell {
    background: rgba(20, 30, 48, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    transition: all var(--transition-bounce);
}

.cal-cell:hover {
    border-color: var(--emerald);
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
    z-index: 2;
}

.cal-today {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.1));
    border-color: var(--emerald);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.cal-selected {
    background: var(--gradient-emerald);
    border-color: var(--emerald);
    transform: scale(1.05);
    box-shadow: 0 0 32px var(--emerald-glow);
}

/* ЧАТ */
.chat-header {
    background: rgba(13, 20, 34, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.chat-coach-avatar {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 0 32px var(--emerald-glow);
    animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 0 32px rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3), 0 0 48px rgba(16, 185, 129, 0.8); }
}

.chat-msg-user .chat-bubble {
    background: var(--gradient-emerald);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.chat-msg-assistant .chat-bubble {
    background: rgba(20, 30, 48, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.chat-input-wrap {
    background: rgba(13, 20, 34, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
}

.chat-input-wrap:focus-within {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), 0 0 32px rgba(16, 185, 129, 0.2);
}

.chat-send-btn {
    background: var(--gradient-emerald);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* МОДАЛКИ */
.modal-overlay {
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.modal {
    background: rgba(13, 20, 34, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: 0 -8px 64px rgba(0, 0, 0, 0.7), 0 0 48px rgba(16, 185, 129, 0.15);
}

.modal-header h2 {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--emerald-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ЗАДАЧИ */
.task-card, .slot-item {
    background: rgba(20, 30, 48, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.task-card:hover, .slot-item:hover {
    border-color: var(--emerald);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.task-checkbox.checked, .slot-checkbox.checked {
    background: var(--gradient-emerald);
    box-shadow: 0 0 16px var(--emerald-glow);
}

/* КОНТАКТЫ */
.contact-card {
    background: rgba(20, 30, 48, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    transition: all var(--transition-bounce);
}

.contact-card:hover {
    border-color: var(--emerald);
    transform: translateX(6px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
}

.contact-avatar {
    background: var(--gradient-emerald);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* СТАТИСТИКА */
.stat-card {
    background: rgba(20, 30, 48, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    transition: all var(--transition-bounce);
}

.stat-card:hover {
    border-color: var(--emerald);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.25);
}

.stat-value {
    background: linear-gradient(135deg, #6EE7B7 0%, #10B981 50%, #6EE7B7 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

/* СКРОЛЛБАР */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(16, 185, 129, 0.6); }

/* ПЕРЕХОДЫ */
.dashboard {
    animation: pageIn 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageIn {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 480px) {
    .splash-title { font-size: 32px; }
    .splash-logo { font-size: 56px; }
}

/* ============================================================
   ЗАСТАВКА — ФИНАЛЬНЫЕ ПРАВКИ
   ============================================================ */

/* Прогресс-бар за 4 секунды */
.splash-progress-fill {
    animation: splashProgress 4s cubic-bezier(0.4, 0, 0.2, 1) forwards,
               progressGradient 3s linear infinite !important;
}

@keyframes splashProgress {
    0% { width: 0%; }
    20% { width: 15%; }
    40% { width: 40%; }
    60% { width: 65%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

/* Подсказка "Загрузка..." с крутящимся кружком */
.splash-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0;
    animation: splashTextIn 600ms ease 1400ms both;
    margin-top: 8px;
}

.splash-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--emerald);
    border-radius: 50%;
    animation: splashSpin 800ms linear infinite;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    flex-shrink: 0;
}

@keyframes splashSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ПРИВЫЧКИ НЕДЕЛИ
   ============================================================ */

.habit-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-emerald);
    border: none;
    color: white;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.habit-add-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.habit-add-btn:active {
    transform: scale(0.95);
}

/* Дни недели (шапка) */
.habit-days-header {
    display: grid;
    grid-template-columns: 1fr repeat(7, 32px);
    gap: 4px;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.habit-title-col {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.habit-day-col {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    width: 32px;
    padding-top: 6px;
}

.habit-day-today {
    color: var(--emerald);
    position: relative;
}

.habit-day-today::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--emerald);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--emerald-glow);
}

/* Ряд привычки */
.habit-row {
    display: grid;
    grid-template-columns: 1fr repeat(7, 32px);
    gap: 4px;
    padding: 8px 0;
    align-items: center;
    border-bottom: 1px solid rgba(56, 78, 112, 0.15);
    animation: fadeInUp 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.habit-row:last-child {
    border-bottom: none;
}

.habit-title-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.habit-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.habit-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.habit-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all var(--transition);
    opacity: 0;
    font-family: inherit;
    flex-shrink: 0;
}

.habit-row:hover .habit-delete {
    opacity: 1;
}

.habit-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
}

/* Галочки */
.habit-check {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(20, 30, 48, 0.6);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all var(--transition-bounce);
    position: relative;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.habit-check:hover {
    border-color: var(--emerald);
    transform: scale(1.1);
}

.habit-check.today {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.habit-check.completed {
    background: var(--gradient-emerald);
    border-color: var(--emerald);
    box-shadow: 0 0 12px var(--emerald-glow);
}

.habit-check.completed::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.habit-check:active {
    transform: scale(0.9);
}

/* Футер недели */
.habit-week-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

#habitProgress {
    font-weight: 600;
    color: var(--emerald);
    font-variant-numeric: tabular-nums;
}

#habitStreak {
    font-weight: 600;
    color: var(--gold);
}

/* Выбор иконки в модалке */
.habit-icon-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.habit-icon-btn {
    aspect-ratio: 1;
    background: rgba(13, 20, 34, 0.8);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 22px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
}

.habit-icon-btn:hover {
    border-color: var(--border-light);
    transform: scale(1.08);
}

.habit-icon-btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.1));
    border-color: var(--emerald);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

/* На маленьких экранах — уменьшаем */
@media (max-width: 380px) {
    .habit-days-header,
    .habit-row {
        grid-template-columns: 1fr repeat(7, 28px);
        gap: 2px;
    }

    .habit-check {
        width: 28px;
        height: 28px;
    }

    .habit-day-col {
        width: 28px;
        font-size: 10px;
    }

    .habit-title {
        font-size: 13px;
    }

    .habit-icon {
        font-size: 16px;
    }
}

/* ============================================================
   ПРИВЫЧКИ — ПОДСКАЗКА, ИНСТРУКЦИЯ, ПРИМЕРЫ
   ============================================================ */

/* Подсказка на дашборде */
.habit-hint {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.04));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 16px;
    animation: fadeInUp 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Инструкция в модалке */
.habit-instruction {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.04));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.habit-instruction-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--emerald-light);
    margin-bottom: 10px;
}

.habit-instruction-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.habit-instruction-list li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    padding-left: 18px;
    position: relative;
}

.habit-instruction-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--emerald);
    font-weight: 700;
}

.habit-instruction-list b {
    color: var(--text-primary);
    font-weight: 600;
}

/* Примеры привычек */
.habit-examples {
    margin-bottom: 16px;
}

.habit-examples-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.habit-examples-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.habit-example-chip {
    background: rgba(20, 30, 48, 0.7);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.habit-example-chip:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald);
    color: var(--emerald-light);
    transform: translateY(-2px);
}

.habit-example-chip:active {
    transform: scale(0.95);
}

/* Модалка привычек — прокручиваемая, если много контента */
#habitModal .modal {
    max-height: 90vh;
    overflow-y: auto;
}

#habitModal .modal-body {
    max-height: 65vh;
    overflow-y: auto;
}

/* ============================================================
   ЦЕЛИ — РЕДАКТИРОВАНИЕ
   ============================================================ */

/* Кнопка удаления в модалке */
#modalDelete {
    transition: all var(--transition);
}

#modalDelete:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-2px);
}

/* Карточка цели — кликабельная */
.goal-card {
    cursor: pointer;
    transition: all var(--transition);
}

.goal-card:active {
    transform: scale(0.99);
}

/* Модалка изменения цели */
.goal-change-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goal-change-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(20, 30, 48, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
}

.goal-change-btn:hover {
    background: rgba(30, 45, 70, 0.8);
    border-color: var(--emerald);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.goal-change-btn:active {
    transform: translateY(0) scale(0.98);
}

.goal-change-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.goal-change-content {
    flex: 1;
    min-width: 0;
}

.goal-change-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.goal-change-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Модалки — кнопки в футере */
.modal-footer {
    display: flex;
    gap: 8px;
}

.modal-footer .btn {
    flex: 1;
}

/* Анимация появления модалки изменения */
#goalChangeModal .modal {
    animation: modalIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    0% {
        transform: translateY(60px) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ============================================================
   ФОН ПРИЛОЖЕНИЯ — pages.jpg
   ============================================================ */

body {
    background-image: url('/assets/img/pages.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #070B14;
}

/* Затемняющий слой поверх фона — чтобы текст читался */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(
        180deg,
        rgba(7, 11, 20, 0.7) 0%,
        rgba(7, 11, 20, 0.85) 50%,
        rgba(7, 11, 20, 0.95) 100%
    );
    pointer-events: none;
}

/* Убираем старый анимированный градиент */
body::after {
    display: none;
}

/* Для чата — тоже фон */
.chat-page {
    background-image: url('/assets/img/pages.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #070B14;
}

/* ============================================================
   ПОЛУПРОЗРАЧНОСТЬ — КАРТОЧКИ, МЕНЮ, НАВИГАЦИЯ
   ============================================================ */

/* Затемнение фона — чуть светлее, чтобы картинка была видна */
body::before {
    background: linear-gradient(
        180deg,
        rgba(7, 11, 20, 0.5) 0%,
        rgba(7, 11, 20, 0.7) 50%,
        rgba(7, 11, 20, 0.85) 100%
    ) !important;
}

/* Карточки — сильнее прозрачные */
.card {
    background: rgba(20, 30, 48, 0.5) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border: 1px solid rgba(96, 128, 176, 0.25) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.card:hover {
    background: rgba(20, 30, 48, 0.65) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 32px rgba(16, 185, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Инфо-карточки (погода, курс) */
.info-card {
    background: rgba(20, 30, 48, 0.5) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border: 1px solid rgba(96, 128, 176, 0.25) !important;
}

.info-card:hover {
    background: rgba(20, 30, 48, 0.7) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

/* Меню-карточки на главной */
.menu-card {
    background: rgba(20, 30, 48, 0.45) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border: 1px solid rgba(96, 128, 176, 0.25) !important;
}

.menu-card:hover {
    background: rgba(20, 30, 48, 0.65) !important;
    border-color: var(--emerald) !important;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 0 48px rgba(16, 185, 129, 0.25) !important;
}

/* Нижняя навигация — сильнее blur */
.bottom-nav {
    background: rgba(13, 20, 34, 0.7) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    border-top: 1px solid rgba(96, 128, 176, 0.2) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Шапка */
.chat-header {
    background: rgba(13, 20, 34, 0.7) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
}

/* Модалки — тоже полупрозрачные */
.modal {
    background: rgba(13, 20, 34, 0.9) !important;
    backdrop-filter: blur(32px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(150%) !important;
}

/* Поля ввода */
.form-group input,
.form-group textarea,
.form-group select,
.test-input {
    background: rgba(13, 20, 34, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.test-input:focus {
    background: rgba(13, 20, 34, 0.85) !important;
}

/* Статистика-карточки */
.stat-card {
    background: rgba(20, 30, 48, 0.5) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
    border: 1px solid rgba(96, 128, 176, 0.25) !important;
}

.stat-card:hover {
    background: rgba(20, 30, 48, 0.7) !important;
    border-color: var(--emerald) !important;
}

/* Задачи, слоты */
.task-card,
.slot-item {
    background: rgba(20, 30, 48, 0.55) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

.task-card:hover,
.slot-item:hover {
    background: rgba(20, 30, 48, 0.75) !important;
}

/* Контакты */
.contact-card {
    background: rgba(20, 30, 48, 0.55) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

.contact-card:hover {
    background: rgba(20, 30, 48, 0.75) !important;
}

/* Календарь */
.cal-cell {
    background: rgba(20, 30, 48, 0.4) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

.cal-cell:hover {
    background: rgba(20, 30, 48, 0.65) !important;
}

/* Строки привычек */
.habit-row {
    background: transparent;
}

/* Скрываем старые анимированные пятна */
body::after {
    display: none !important;
}

/* ============================================================
   ЗАСТАВКА — ЛОГОТИП-КАРТИНКА
   ============================================================ */

.splash-logo {
    animation: none !important;
    filter: none !important;
}

.splash-logo-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: splashLogoIn 1200ms cubic-bezier(0.34, 1.56, 0.64, 1),
               logoFloat 3s ease-in-out 1.2s infinite,
               logoGlow 2.5s ease-in-out 1.2s infinite;
    filter: drop-shadow(0 0 32px rgba(16, 185, 129, 0.8))
            drop-shadow(0 0 64px rgba(16, 185, 129, 0.4));
    display: block;
}

@keyframes splashLogoIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    60% {
        transform: scale(1.15) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
    }
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 32px rgba(16, 185, 129, 0.8))
                drop-shadow(0 0 64px rgba(16, 185, 129, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 48px rgba(110, 231, 183, 1))
                drop-shadow(0 0 96px rgba(16, 185, 129, 0.6));
    }
}

@media (min-width: 768px) {
    .splash-logo-img {
        width: 200px;
        height: 200px;
    }
}

/* ============================================================
   ЧАТ — КРАСИВОЕ ПОЛЕ ВВОДА
   ============================================================ */

.chat-input-area {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(13, 20, 34, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-top: 1px solid rgba(96, 128, 176, 0.2);
    flex-shrink: 0;
}

.chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(20, 30, 48, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(96, 128, 176, 0.3);
    border-radius: 24px;
    padding: 6px 6px 6px 6px;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.chat-input-wrap:focus-within {
    border-color: var(--emerald);
    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.15),
        0 4px 24px rgba(16, 185, 129, 0.2);
    background: rgba(20, 30, 48, 0.95);
}

/* Скрепка */
.chat-attach-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}

.chat-attach-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
    transform: scale(1.1) rotate(-15deg);
}

.chat-attach-btn:active {
    transform: scale(0.9);
}

.chat-attach-btn.has-image {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Поле ввода */
.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    min-height: 42px;
    padding: 10px 4px;
    caret-color: var(--emerald);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

/* Кнопка отправки */
.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    box-shadow:
        0 4px 16px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 0;
    line-height: 1;
    position: relative;
}

.chat-send-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6EE7B7, #10B981);
    opacity: 0;
    transition: opacity 300ms;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow:
        0 6px 24px rgba(16, 185, 129, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chat-send-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.chat-send-btn:active:not(:disabled) {
    transform: scale(0.9);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-send-btn svg,
.chat-send-btn span {
    position: relative;
    z-index: 1;
}

/* Превью картинки */
.chat-image-preview {
    margin: 0 16px 8px;
    background: rgba(20, 30, 48, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--emerald);
    border-radius: var(--radius);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.chat-image-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.chat-image-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    font-size: 14px;
    cursor: pointer;
    transition: all 300ms;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
    padding: 0;
    margin-left: auto;
}

.chat-image-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

/* Картинка в сообщении чата */
.chat-bubble-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: block;
}

/* Отправка в процессе */
.chat-msg-sending {
    opacity: 0.5;
}
RELOADEDcat
