/* Playful Classroom (v08) — страницы оплаты */

/* ─── Обёртка ───────────────────────────────────────────── */
.billing-v08 {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}
.billing-v08.billing-history {
  max-width: 880px;
}

/* ─── Блок текущего баланса ─────────────────────────────── */
.billing-balance {
  background: linear-gradient(135deg, var(--chalkboard), var(--chalkboard-dark));
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #fff;
}
.billing-balance__label {
  display: block;
  font-family: var(--font-chalk);
  font-size: 1rem;
  opacity: 0.8;
  margin-bottom: 0.15rem;
}
.billing-balance__amount {
  display: block;
  font-family: var(--font-chalk);
  font-size: 2.6rem;
  line-height: 1.1;
}
.billing-balance__unit {
  font-family: var(--font-chalk);
  font-size: 1.1rem;
  opacity: 0.75;
}

/* ─── Стикер-форма (жёлтая бумажка) ────────────────────── */
.billing-note {
  position: relative;
  background: #fff9c4;
  background-image: linear-gradient(180deg, #fffde7 0%, #fff9c4 100%);
  border-radius: 2px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.10), 0 12px 32px rgba(0,0,0,.08);
  font-family: var(--font-chalk);
}
/* Скотч сверху */
.billing-note::before {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 18px;
  background: rgba(230,225,210,.55);
  border: 1px solid rgba(200,192,175,.3);
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.billing-note__title {
  font-family: var(--font-chalk);
  font-size: 1.6rem;
  color: #444;
  text-align: center;
  margin: 0 0 1.25rem;
}

/* ─── Метки и подсказки ─────────────────────────────────── */
.billing-label {
  display: block;
  font-family: var(--font-chalk);
  font-size: 0.95rem;
  color: #777;
  margin-bottom: 0.35rem;
}
.billing-hint {
  font-family: var(--font-chalk);
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.25rem;
}

/* ─── Пресет-кнопки ─────────────────────────────────────── */
.billing-presets { margin-bottom: 1.1rem; }
.billing-presets__grid { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.billing-preset-btn {
  font-family: var(--font-chalk);
  font-size: 1.1rem;
  padding: 0.3rem 0.85rem;
  border: 1.5px dashed #b8a87a;
  border-radius: 6px;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.billing-preset-btn:hover,
.billing-preset-btn.active {
  background: var(--chalkboard);
  border-style: solid;
  border-color: var(--chalkboard);
  color: #fff;
}

/* ─── Поля ввода ─────────────────────────────────────────── */
.billing-field-group { margin-bottom: 1rem; }
.billing-input-row { display: flex; }
.billing-input {
  flex: 1;
  background: rgba(255,255,255,.7);
  border: 1.5px solid #c8b98a;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-chalk);
  font-size: 1.1rem;
  color: #333;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.billing-input:focus {
  border-color: var(--chalkboard);
  box-shadow: 0 0 0 3px rgba(45,90,71,.12);
}
.billing-input::placeholder { color: #b5a98a; }
.billing-input-suffix {
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: rgba(200,185,138,.3);
  border: 1.5px solid #c8b98a;
  border-left: none;
  border-radius: 0 8px 8px 0;
  font-family: var(--font-chalk);
  font-size: 1.1rem;
  color: #888;
  flex-shrink: 0;
}

/* ─── Промокод ───────────────────────────────────────────── */
.billing-promo {
  border-top: 1px dashed #c8b98a;
  padding-top: 0.75rem;
}
.billing-promo-btn {
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1.5px solid #c8b98a;
  border-left: none;
  border-radius: 0 8px 8px 0;
  font-family: var(--font-chalk);
  font-size: 1rem;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.billing-promo-btn:hover { background: rgba(45,90,71,.08); }
.billing-promo-message { min-height: 1.2em; transition: color 0.2s; }

/* ─── Превью суммы ───────────────────────────────────────── */
.billing-preview {
  text-align: center;
  margin: 1rem 0;
  font-family: var(--font-chalk);
  font-size: 1.05rem;
  color: #888;
}
.billing-preview__amount {
  font-size: 1.7rem;
  color: var(--chalkboard);
  margin: 0 0.3rem;
}
.billing-bonus {
  margin-top: 0.3rem;
  color: #2e9e5b;
  font-family: var(--font-chalk);
  font-size: 0.9rem;
}

/* ─── Кнопка оплаты ─────────────────────────────────────── */
.billing-note .btn-v08-cta {
  width: 100%;
  justify-content: center;
  font-size: 1.25rem;
  border-radius: 10px;
}

/* ─── Футер стикера ──────────────────────────────────────── */
.billing-note__footer {
  text-align: center;
  margin-top: 1rem;
  border-top: 1px dashed #c8b98a;
  padding-top: 0.75rem;
}
.billing-link {
  font-family: var(--font-chalk);
  font-size: 1rem;
  color: #888;
  text-decoration: none;
  transition: color 0.15s;
}
.billing-link:hover { color: var(--chalkboard); }

/* ─── Шапка истории ──────────────────────────────────────── */
.billing-history-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.billing-history-header h2 {
  font-family: var(--font-chalk);
  font-size: 1.8rem;
  color: var(--text);
  margin: 0;
}
.billing-history-balance {
  font-family: var(--font-chalk);
  font-size: 1.3rem;
  color: var(--chalkboard);
  font-weight: 700;
}
.billing-history-balance__label {
  font-family: var(--font-chalk);
  font-size: 0.95rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

/* ─── Таблица на доске ───────────────────────────────────── */
.billing-board {
  background-color: var(--chalkboard);
  background-image: url("../../images/board/hero-chalkboard-texture.png");
  background-size: 512px 512px;
  background-repeat: repeat;
  border: 12px solid var(--board-frame);
  border-image: linear-gradient(
    135deg, var(--board-frame-light) 0%, var(--board-frame) 25%,
    var(--board-frame-dark) 50%, var(--board-frame) 75%, var(--board-frame-light) 100%
  ) 1;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,.35),
    inset 0 6px 24px rgba(0,0,0,.4),
    0 6px 16px rgba(0,0,0,.25);
  padding: 1.25rem 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}
.billing-board__head {
  display: grid;
  grid-template-columns: 130px 90px 80px 1fr 90px;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-chalk);
  font-size: 0.9rem;
  color: rgba(255,255,255,.45);
  border-bottom: 1px dashed rgba(255,255,255,.2);
  margin-bottom: 0.25rem;
}
.billing-board__row {
  display: grid;
  grid-template-columns: 130px 90px 80px 1fr 90px;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-chalk);
  font-size: 1rem;
  color: rgba(255,255,255,.9);
  border-radius: 3px;
  align-items: center;
  transition: background 0.15s;
}
.billing-board__row:hover { background: rgba(255,255,255,.06); }
.billing-amount--plus { color: #4cce7a; font-weight: 700; }
.billing-amount--minus { color: #ff5a5a; font-weight: 700; }
.billing-board__desc {
  color: rgba(255,255,255,.55);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.billing-type--purchase { color: #4cce7a; }
.billing-type--spend    { color: #e8b84a; }
.billing-type--bonus    { color: #5a9cff; }
.billing-type--refund   { color: #ff9a3c; }

/* ─── Пустая история ─────────────────────────────────────── */
.billing-empty {
  text-align: center;
  padding: 3rem 1rem 2rem;
  font-family: var(--font-chalk);
}
.billing-empty__icon {
  font-size: 3rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.75rem;
}
.billing-empty__text {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.billing-history__back {
  text-align: center;
  margin-top: 1rem;
}

/* ─── Адаптив ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .billing-board__head,
  .billing-board__row {
    grid-template-columns: 85px 70px 70px 1fr;
    font-size: 0.85rem;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
  }
  .billing-board__head :last-child,
  .billing-board__row  :last-child { display: none; }
}

/* ─── Тёмная тема ────────────────────────────────────────── */
.theme-dark .billing-note {
  background: var(--surface);
  background-image: none;
}
.theme-dark .billing-note::before {
  background: rgba(80,75,60,.4);
  border-color: rgba(100,90,70,.3);
}
.theme-dark .billing-note__title  { color: var(--text); }
.theme-dark .billing-label        { color: var(--muted); }
.theme-dark .billing-preset-btn   { border-color: var(--sb-line); color: var(--text); }
.theme-dark .billing-preset-btn:hover,
.theme-dark .billing-preset-btn.active {
  background: var(--chalkboard);
  border-color: var(--chalkboard);
  color: #fff;
}
.theme-dark .billing-input {
  background: #222438;
  border-color: var(--sb-line);
  color: var(--text);
}
.theme-dark .billing-input::placeholder { color: var(--muted); }
.theme-dark .billing-input:focus {
  border-color: var(--sb-blue);
  box-shadow: 0 0 0 3px rgba(90,156,255,.12);
}
.theme-dark .billing-input-suffix {
  background: #1a1c2e;
  border-color: var(--sb-line);
  color: var(--muted);
}
.theme-dark .billing-hint         { color: var(--muted); }
.theme-dark .billing-promo        { border-color: var(--sb-line); }
.theme-dark .billing-promo-btn    { border-color: var(--sb-line); color: var(--text); }
.theme-dark .billing-promo-btn:hover { background: rgba(255,255,255,.06); }
.theme-dark .billing-preview      { color: var(--muted); }
.theme-dark .billing-preview__amount { color: var(--sb-blue); }
.theme-dark .billing-note__footer { border-color: var(--sb-line); }
.theme-dark .billing-link         { color: var(--muted); }
.theme-dark .billing-link:hover   { color: var(--text); }
.theme-dark .billing-history-header h2    { color: var(--text); }
.theme-dark .billing-history-balance      { color: var(--sb-blue); }
.theme-dark .billing-history-balance__label { color: var(--muted); }
.theme-dark .billing-empty__icon  { color: var(--sb-muted); }
.theme-dark .billing-empty__text  { color: var(--sb-muted); }

/* ─── User Bar (pill баланса в шапке) ───────────────────── */
.user-bar {
  position: fixed; top: 0; right: 0; z-index: 1050;
  padding: 0.5rem 1rem;
  background: transparent !important;
  color: inherit !important;
  text-align: right !important;
  font-size: inherit !important;
}
.user-bar__inner { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; }
.user-bar__balance {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 100px;
  padding: 0.35rem 0.75rem;
  color: var(--color-primary, #6366f1);
  text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
  transition: background 0.2s;
}
.user-bar__balance:hover { background: rgba(99,102,241,.2); color: var(--color-primary, #6366f1); }
.user-bar__balance-amount { font-size: 0.95rem; }
.user-bar__balance-label  { font-weight: 400; opacity: 0.7; font-size: 0.75rem; }
.theme-dark .user-bar__balance {
  background: rgba(251,191,36,.15);
  border-color: rgba(251,191,36,.25);
  color: #fbbf24;
}
.theme-dark .user-bar__balance:hover { background: rgba(251,191,36,.25); color: #fbbf24; }

/* ─── Легибельность цены: баланс/пресеты в «занятиях» ─────── */
.billing-balance__lessons {
  margin-top: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--sb-green, #2e9e5b);
  font-weight: 600;
}
.billing-note__sub {
  margin: -0.4rem 0 1rem;
  font-size: 0.9rem;
  color: var(--sb-muted, #8a96a8);
  line-height: 1.4;
}
.billing-preset-btn { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; line-height: 1.2; }
.billing-preset-btn__lessons {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.75;
}
.theme-dark .billing-balance__lessons { color: #4cce7a; }
.theme-dark .billing-note__sub { color: var(--sb-muted, #6a7288); }
