/**
 * FitBot Mini App — стили
 *
 * Мобильный дизайн, safe areas, сетка 3x2 на главном экране.
 * CSS-переменные для тематизации под клуб.
 * Совместимость: MAX WebApp + Telegram WebApp.
 */

/* === Сброс и переменные === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Основные цвета */
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #66BB6A;

    /* Фон и поверхности */
    --bg: #f5f5f5;
    --card-bg: #ffffff;

    /* Текст */
    --text: #212121;
    --text-secondary: #757575;
    --text-on-primary: #ffffff;

    /* Границы */
    --border: #e0e0e0;

    /* Статусы */
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;

    /* Размеры */
    --header-height: 48px;
    --radius: 12px;
    --radius-lg: 16px;

    /* Безопасные области (iPhone notch, Android gesture bar) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}


/* === Типографика и body === */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* Динамическая высота для мобильных */
}


/* === Экран загрузки === */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    gap: 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Спиннер (CSS-анимация) */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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


/* === Контейнер приложения === */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}


/* === Шапка (Header) === */

.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    padding-top: var(--safe-top);
    position: relative;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* Кнопка «Назад» в шапке */
.header-back {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding-top: var(--safe-top);
}

.header-back:active {
    opacity: 0.6;
}


/* === Область контента === */

.content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: calc(var(--safe-bottom) + 16px);
}


/* === Главный экран (6 кнопок, сетка 3x2) === */

.home-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
}

.home-greeting {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
    text-align: center;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 360px;
}

.home-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px 8px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

.home-btn-icon {
    font-size: 32px;
    line-height: 1;
}

.home-btn-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
    text-align: center;
}


/* === Экран «Клубная карта» === */

.card-screen {
    padding-top: 8px;
}

.club-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--text-on-primary);
    text-align: center;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.card-club-name {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.card-barcode {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 8px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Canvas штрих-кода EAN-13 */
.barcode-canvas {
    max-width: 100%;
    height: auto;
}

/* Текстовое значение штрих-кода (фолбек, если canvas не поддерживается) */
.barcode-value {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    letter-spacing: 4px;
    color: var(--text);
    font-weight: 700;
}

/* Номер карты под штрих-кодом */
.card-number {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 3px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.card-type {
    font-size: 13px;
    opacity: 0.85;
}

/* Инструкция по использованию карты */
.card-instruction {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-instruction-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.4;
}

.card-instruction-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}


/* === Экран «Абонементы» (каталог продуктов) === */

.products-screen {
    /* Контейнер каталога продуктов */
}

/* Селектор клуба для каталога (повторно используем стили из расписания) */
.products-club-selector {
    margin-bottom: 12px;
}

/* Заголовок категории */
.products-category {
    margin-bottom: 16px;
}

.products-category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
}

/* Карточка продукта */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease;
}

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

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.product-card-info {
    flex: 1;
    min-width: 0;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.product-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.product-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.product-validity {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.product-validity-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.product-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Кнопка «Купить» */
.product-buy-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
}

.product-buy-btn:active {
    background: var(--primary-dark);
    transform: scale(0.97);
}

/* Пустое состояние каталога */
.products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
}

.products-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 1;
    opacity: 0.5;
}

.products-empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.products-empty-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.screen-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}


/* === Экран «Оплата» (заглушка) === */

.payment-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payment-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.payment-card-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.payment-product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

.payment-action-btn {
    width: 100%;
    margin-top: 8px;
}

