/* ════════════════════════════════════════════════════════════
   Ателье причёсок — общий стиль для страниц аккаунта/тарифов/входа/админки.
   Палитра и типографика наследуют главную страницу (Prata + Manrope,
   espresso/copper/blonde). Базовые правила скоупнуты под body.atelier,
   чтобы не конфликтовать с инлайн-стилями index.html.
   ════════════════════════════════════════════════════════════ */
:root {
  --espresso:   #1B1410;
  --espresso-2: #241A14;
  --surface:    #2C2019;
  --surface-2:  #36281F;
  --copper:     #C77F4D;
  --copper-soft:#E0986A;
  --blonde:     #E7C892;
  --cream:      #F3EADF;
  --muted:      #A8917E;
  --line:       rgba(243,234,223,0.10);
  --line-strong:rgba(243,234,223,0.18);
  --danger:     #D98A6A;
  --ok:         #9CB87E;
  --shadow:     0 30px 60px -25px rgba(0,0,0,0.7);
  --serif: 'Prata', Georgia, serif;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.atelier {
  margin: 0;
  background: var(--espresso);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.atelier *, body.atelier *::before, body.atelier *::after { box-sizing: border-box; }
body.atelier::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 8%, rgba(199,127,77,0.16), transparent 60%),
    radial-gradient(50% 40% at 12% 95%, rgba(231,200,146,0.07), transparent 60%);
}
body.atelier a { color: var(--copper-soft); text-decoration: none; }
body.atelier a:hover { color: var(--blonde); }
::selection { background: var(--copper); color: var(--espresso); }
:focus-visible { outline: 2px solid var(--copper-soft); outline-offset: 3px; border-radius: 6px; }

/* ─── Top bar (на всех страницах, включая index) ─── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 5vw, 48px);
  background: rgba(27,20,16,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; color: var(--cream); letter-spacing: .3px; }
.topbar__brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 12px var(--copper); }
.topbar__nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar__link { color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.topbar__link:hover { color: var(--cream); background: rgba(243,234,223,0.06); }

.balance-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); color: var(--blonde);
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.balance-pill b { color: var(--cream); }
.pro-badge { display:inline-flex; align-items:center; gap:5px; padding:5px 10px; border-radius:999px; background:rgba(231,200,146,.14); color:var(--blonde); font-size:12px; font-weight:700; }

/* премиальный значок «валюты» (генерации) — огранённый самоцвет в медном цвете */
.gem { width: 1em; height: 1em; display: inline-block; vertical-align: -0.13em; color: var(--copper-soft); }
.gem path { vector-effect: non-scaling-stroke; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--sans); font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform .12s ease, filter .2s ease, background .2s ease, border-color .2s; text-align: center;
}
.btn--primary { background: linear-gradient(180deg, var(--copper-soft), var(--copper)); color: #2a1a10; }
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--cream); }
.btn--ghost:hover { background: rgba(243,234,223,0.06); border-color: var(--copper-soft); }
.btn--danger { background: transparent; border-color: rgba(217,138,106,.5); color: var(--danger); }
.btn--danger:hover { background: rgba(217,138,106,.12); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn--sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }

/* ─── Layout ─── */
.page { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 5vw, 48px) 80px; }
.page--narrow { max-width: 560px; }
.eyebrow { text-transform: uppercase; letter-spacing: .26em; font-size: 12px; font-weight: 700; color: var(--copper); margin: 0 0 12px; }
.page__title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; margin: 0 0 14px; }
.page__title em { font-style: italic; color: var(--copper-soft); }
.page__lead { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }

.card {
  background: linear-gradient(180deg, var(--espresso-2), var(--surface));
  border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card__title { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; font-weight: 400; }
.card__sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

/* ─── Forms ─── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.input {
  width: 100%; padding: 13px 15px; border-radius: 11px;
  background: rgba(20,15,11,0.6); border: 1px solid var(--line-strong); color: var(--cream);
  font-family: var(--sans); font-size: 15px;
}
.input:focus { outline: none; border-color: var(--copper-soft); background: rgba(20,15,11,0.85); }
.input::placeholder { color: rgba(168,145,126,0.7); }

.notice { border-radius: 11px; padding: 12px 15px; font-size: 14px; margin: 14px 0; display: none; }
.notice.show { display: block; }
.notice--err { background: rgba(217,138,106,0.12); border: 1px solid rgba(217,138,106,0.4); color: var(--danger); }
.notice--ok  { background: rgba(156,184,126,0.12); border: 1px solid rgba(156,184,126,0.4); color: var(--ok); }

.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tab { flex: 1; padding: 11px; border-radius: 11px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--cream); border-color: var(--copper-soft); }

.muted { color: var(--muted); }
.tiny { font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

/* ─── Tariffs ─── */
.tariff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.tariff {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--espresso-2), var(--surface));
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px;
  transition: border-color .2s, transform .12s;
}
.tariff:hover { border-color: var(--copper-soft); transform: translateY(-2px); }
.tariff--pro { border-color: rgba(231,200,146,.4); background: linear-gradient(180deg, #2c2114, var(--surface-2)); }
.tariff__tag { position: absolute; top: -11px; right: 18px; background: var(--blonde); color: #2a1a10; font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 999px; letter-spacing: .04em; }
.tariff__name { font-family: var(--serif); font-size: 21px; margin: 0 0 6px; }
.tariff__price { font-size: 34px; font-weight: 800; color: var(--cream); margin: 6px 0; }
.tariff__price span { font-size: 16px; color: var(--muted); font-weight: 600; }
.tariff__desc { color: var(--muted); font-size: 14px; margin: 0 0 20px; flex: 1; }
.tariff .btn { margin-top: auto; }
.custom-buy { display: flex; gap: 10px; margin-top: 14px; }
.custom-buy .input { flex: 1; }

/* ─── History ─── */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.hist { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); position: relative; }
.hist img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.hist__meta { padding: 9px 11px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.hist__bad { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ─── Admin tables ─── */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip--on { background: rgba(156,184,126,.16); color: var(--ok); }
.chip--off { background: rgba(217,138,106,.16); color: var(--danger); }

/* ─── Modal (для просмотра картинки) ─── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,7,5,.9); display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: var(--shadow); }

.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 28px clamp(16px,5vw,48px); display: flex; gap: 14px 28px; flex-wrap: wrap; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
.footer__links { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .topbar__brand { font-size: 17px; }
  .tariff__price { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
