/* ══════ Т-Клуб · фирменный стиль ══════ */
:root {
  --orange: #F18916;
  --orange-dark: #D4720A;
  --bg: #16181D;
  --bg-card: #1F2229;
  --bg-elevated: #262A33;
  --text: #F5F5F2;
  --text-dim: #9BA0AB;
  --line: #2E323C;
  --radius: 18px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 84px;
}

a { color: var(--orange); text-decoration: none; }

/* ── шапка ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(22, 24, 29, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-logo { height: 40px; }
.topbar-phone {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--orange); color: #fff;
}

/* ── экраны ── */
#app { max-width: 560px; margin: 0 auto; padding: 20px 16px; }
.screen { display: none; animation: fadeIn 0.25s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 26px; margin-bottom: 16px; }
.section-title { font-size: 18px; margin: 26px 0 12px; }

/* ── герой ── */
.hero { margin-bottom: 18px; }
.hero-hello { color: var(--orange); font-weight: 600; margin-bottom: 6px; }
.hero h1 { font-size: 24px; line-height: 1.25; }
.hero-sub { color: var(--text-dim); margin-top: 8px; font-size: 14px; }

/* ── клубная карта ── */
.club-card {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(241, 137, 22, 0.25);
}
.club-card-top { display: flex; justify-content: space-between; align-items: center; }
.club-card-logo {
  height: 34px;
  background: rgba(0,0,0,0.45);
  border-radius: 8px;
  padding: 4px 8px;
  box-sizing: content-box;
}
.club-card-type {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  background: rgba(255,255,255,0.2); padding: 5px 10px; border-radius: 999px;
}
.club-card-name { font-size: 20px; font-weight: 700; margin: 18px 0 14px; }
.club-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.club-card-label { font-size: 11px; opacity: 0.8; }
.club-card-value { font-weight: 700; }
.qr-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.28); color: #fff;
  border: none; border-radius: 12px; padding: 10px 14px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}

/* ── быстрые действия ── */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.quick {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); font-size: 12px; padding: 12px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.quick:active { background: var(--bg-elevated); }
.quick-ico { font-size: 22px; }

/* ── чипы направлений ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--text-dim);
}

/* ── инфо-карточки ── */
.info-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  font-size: 14px; line-height: 1.9;
}

/* ── расписание ── */
.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.day-tab {
  flex: 0 0 auto; background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text-dim); border-radius: 12px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.day-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }

.class-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.class-time { text-align: center; min-width: 52px; }
.class-time b { display: block; font-size: 16px; color: var(--orange); }
.class-time span { font-size: 11px; color: var(--text-dim); }
.class-info { flex: 1; }
.class-info h4 { font-size: 15px; margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.class-info p { font-size: 12px; color: var(--text-dim); }
.class-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.class-info .slots { color: var(--orange); margin-top: 2px; }
.class-card.canceled { opacity: 0.45; }
.class-card.canceled h4 { text-decoration: line-through; }
.sched-date { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }
.book-btn {
  background: transparent; border: 1.5px solid var(--orange); color: var(--orange);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.book-btn.booked { background: var(--orange); color: #fff; }

/* ── тренеры ── */
.trainer-group-title { font-size: 15px; color: var(--text-dim); margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.trainer-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.trainer-ava {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 48px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: #fff;
}
.trainer-card h4 { font-size: 15px; margin-bottom: 2px; }
.trainer-card p { font-size: 12px; color: var(--text-dim); }

/* ── абонементы ── */
.price-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.price-card.accent { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.price-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.price-head h3 { font-size: 18px; }
.badge {
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.badge.muted { background: var(--bg-elevated); color: var(--text-dim); }
.price-card ul { list-style: none; margin-bottom: 14px; }
.price-card ul li { padding: 5px 0 5px 24px; position: relative; font-size: 14px; color: var(--text-dim); }
.price-card ul li::before { content: "✓"; position: absolute; left: 0; color: var(--orange); font-weight: 700; }
.swim-prices li { display: flex; justify-content: space-between; padding-left: 0 !important; }
.swim-prices li::before { display: none; }
.swim-prices b { color: var(--orange); }

.buy-btn {
  width: 100%; background: var(--orange); color: #fff; border: none;
  border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.buy-btn:active { background: var(--orange-dark); }

/* ── профиль ── */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: #fff;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.stat b { display: block; font-size: 26px; color: var(--orange); }
.stat span { font-size: 12px; color: var(--text-dim); }

.field { display: block; }
.field span { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; color: var(--text); font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--orange); }

.empty { color: var(--text-dim); font-size: 14px; padding: 8px 0; }

/* ── нижняя навигация ── */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: rgba(22, 24, 29, 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; padding: 4px 10px;
}
.nav-btn.active { color: var(--orange); }

/* ── модалка ── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.7); align-items: center; justify-content: center; padding: 24px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--bg-card); border-radius: 22px; padding: 24px;
  width: 100%; max-width: 340px; text-align: center;
}
.modal-box h3 { margin-bottom: 16px; }
.qr-holder { display: flex; justify-content: center; margin-bottom: 14px; }
.qr-holder svg { background: #fff; border-radius: 14px; padding: 12px; }
.modal-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }

/* ── связь ── */
.contact-grid { display: flex; flex-direction: column; gap: 10px; }
.contact-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  color: var(--text); font-size: 13px; line-height: 1.45;
}
.contact-btn b { font-size: 14px; }
.contact-ico { font-size: 24px; }

/* ── клуб: вкладки и описания ── */
.club-pane { display: none; }
.club-pane.active { display: block; }
.desc-card { cursor: pointer; }
.info-i { color: var(--orange); font-size: 13px; }
.modal-left { text-align: left; }
.modal-left h3 { margin-bottom: 6px; }
.modal-tag { color: var(--orange); font-size: 13px; margin-bottom: 12px; }
#cm-desc { font-size: 14px; line-height: 1.65; color: var(--text-dim); max-height: 50vh; overflow-y: auto; }

/* ── новости ── */
.news-card h4 { margin-bottom: 6px; font-size: 15px; }
.news-card p { line-height: 1.6; }
.news-date { color: var(--text-dim); font-size: 12px; margin-bottom: 4px; }
.news-dot {
  position: absolute; top: 2px; right: 14px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); display: none;
}
.news-dot.show { display: block; }
.nav-btn { position: relative; }

/* ── лояльность ── */
.loyalty-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.loyalty-num { font-size: 28px; color: var(--orange); }
.loyalty-cap { color: var(--text-dim); font-size: 13px; }
.progress { height: 8px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-dark)); border-radius: 999px; transition: width 0.4s ease; }
.hint { color: var(--text-dim); font-size: 12px; line-height: 1.55; margin-top: 8px; }
.attended { color: var(--orange); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ── переключатель ── */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; cursor: pointer; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--orange); flex: 0 0 auto; }

/* ── карта клиента ── */
#card-holder svg { max-width: 100%; }

/* ── тост ── */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated); border: 1px solid var(--orange);
  color: var(--text); padding: 12px 20px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 200;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── договор и заморозка ── */