.payment-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-error {
    background: rgba(244, 67, 54, 0.08);
    border: 1px solid rgba(244, 67, 54, 0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    color: #d32f2f;
    line-height: 1.4;
    text-align: center;
}

.payment-back-btn {
    margin-top: 4px;
    text-align: center;
    width: 100%;
}


/* === Экран «Профиль» === */

.profile-screen {
    /* Контейнер экрана профиля */
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.profile-phone {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Детали профиля */
.profile-details {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.profile-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

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

/* Строка с кнопкой-действием (кликабельная) */
.profile-detail-row--action {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.profile-detail-row--action:active {
    background: rgba(0, 0, 0, 0.03);
}

.profile-detail-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* Иконка-стрелка для кликабельных строк */
.profile-detail-arrow {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 6px;
    flex-shrink: 0;
}

/* Секция абонементов в профиле */
.profile-subs-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.profile-subs-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    padding: 14px 16px 10px 16px;
}

.profile-sub-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.profile-sub-item:last-child {
    border-bottom: none;
}

.profile-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.profile-sub-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

/* Бейдж статуса абонемента */
.profile-sub-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.profile-sub-badge--active {
    background: rgba(76, 175, 80, 0.12);
    color: var(--success);
}

.profile-sub-badge--frozen {
    background: rgba(33, 150, 243, 0.12);
    color: #2196F3;
}

.profile-sub-badge--inactive {
    background: rgba(158, 158, 158, 0.12);
    color: var(--text-secondary);
}

.profile-sub-meta {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Кнопки действий с абонементом (заморозить/разморозить) */
.profile-sub-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.profile-sub-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
}

.profile-sub-action-btn:active {
    transform: scale(0.95);
}

.profile-sub-action-btn--freeze {
    border-color: #90CAF9;
    color: #1976D2;
}

.profile-sub-action-btn--freeze:active {
    background: rgba(33, 150, 243, 0.08);
}

.profile-sub-action-btn--unfreeze {
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.profile-sub-action-btn--unfreeze:active {
    background: rgba(76, 175, 80, 0.08);
}

/* Блок действий профиля (кнопки внизу) */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 16px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.1s ease;
    text-align: left;
}

.profile-action-btn:active {
    transform: scale(0.98);
}

.profile-action-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* Кнопка опасного действия (отзыв согласия) */
.profile-action-btn--danger {
    color: var(--danger);
}

/* Ссылка (оферта) */
.profile-action-btn--link {
    color: var(--primary);
}

/* === Модальное окно ввода (для email, заморозки) === */

.modal-input-group {
    margin-bottom: 16px;
}

.modal-input-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-size: 15px;
    color: var(--text);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.modal-input:focus {
    border-color: var(--primary);
}

.modal-input-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Кнопки модального окна */
.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, opacity 0.15s ease;
}

.modal-btn:active {
    transform: scale(0.97);
}

.modal-btn--cancel {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}

.modal-btn--save {
    background: var(--primary);
    color: var(--text-on-primary);
}

.modal-btn--save:disabled {
    background: var(--border);
    color: var(--text-secondary);
    cursor: default;
}

.modal-btn--danger {
    background: var(--danger);
    color: #ffffff;
}

/* Текст предупреждения в модальном окне */
.modal-warning {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 16px;
}

.modal-warning strong {
    color: var(--danger);
}

.modal-warning ul {
    margin: 8px 0;
    padding-left: 20px;
}

.modal-warning li {
    margin-bottom: 4px;
}

/* Список клубов в модальном окне */
.modal-club-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    max-height: 280px;
    overflow-y: auto;
}

.modal-club-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.modal-club-item:active {
    transform: scale(0.98);
}

.modal-club-item--selected {
    border-color: var(--primary);
    background: rgba(76, 175, 80, 0.06);
}

.modal-club-item-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    transition: all 0.15s ease;
}

.modal-club-item--selected .modal-club-item-check {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-on-primary);
}


/* === Экран «Расписание» === */

.schedule-screen {
    /* Контейнер расписания */
}

/* Селектор клуба */
.schedule-club-selector {
    margin-bottom: 12px;
}

.schedule-club-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23757575' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    cursor: pointer;
}

.schedule-club-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Название единственного клуба */
.schedule-club-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 12px;
}

/* Навигация по неделям */
.schedule-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.schedule-week-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 20px;
    font-weight: 300;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.schedule-week-btn:active {
    background: var(--border);
}

.schedule-week-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
}

/* Лента дней (горизонтальный скролл) */
.schedule-days {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;
}

.schedule-days::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.schedule-day-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    flex: 1;
    padding: 8px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
    gap: 2px;
}

.schedule-day-pill:active {
    transform: scale(0.95);
}

/* Текущий день (не выбранный) */
.schedule-day-pill--today {
    border-color: var(--primary-light);
}

/* Выбранный день */
.schedule-day-pill--active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-on-primary);
}

.schedule-day-pill--active .schedule-day-name,
.schedule-day-pill--active .schedule-day-num {
    color: var(--text-on-primary);
}

.schedule-day-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.schedule-day-num {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}

