/* ═══════════════════════════════════════════════════════════════════════
   Golden Card — Личный кабинет (app.css)
   Переиспуем дизайн-токены и шрифты из styles.css (подключается первым).
   ═══════════════════════════════════════════════════════════════════════ */

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

body.app-body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────── Верхняя панель ─────────────── */
.app-topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.app-logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2C1F04, var(--gold));
  display: flex; align-items: center; justify-content: center;
}
.app-logo-text { font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }
.app-logo-text span { color: var(--gold); }
.app-topbar-right { font-size: 13px; color: var(--muted); }
.app-logout { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; }
.app-logout:hover { color: var(--text); }

/* ─────────────── Контейнер контента ─────────────── */
.app-wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 100px; }

/* ─────────────── Экран входа / регистрации ─────────────── */
.auth-shell { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.auth-sub { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field input[type="email"],
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit; font-size: 15px;
  background: #fff; color: var(--text);
  transition: border-color .15s;
}
.field input:focus { outline: none; border-color: var(--gold); }

.consent { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 22px; }
.consent input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--gold); flex-shrink: 0; }
.consent label { font-size: 12.5px; color: var(--muted); line-height: 1.5; cursor: pointer; }
.consent a { color: var(--gold); text-decoration: none; }
.consent a:hover { text-decoration: underline; }

/* Кнопка (переиспользуем .btn .btn-gold из styles.css, добавляем full + disabled) */
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ─────────────── Модалка кода ─────────────── */
.app-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(13,13,13,0.5);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.app-modal-backdrop.open { display: flex; }
.app-modal {
  background: var(--card);
  border-radius: var(--r);
  padding: 30px 26px;
  width: 100%; max-width: 400px;
  text-align: center;
  position: relative;
}
.app-modal h2 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.app-modal p { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 22px; }
.app-modal p b { color: var(--text); }

