/* --- Общие настройки и шрифт как на iPhone --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent; /* Убираем синее выделение при клике на телефоне */
}

body {
    background-color: #E5E7EB; /* Серый фон для контраста вне приложения */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px 0;
}

/* --- Главный белый контейнер (имитация экрана телефона) --- */
.app-container {
    width: 100%;
    max-width: 420px; /* Максимальная ширина */
    background-color: #FAFAFA; /* Почти белый фон */
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 24px 20px;
    min-height: 85vh;
}

/* --- Шапка --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 5px;
}

.menu-icon, .refresh-icon {
    font-size: 22px;
    color: #4B5563;
    font-weight: bold;
    cursor: pointer;
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #1F2937;
    letter-spacing: 0.5px;
}

/* --- Фирменный оранжевый баннер --- */
.hero-banner {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(255, 152, 0, 0.3);
    color: #ffffff;
}

.banner-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.banner-subtitle {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.95;
}

/* --- Сетка кнопок --- */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две колонки */
    gap: 15px; /* Расстояние между кнопками */
}

/* --- Сами карточки-кнопки --- */
.nav-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none; /* Убираем подчеркивание ссылок */
    color: #1F2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 115px;
}

/* Анимация при наведении/нажатии */
.nav-card:hover, .nav-card:active {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.card-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Юридические документы в подвале (Мелкий текст) --- */
.legal-footer {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 11px;
    color: #6B7280;
    line-height: 1.5;
    padding: 0 15px;
}
.legal-footer a {
    color: #2563EB; /* Классический синий цвет ссылок */
    text-decoration: none;
}
.legal-footer a:hover {
    text-decoration: underline;
}

/* === Стили для чата Топчика === */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chat-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-header {
    background: linear-gradient(135deg, #4ADE80, #22C55E);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}

.close-chat:hover { opacity: 1; }

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
}

.bot-message {
    background: #e2e8f0;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-message {
    background: #22C55E;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    outline: none;
    font-family: inherit;
}

.chat-input-area input:focus { border-color: #22C55E; }

.send-btn {
    background: #22C55E;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.send-btn:hover { background: #16a34a; }

@media (max-width: 400px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}