/* Режим работы */
.schedule-work-hours {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.schedule-work-hours-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* Метка «Групповые занятия» */
.schedule-classes-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    margin-top: 4px;
}

/* Карточка занятия */
.schedule-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.schedule-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    min-width: 50px;
}

.schedule-info {
    flex: 1;
}

.schedule-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.schedule-trainer {
    font-size: 13px;
    color: var(--text-secondary);
}

.schedule-room {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.schedule-duration {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    opacity: 0.7;
}

/* Пустое состояние внутри расписания */
.schedule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
}

.schedule-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 1;
    opacity: 0.5;
}

.schedule-empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.schedule-empty-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Кнопка «Обновить» */
.schedule-refresh-row {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px 0;
}

.btn-text {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.btn-text:active {
    background: rgba(76, 175, 80, 0.08);
}


/* === Экран «Помощники» (описание + ссылки) === */

/* Контейнер экрана помощников */
.assistants-info-screen {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Герой-блок (заголовок + описание) */
.assistants-hero {
    text-align: center;
    padding: 24px 16px 8px 16px;
}

.assistants-hero-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}

.assistants-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.assistants-hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Карточка помощника */
.assistant-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.assistant-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.assistant-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.assistant-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

/* Бейдж «ХИТ» */
.assistant-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #FF6D00;
    background: rgba(255, 109, 0, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.assistant-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}

/* Кнопка-ссылка на бота */
.assistant-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
}

.assistant-card-btn:active {
    background: var(--primary-dark);
    transform: scale(0.97);
}

/* Примечание внизу экрана помощников */
.assistants-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 16px;
    line-height: 1.4;
}


/* === Кнопки категорий (экран «Абонементы») === */

.category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    text-align: left;
}

.category-btn:active {
    transform: scale(0.98);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

.category-btn-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.category-btn-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.category-btn-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Кнопка «Назад к категориям» */
.category-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.category-back-btn:active {
    background: rgba(76, 175, 80, 0.08);
}


/* === Экран «Контакты» === */

.contacts-screen {
    /* Контейнер контактов */
}

/* Обёртка статической карты (кликабельная) */
.contact-map-wrap {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.contact-map-wrap:active {
    transform: scale(0.98);
}

/* Изображение карты — растягивается на всю ширину */
.contact-map-img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 150px;
    object-fit: cover;
    background: var(--border);
}

/* Skeleton-заглушка карты (shimmer пока грузится изображение) */
.contact-map-skeleton {
    width: 100%;
    height: 180px;
}

.contact-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.contact-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.contact-city {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.contact-row:last-child {
    margin-bottom: 0;
}

/* Строка с телефоном (кликабельная) */
.contact-row--phone {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.contact-row--phone:active {
    opacity: 0.6;
}

.contact-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1.4;
}

.contact-row-text {
    flex: 1;
}

/* Ссылки в контактах (телефон, email, сайт) */
.contact-phone-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.contact-phone-link:active {
    opacity: 0.6;
}

.contact-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.contact-link:active {
    opacity: 0.6;
}

/* Кнопки действий контактов */
.contact-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.contact-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.contact-action-btn:active {
    transform: scale(0.97);
    opacity: 0.8;
}

/* Кнопка «Позвонить» */
.contact-action-btn--call {
    background: var(--primary);
    color: var(--text-on-primary);
}

/* Кнопка «На карте» убрана — клик по изображению карты открывает Яндекс.Карты */


/* === Пустое состояние === */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.empty-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}


/* === Экран ошибки === */

.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    gap: 12px;
}

.error-icon {
    font-size: 48px;
    line-height: 1;
    color: var(--warning);
}

.error-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.error-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

.diagnostics {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
    margin-top: 8px;
}


/* === Кнопки === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
}

.btn-primary:active {
    background: var(--primary-dark);
}


/* === Всплывающее уведомление (Toast) === */

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.9);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.toast--fade {
    opacity: 0;
}


/* === Загрузка внутри экранов === */

.screen-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
}


/* === Модальное окно (заготовка для будущих экранов) === */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}


/* === Skeleton-загрузка (shimmer-эффект) === */

.skeleton {
    background: #e0e0e0;
    border-radius: 8px;
}

.skeleton--shimmer {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Skeleton: полоска текста */
.skeleton-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 65%; }
.skeleton-line--long { width: 90%; }
.skeleton-line--full { width: 100%; }

