/* Сайт «Поздравления от звёзд» — тёмная тема, без внешних зависимостей. */

:root {
  --bg: #1b1714;        /* тёплый графит */
  --panel: #262019;     /* поверхность (карточки) */
  --panel-2: #322a20;   /* вложенная поверхность (инпуты, чипы, аватары) */
  --border: #3a2f23;    /* тёплая граница */
  --text: #f5efe6;      /* тёплый белый */
  --muted: #b3a794;     /* тёплый серо-бежевый */
  --accent: #e0a458;    /* янтарь — только CTA / текущий шаг / успех */
  --accent-2: #f2c186;  /* мягкий светлый янтарь */
  --ok: #9fc78d;        /* шалфейно-зелёный */
  --warn: #e8c268;      /* соломенно-жёлтый */
  --danger: #ea7061;    /* тёплый красный */
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(224, 164, 88, .05), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------- шапка/подвал ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.logo { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.logo .star { color: var(--accent); margin-right: 6px; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 56px; padding: 22px 0 40px;
  color: var(--muted); font-size: 14px;
}
footer a { color: var(--muted); }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px;
  align-items: center; padding: 34px 0 10px;
}
.hero h1 {
  font-size: 40px; line-height: 1.15; margin: 0 0 14px;
  letter-spacing: -.5px;
}
.hero .sub { color: var(--muted); font-size: 18px; margin: 0 0 20px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li {
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; color: var(--muted);
}
.steps b { color: var(--text); font-weight: 600; }

.hero-video { position: relative; }
.hero-video video {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: #14100d; display: block;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.hero-video .badge { position: absolute; left: 12px; top: 12px; }

/* ---------- карточки/формы ---------- */

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px;
  margin: 26px 0;
}
.card h2 {
  font-size: 21px; text-transform: none; letter-spacing: 0;
  font-weight: 600; color: var(--text);
  margin: 26px 0 14px;
}
.card h2:first-child { margin-top: 0; }

.personas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .personas { grid-template-columns: repeat(2, 1fr); } }

.persona {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel-2); padding: 14px; text-align: center;
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.persona:hover { border-color: #6e5b44; }
.persona.active {
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
  background: #2e261b;
}
.persona .ava {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  background: linear-gradient(135deg, #4a3b29, #332a1e);
  color: #ecdfc9; overflow: hidden;
}
.persona .ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Панель примера выбранной персоны: «что я получу» до оплаты */
.persona-example {
  display: flex; gap: 14px; align-items: center; margin-top: 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px;
}
@media (max-width: 560px) { .persona-example { flex-direction: column; text-align: center; } }
.persona-example .pe-thumb {
  position: relative; width: 220px; padding: 0; border: 0;
  border-radius: 10px; overflow: hidden; cursor: pointer; flex: 0 0 auto;
  background: #000; display: block;
}
.persona-example .pe-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.persona-example .pe-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: #fff; background: rgba(0, 0, 0, .25); text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.persona-example .pe-thumb:hover .pe-play { background: rgba(0, 0, 0, .45); }

/* Лайтбокс примера: крупнее плитки, но скромнее героя */
#videoModal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
#videoModal[hidden] { display: none; }
.vm-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.vm-box { position: relative; background: #14100d; border-radius: 14px; padding: 10px; box-shadow: 0 18px 48px rgba(0, 0, 0, .5); }
.vm-box video { width: min(500px, 92vw); aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.vm-close { position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; }
@media (max-width: 560px) { .vm-box video { width: 92vw; } }
.persona-example .pe-note { font-size: 14px; color: var(--fg); }
.persona-example .pe-note b { display: block; margin-bottom: 4px; }
.persona-example .pe-note .pe-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.persona .name { font-weight: 600; font-size: 15px; }
.persona .tag { font-size: 14px; color: var(--ok); }
.personas-more {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  font-size: 14px; padding: 4px 0 2px;
}

textarea {
  width: 100%; min-height: 170px; resize: vertical;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; font: inherit; outline: none;
}
textarea:focus, input:focus { border-color: var(--accent); }

.counter-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; color: var(--muted); font-size: 14px;
}
.counter-row b { color: var(--text); }

.bar { height: 6px; border-radius: 999px; background: var(--panel-2); margin-top: 8px; overflow: hidden; }
.bar > div {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #d8913e, var(--accent-2));
  border-radius: 999px; transition: width .2s;
}
.bar > div.warn { background: var(--warn); }
.bar > div.over { background: var(--danger); }

.note {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 14px;
}
.note.warn { background: rgba(232, 194, 104, .1); border: 1px solid rgba(232, 194, 104, .32); color: var(--warn); }
.note.danger { background: rgba(234, 112, 97, .1); border: 1px solid rgba(234, 112, 97, .35); color: var(--danger); }
.note.info { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }

input[type=email], input[type=text] {
  width: 100%; max-width: 420px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; font: inherit; outline: none;
}

.hint { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; }

.pay-row { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, #f2bd72, #d8913e);
  color: #241708; border: none; border-radius: 14px;
  padding: 15px 30px; font-size: 18px; font-weight: 600; cursor: pointer;
  transition: filter .15s, opacity .15s, transform .1s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); filter: brightness(.94); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:focus-visible, .btn-ghost:focus-visible {
  outline: 3px solid rgba(242, 189, 114, .55); outline-offset: 2px;
}
textarea:focus-visible, input:focus-visible {
  box-shadow: 0 0 0 3px rgba(224, 164, 88, .28);
}

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 20px; font: inherit; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { border-color: #6e5b44; }

.fine { color: var(--muted); font-size: 13px; margin-top: 16px; }
.fine a { color: var(--muted); }

.over-count { color: var(--danger); }

.consent {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 14px; color: var(--muted); font-size: 14.5px; cursor: pointer;
}
.consent input {
  width: 18px; height: 18px; margin: 1px 0 0; flex: none; cursor: pointer;
  accent-color: var(--accent);
}
.consent a { color: var(--muted); }

.legal-note {
  color: var(--muted); font-size: 14px; line-height: 1.55;
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px;
  text-align: left;
}
.legal-note a { color: var(--muted); }
.legal-note.plain { border-top: none; padding-top: 0; margin-top: 8px; }

@media (max-width: 640px) {
  .btn-primary { width: 100%; min-height: 54px; }
  .pay-row { gap: 10px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card h2 { margin: 20px 0 12px; }
}

/* ---------- страница заказа ---------- */

.order-wrap { max-width: 660px; margin: 40px auto 0; }
.order-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; text-align: center;
}
.order-card h1 { font-size: 24px; margin: 6px 0 6px; }
.order-meta { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.state-icon { font-size: 44px; }
.spinner {
  width: 44px; height: 44px; margin: 10px auto;
  border: 4px solid var(--panel-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.stage {
  font-size: 14px; padding: 5px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.stage.current {
  border-color: var(--accent); color: var(--text);
  background: rgba(224, 164, 88, .1);
}
.stage.done-stage { border-color: rgba(159, 199, 141, .45); color: var(--ok); }

.order-video {
  width: 100%; border-radius: 14px; border: 1px solid var(--border);
  background: #14100d; margin: 8px 0 16px;
}
.order-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.order-actions .btn-primary { text-decoration: none; font-size: 16px; padding: 13px 26px; }

.err-box { background: rgba(234, 112, 97, .08); border: 1px solid rgba(234, 112, 97, .35); border-radius: 12px; padding: 14px; color: var(--danger); font-size: 15px; white-space: pre-wrap; }

/* ---------- заглушка оплаты ---------- */

.pay-stub { max-width: 460px; margin: 60px auto 0; text-align: center; }
.pay-stub .amount { font-size: 34px; font-weight: 700; margin: 8px 0 2px; }
.pay-stub .demo-note { color: var(--warn); font-size: 14px; margin-top: 14px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
}

::selection { background: #e0a458; color: #241708; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #3a2f23; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4a3a28; }

/* ---------- «Как это работает» и FAQ ---------- */

.how { margin: 2px 0 0; }
.how h2 { font-size: 21px; font-weight: 600; margin: 0 0 10px; }
.how p { color: var(--muted); margin: 0; max-width: 78ch; }

.field-title {
  display: block; font-size: 21px; font-weight: 600; color: var(--text);
  margin: 26px 0 14px;
}

#faq details {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 10px;
}
#faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
#faq details p { color: var(--muted); margin: 10px 0 2px; line-height: 1.55; }

figure.hero-video { margin: 0; }

@media (max-width: 640px) { .field-title { margin: 20px 0 12px; } }

/* ---------- страница примеров и статус генератора ---------- */

.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 22px 0; }
@media (max-width: 700px) { .ex-grid { grid-template-columns: 1fr; } }
.ex-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.ex-card video {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--border);
  background: #14100d; display: block;
}
.ex-title { font-weight: 600; margin-top: 10px; }
.ex-note { color: var(--muted); font-size: 14px; }
.ex-note.avail { color: var(--ok); }

#gpuLine { margin-top: 16px; }
.gpu-on { color: var(--ok); }
.gpu-off { color: var(--danger); }
