/* ============================================
   ПОМОГАЙ — Глобальные стили
   Тепло, плавность, забота
   ============================================ */

/* --- Подключение шрифта Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Переменные --- */
:root {
    --cta: #FF6B4A;
    --cta-hover: #E85D3A;
    --bg: #FDF8F5;
    --card: #FFFFFF;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.04);
    --text: #2D2D2D;
    --text-soft: #8C7A6B;
    --success: #5B9A6B;
    --error: #E57373;
    --gold: #D4A853;
    --gradient-cta: linear-gradient(160deg, #FF5A3C 0%, #FF7B5C 35%, #E85D75 100%);
    --radius: 12px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

/* --- Сброс --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    animation: pageIn 0.3s ease;
}

/* --- Типографика --- */
h1 { font-size: 28px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { color: var(--text-soft); }

/* --- Ссылки --- */
a { color: var(--cta); text-decoration: none; }

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:active {
    transform: scale(0.97);
}
.btn-cta {
    display: inline-block;
    padding: 16px;
    background: var(--gradient-cta);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(255,107,74,0.15);
    transition: transform 0.1s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    width: 100%;
}
.btn-cta::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-cta:active::after { opacity: 1; }
.btn-cta:active { transform: scale(0.97); box-shadow: 0 1px 4px rgba(255,107,74,0.2); }
.btn-success {
    background: var(--success);
    color: white;
    width: 100%;
}

/* --- Карточки --- */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
}

/* --- Прогресс-бар --- */
.progress {
    background: #e0e0e0;
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
    margin: 12px 0;
}
.progress-fill {
    background: var(--success);
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s ease;
}

/* --- Анимации --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.animate-in { animation: fadeInUp 0.3s ease forwards; }
.animate-pulse { animation: pulse 0.3s ease; }

/* --- Фиксированная кнопка внизу --- */
.fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, var(--bg) 80%, transparent);
    z-index: 50;
}

/* --- Модальное окно --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 100;
    justify-content: center;
    align-items: flex-end;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--card);
    border-radius: 20px 20px 0 0;
    padding: 24px 24px 40px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeInUp 0.2s ease;
}

/* Модалка не прижимается к шторке браузера */
.modal {
    padding-top: 40px;
}

/* --- Flash-сообщения --- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-danger { background: #f8d7da; color: #721c24; }
.flash-info { background: #d1ecf1; color: #0c5460; }
.flash-warning { background: #fff3cd; color: #856404; }




@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast-уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 16px;
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-success { background: #5B9A6B; animation: toastIn 0.25s ease, toastOut 0.25s ease 3s forwards; }
.toast-info { background: #5B9A6B; animation: toastIn 0.25s ease, toastOut 0.25s ease 3s forwards; }
.toast-danger { background: #E57373; animation: toastIn 0.25s ease, toastOut 0.25s ease 6s forwards; }
.toast-warning { background: #FFA726; animation: toastIn 0.25s ease, toastOut 0.25s ease 5s forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}


/* ============================================
   БИБЛИОТЕКА КОМПОНЕНТОВ (эталон: goal.html)
   ============================================ */

/* Кнопка-призрак (жалоба, иконки) */
.btn-ghost {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.btn-ghost:active { transform: scale(0.97); }

/* Кнопка ошибки */
.btn-danger {
    display: inline-block;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--error);
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s;
}
.btn-danger:active { transform: scale(0.97); }