.otp { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.otp input {
  width: 44px; height: 54px;
  text-align: center;
  font-size: 22px; font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff; color: var(--text);
}
.otp input:focus { outline: none; border-color: var(--gold); }

.link-btn { background: none; border: none; color: var(--gold); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
.error-text { color: #C0392B; font-size: 13px; margin-top: 10px; min-height: 16px; }

.modal-x {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: var(--bg); color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { color: var(--text); }

/* ─────────────── Вкладки (нижняя навигация) ─────────────── */
.app-tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 40;
}
.app-tab {
  flex: 1;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 600;
}
.app-tab svg { width: 22px; height: 22px; }
.app-tab.active { color: var(--gold); }

/* ─────────────── Экран выбора карты ─────────────── */
.screen-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 6px; }
.screen-sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }

.card-choice-list { display: flex; flex-direction: column; gap: 16px; }
.card-choice {
  text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--card); padding: 16px;
  display: flex; gap: 14px; align-items: center;
  transition: border-color .15s, transform .1s;
}
.card-choice:hover { border-color: var(--gold); transform: translateY(-2px); }
.card-choice-mini {
  width: 64px; height: 42px; border-radius: 8px; flex-shrink: 0;
}
.card-choice-mini.travel { background: linear-gradient(140deg, #1C1408, #6B520F); }
.card-choice-mini.sub    { background: linear-gradient(140deg, #111, #333); }
.card-choice-mini.ads    { background: linear-gradient(140deg, #0C1520, #1E3040); }
.card-choice-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.card-choice-info p { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.card-choice-arrow { margin-left: auto; color: var(--muted); }

/* ─────────────── Кнопка «назад» ─────────────── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
  margin-bottom: 16px; padding: 0;
}
.back-btn:hover { color: var(--text); }

/* плашка-заглушка для будущих экранов */
.soon {
  margin-top: 24px; padding: 16px; border-radius: 14px;
  background: var(--gold-light); border: 1px dashed var(--gold);
  font-size: 13px; color: #8a6a12; line-height: 1.5;
}

/* ─────────────── Описание карты ─────────────── */
.card-feature { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.card-feature:last-of-type { border-bottom: none; }
.card-feature-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--gold-light); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-feature-txt h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.card-feature-txt p { font-size: 13px; color: var(--muted); line-height: 1.4; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.price-row .label { font-size: 14px; color: var(--muted); }
.price-row .val { font-size: 22px; font-weight: 800; }

/* ─────────────── Карта в кабинете (с переворотом) ─────────────── */
.lkcard-wrap { perspective: 1200px; margin-bottom: 14px; }
.lkcard {
  position: relative; width: 100%; aspect-ratio: 1.6 / 1;
  transform-style: preserve-3d; transition: transform .5s; cursor: pointer;
}
.lkcard.flipped { transform: rotateY(180deg); }
.lkcard__face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 18px; padding: 20px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
}
.lkcard__face.travel { background: linear-gradient(140deg, #1C1408 0%, #3A2A06 50%, #6B520F 100%); }
.lkcard__face.sub    { background: linear-gradient(140deg, #111 0%, #222 50%, #333 100%); }
.lkcard__face.ads    { background: linear-gradient(140deg, #0C1520 0%, #162030 50%, #1E3040 100%); }
.lkcard__back { transform: rotateY(180deg); }
.lkcard__top { display: flex; justify-content: space-between; align-items: flex-start; }
.lkcard__brand { font-weight: 800; font-size: 13px; line-height: 1.1; letter-spacing: .5px; }
.lkcard__brand span { color: #E8C97A; }
.lkcard__bal-label { font-size: 11px; opacity: .7; }
.lkcard__bal { font-size: 26px; font-weight: 800; margin-top: 2px; }
.lkcard__num { font-size: 17px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.lkcard__bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 12px; }
.lkcard__visa { font-style: italic; font-weight: 800; font-size: 20px; }
.lkcard__row { display: flex; justify-content: space-between; font-size: 12px; }
.lkcard__row .k { opacity: .65; }

.card-details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 4px 16px; margin-bottom: 16px; }
.card-details .d-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.card-details .d-row:last-child { border-bottom: none; }
.card-details .d-row .k { color: var(--muted); }
.card-details .d-row .v { font-weight: 600; }

.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }
.btn-ghost { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ─────────────── Блок истории на главной ─────────────── */
.hist-block { margin-top: 22px; }
.hist-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hist-head h3 { font-size: 16px; font-weight: 800; }
.op {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.op:last-child { border-bottom: none; }
.op-ico { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.op-ico.in  { background: #E6F4EA; color: #1E8E3E; }
.op-ico.out { background: #FCE8E6; color: #C5221F; }
.op-ico.neutral { background: var(--bg); color: var(--muted); }
.op-main { flex: 1; min-width: 0; }
.op-title { font-size: 14px; font-weight: 600; }
.op-sub { font-size: 12px; color: var(--muted); }
.op-amt { font-weight: 700; font-size: 14px; white-space: nowrap; }
.op-amt.in { color: #1E8E3E; }
.op-status { font-size: 11px; color: var(--muted); }

/* ─────────────── Фильтры истории ─────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  border: 1px solid var(--border); background: var(--card);
  border-radius: 20px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text);
}
.filter-chip.active { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ─────────────── Группировка истории по картам ─────────────── */
.hist-group { margin-bottom: 10px; }
.hist-group + .hist-group { border-top: 1px solid var(--border); padding-top: 4px; }
.hist-group-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .3px; margin: 16px 0 4px; }
.hist-dot { width: 24px; height: 16px; border-radius: 4px; flex-shrink: 0; }

/* ─────────────── Пополнение ─────────────── */
.rate-note { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.4; }
.select-card-mini { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.select-card-mini button {
  border: 1px solid var(--border); background: var(--card); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; font: inherit; font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.select-card-mini button.active { border-color: var(--gold); }
.select-card-mini .dot { width: 28px; height: 18px; border-radius: 5px; }

/* ─────────────── QR оплата ─────────────── */
.qr-box { width: 200px; height: 200px; margin: 0 auto 14px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.qr-box svg { width: 100%; height: 100%; }
.qr-sum { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.qr-timer { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.qr-timer b { color: var(--gold); }
.qr-warn { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 10px; margin: 12px 0; line-height: 1.4; }
.qr-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* ─────────────── Экраны статусов / ожидания / успеха ─────────────── */
.status-screen { text-align: center; padding: 40px 0; }
.status-emoji { font-size: 48px; margin-bottom: 14px; }
.status-screen h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.status-screen p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.big-timer { font-size: 34px; font-weight: 800; color: var(--gold); margin: 10px 0 20px; font-variant-numeric: tabular-nums; }
.spinner { width: 46px; height: 46px; border: 4px solid var(--border); border-top-color: var(--gold); border-radius: 50%; margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.demo-tag {
  display: inline-block; margin-top: 14px; font-size: 11px; color: var(--muted);
  background: var(--bg); border-radius: 8px; padding: 6px 10px;
}