.ticket-card { margin-bottom: 12px; }
.ticket-facts { list-style: none; margin: 0 0 12px; }
.ticket-facts li { padding: 4px 0; font-size: 14px; color: var(--text-dim); }
.ticket-facts li b { color: var(--text); }
.badge.st-ok { background: #2e7d32; }
.badge.st-frozen { background: #1565c0; }
.badge.st-warn { background: #b23b3b; }
.badge.st-muted { background: var(--bg-elevated); color: var(--text-dim); }
.freeze-form { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.freeze-form input[type="date"], .freeze-form input[type="number"] {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; color: var(--text); font-size: 15px; color-scheme: dark;
}
.freeze-row { display: flex; align-items: center; gap: 8px; }
.freeze-cancel {
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 8px; width: 26px; height: 26px; cursor: pointer; flex: 0 0 auto;
}
.freeze-cancel:hover { border-color: #b23b3b; color: #b23b3b; }

/* ── зоны клуба ── */
.zone-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.zone-mini {
  flex: 0 0 132px; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; cursor: pointer; padding: 0;
  color: var(--text); font-size: 12px; font-weight: 600; text-align: left;
}
.zone-mini img { width: 100%; height: 84px; object-fit: cover; display: block; }
.zone-mini span { display: block; padding: 8px 10px; }
.zone-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
}
.zone-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.zone-info { padding: 14px 16px 16px; }
.zone-info h3 { font-size: 17px; margin-bottom: 6px; }
.zone-info p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ── фото тренеров ── */
.trainer-ava { overflow: hidden; }
.trainer-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── лояльность: начисления и положение ── */
.loyalty-earn { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; }
.loyalty-earn span { font-size: 13px; color: var(--text-dim); display: flex; justify-content: space-between; }
.loyalty-earn b { color: var(--orange); }
.link-btn {
  background: none; border: none; color: var(--orange); cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 8px 0 0; text-align: left;
}
.modal-scroll { max-height: 82vh; overflow-y: auto; }
.policy-lead { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin: 8px 0 4px; }
.policy-h { font-size: 15px; color: var(--orange); margin: 18px 0 8px; }
.policy-list { list-style: none; margin: 0 0 4px; }
.policy-list li { padding: 5px 0 5px 2px; font-size: 14px; color: var(--text); line-height: 1.5; }
.policy-list li b { color: var(--orange); }
.policy-list.small li { font-size: 12.5px; color: var(--text-dim); padding-left: 16px; position: relative; }
.policy-list.small li::before { content: "•"; position: absolute; left: 2px; color: var(--orange); }
.policy-note { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-top: 4px; }
.loyalty-earn-note { font-size: 12px; color: var(--text-dim); opacity: .8; }

/* ── бонусы уровня на карте лояльности ── */
.loyalty-perks { margin: 14px 0 4px; }
.perks-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.perk { display: flex; gap: 8px; font-size: 13.5px; color: var(--text); padding: 3px 0; line-height: 1.4; }
.perk span { color: var(--orange); font-weight: 700; flex: 0 0 auto; }
.perks-next { font-size: 12.5px; color: var(--text-dim); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.5; }

/* ── уровни в «Положении» ── */
.policy-level { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.policy-level-name { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.policy-level-name span { display: block; font-weight: 400; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.policy-level .policy-list li { font-size: 13.5px; padding: 3px 0; }