/* Disabled-состояние */
.btn-disabled {
    background: #E8E5E2 !important;
    color: #9B948E !important;
    cursor: default !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Модальное окно */
.modal-title {
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 2px;
}
.modal-subtitle {
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 16px;
}

/* Плитки выбора */
.tile-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.tile {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1.5px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.tile:active { transform: scale(0.98); }
.tile.selected {
    border-color: #FF5A3C;
    background: #FFF5F2;
    box-shadow: 0 0 0 2px rgba(255,90,60,0.12);
}
.tile-icon { font-size: 18px; flex-shrink: 0; }
.tile-label { flex: 1; }
.tile-hint { font-size: 12px; color: var(--text-soft); margin-left: auto; }
/* Кнопка с обводкой (эталон: .btn-back из goal.html) */
.btn-outline {
    display: inline-block;
    padding: 14px;
    border: 1px solid #FF5A3C;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: #FF5A3C;
    background: white;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.1s;
    width: 100%;
}
.btn-outline:active { transform: scale(0.97); }

/* Белая кнопка с обводкой и закатным свечением при нажатии */
.btn-outline-glow {
    display: block;
    width: 100%;
    padding: 16px;
    border: 1px solid #FF5A3C;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 600;
    color: #FF5A3C;
    background: white;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.1s;
    box-sizing: border-box;
}
.btn-outline-glow:active {
    transform: scale(0.97);
    box-shadow: 0 0 0 3px rgba(255,90,60,0.25), 0 8px 24px rgba(255,90,60,0.15);
}

/* Блокировка pull-to-refresh и bounce-scroll */
/* Pull-to-refresh разрешён */
html {
    overscroll-behavior-y: auto;
}

/* ==== Кастомный скроллбар (закатный) ==== */

/* WebKit (Chrome, Edge, Safari, Яндекс, Opera) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #FF7B5C 35%, #E85D75 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(160deg, #E85D3A 0%, #E85D75 50%, #D44A6A 100%);
    background-clip: padding-box;
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #FF5A3C transparent;
}

/* Модалки — тонкий скроллбар с отступами */
.modal-content::-webkit-scrollbar,
.rules-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb,
.rules-content::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #E85D75 100%);
    border-radius: 10px;
    border: none;
    background-clip: padding-box;
}

/* Textarea — скроллбар тоже закатный */
textarea::-webkit-scrollbar {
    width: 6px;
}
textarea::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #E85D75 100%);
    border-radius: 10px;
    border: none;
}


/* ==== Кастомный скроллбар (закатный) ==== */

/* WebKit (Chrome, Edge, Safari, Яндекс, Opera) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #FF7B5C 35%, #E85D75 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(160deg, #E85D3A 0%, #E85D75 50%, #D44A6A 100%);
    background-clip: padding-box;
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #FF5A3C transparent;
}

/* Модалки — тонкий скроллбар */
.modal-content::-webkit-scrollbar,
.rules-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb,
.rules-content::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #E85D75 100%);
    border-radius: 10px;
    border: none;
    background-clip: padding-box;
}

/* Textarea — скроллбар тоже закатный */
textarea::-webkit-scrollbar {
    width: 6px;
}
textarea::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #E85D75 100%);
    border-radius: 10px;
    border: none;
}


/* Скроллбар не заезжает на скруглённые углы модалок */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    margin: 16px 0;
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #E85D75 100%);
    border-radius: 10px;
    border: none;
}
.rules-content::-webkit-scrollbar {
    width: 6px;
}
.rules-content::-webkit-scrollbar-track {
    margin: 16px 0;
    background: transparent;
}
.rules-content::-webkit-scrollbar-thumb {
    background: linear-gradient(160deg, #FF5A3C 0%, #E85D75 100%);
    border-radius: 10px;
    border: none;
}



/* ==== Info-icon + tooltip ==== */
.info-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F5F0EC;
    color: #8C7A6B;
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.info-icon:active { transform: scale(0.9); }
.info-icon.active, .info-icon:hover {
    background: #FF5A3C;
    color: white;
}
.info-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #2D2D2D;
    color: white;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    width: 280px;
    max-width: calc(100vw - 60px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    text-align: left;
}
.info-popup.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.info-popup h4 {
    font-size: 11px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #FF8C69;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-popup h4:not(:first-child) {
    margin-top: 12px;
}
.info-popup ul {
    padding-left: 16px;
    margin: 0;
    list-style: disc;
}
.info-popup li {
    margin-bottom: 3px;
}
.info-popup li:last-child { margin-bottom: 0; }

/* На тач-устройствах hover отключён — только .active */
@media (hover: none) {
    .info-icon:hover {
        background: #F5F0EC;
        color: #8C7A6B;
    }
    .info-icon.active,
    .info-icon.active:hover {
        background: #FF5A3C;
        color: white;
    }
}


