/* ---------- Сброс и базовые стили ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f6fc;
    color: #1e1a2b;
}

/* ---------- Контейнер приложения ---------- */
#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: #ffffff;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

/* ---------- Область контента ---------- */
.screen-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 100px 20px;
    /* отступ снизу под навигацию */
    scroll-behavior: smooth;
}

/* ---------- Каждый экран ---------- */
.screen {
    display: none;
    animation: fadeIn 0.2s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Заголовки экранов ---------- */
.screen-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #1e1a2b;
    margin-bottom: 12px;
}

.screen-subtitle {
    font-size: 15px;
    color: #7a7391;
    line-height: 1.5;
    background: #f4f2f9;
    padding: 16px 18px;
    border-radius: 14px;
    border-left: 4px solid #b7a9d4;
}

/* ---------- Нижняя навигация (5 пунктов) ---------- */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #ffffff;
    border-top: 1px solid #edeaf3;
    padding: 6px 0 env(safe-area-inset-bottom, 8px) 0;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    color: #a59bbb;
    transition: color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
    min-width: 48px;
    position: relative;
}

.nav-item:hover {
    color: #6b5f8a;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 22px;
    line-height: 1.2;
    transition: transform 0.15s;
}

.nav-label {
    font-size: 10px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* Активное состояние */
.nav-item.active {
    color: #4f3b78;
}

.nav-item.active .nav-icon {
    transform: scale(1.05);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    border-radius: 20px;
    background: #4f3b78;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 480px) {
    .screen-container {
        padding: 20px 16px 90px 16px;
    }

    .nav-item {
        padding: 2px 4px;
        min-width: 40px;
    }

    .nav-icon {
        font-size: 20px;
    }

    .nav-label {
        font-size: 9px;
    }
}

@media (min-width: 481px) {
    #app {
        border-radius: 24px;
        margin-top: 20px;
        margin-bottom: 20px;
        height: calc(100% - 40px);
    }

    .bottom-nav {
        border-radius: 0 0 24px 24px;
    }
}

/* ---------- Вспомогательные утилиты ---------- */
.text-muted {
    color: #a59bbb;
}

.mt-2 {
    margin-top: 8px;
}