/* Skeleton: круг (аватар) */
.skeleton-circle {
    border-radius: 50%;
}

/* Skeleton: блок (карточка) */
.skeleton-block {
    border-radius: var(--radius);
}

/* Skeleton: «пилюлька» дня (расписание) */
.skeleton-pill {
    min-width: 44px;
    flex: 1;
    height: 52px;
    border-radius: var(--radius);
}

/* Skeleton: карточка занятия (расписание) */
.skeleton-schedule-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.skeleton-schedule-time {
    width: 50px;
    height: 16px;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-schedule-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Skeleton: кнопка-категория (абонементы) */
.skeleton-category-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.skeleton-category-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

.skeleton-category-text {
    flex: 1;
    height: 16px;
    border-radius: 6px;
}

/* Skeleton: клубная карта */
.skeleton-club-card {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.skeleton-club-card .skeleton-line,
.skeleton-club-card .skeleton-block {
    background: rgba(255, 255, 255, 0.25);
}

.skeleton-club-card .skeleton--shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 25%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.15) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Skeleton: профиль */
.skeleton-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.skeleton-profile-details {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.skeleton-profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

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


/* === Единое состояние ошибки === */

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
    gap: 8px;
}

.error-state-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 8px;
}

.error-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.error-state-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.error-state-btn {
    margin-top: 12px;
}


/* === Офлайн-баннер === */

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    padding-top: calc(10px + var(--safe-top));
    background: var(--danger);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.offline-banner-icon {
    font-size: 16px;
    flex-shrink: 0;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}


/* === Рекуррентные подписки === */

/* Секция подписок в профиле */
.recurring-subs-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.recurring-subs-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    padding: 14px 16px 10px 16px;
}

/* Карточка подписки в профиле */
.recurring-sub-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.recurring-sub-card:last-child {
    border-bottom: none;
}

.recurring-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.recurring-sub-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

/* Бейдж статуса подписки */
.recurring-sub-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.recurring-sub-status--active {
    background: rgba(76, 175, 80, 0.12);
    color: var(--success);
}

.recurring-sub-status--cancelled {
    background: rgba(244, 67, 54, 0.12);
    color: var(--danger);
}

.recurring-sub-status--paused {
    background: rgba(255, 152, 0, 0.12);
    color: var(--warning);
}

.recurring-sub-status--pending {
    background: rgba(33, 150, 243, 0.12);
    color: #2196F3;
}

/* Мета-информация подписки (цена, карта, дата) */
.recurring-sub-meta {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.recurring-sub-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.recurring-sub-meta-icon {
    font-size: 12px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

/* Кнопка отмены подписки */
.recurring-sub-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    margin-top: 4px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 16px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: var(--danger);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
}

.recurring-sub-cancel-btn:active {
    transform: scale(0.95);
    background: rgba(244, 67, 54, 0.06);
}

/* Кнопка подписок в каталоге абонементов */
.recurring-catalog-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #FF6D00, #FF9800);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 109, 0, 0.25);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    text-align: left;
}

.recurring-catalog-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 109, 0, 0.2);
}

.recurring-catalog-btn-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.recurring-catalog-btn-text {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.recurring-catalog-btn-arrow {
    font-size: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* Экран выбора тарифа подписки */
.recurring-screen {
    /* Контейнер экрана тарифов */
}

.recurring-screen-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.recurring-screen-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Карточка тарифа в каталоге */
.recurring-tariff-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease;
}

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

.recurring-tariff-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.recurring-tariff-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.recurring-tariff-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.recurring-tariff-period {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.recurring-tariff-features {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.recurring-tariff-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.recurring-tariff-feature-icon {
    font-size: 14px;
    flex-shrink: 0;
    color: var(--primary);
}

/* Бейдж «AI» */
.recurring-tariff-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #7C4DFF;
    background: rgba(124, 77, 255, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    white-space: nowrap;
}

/* Кнопка «Оформить подписку» */
.recurring-tariff-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
}

.recurring-tariff-btn:active {
    background: var(--primary-dark);
    transform: scale(0.97);
}

.recurring-tariff-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Кнопка «Назад к абонементам» */
.recurring-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    margin-bottom: 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.recurring-back-btn:active {
    background: rgba(76, 175, 80, 0.08);
}
