/* ░░░ AISong — публичный сайт. Mobile-first. ░░░ */
:root {
  --bg: #0b0820;
  --bg-2: #120d2e;
  --card: rgba(255, 255, 255, 0.04);
  --card-brd: rgba(255, 255, 255, 0.09);
  --txt: #f3f0ff;
  --muted: #a99fce;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --ok: #34d399;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1c1147 0%, var(--bg) 55%) fixed;
  color: var(--txt);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-weight: 800; }
h2 { font-size: 24px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
b { font-weight: 700; }

/* ── Header ── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 8, 32, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--card-brd);
}
.hdr-in {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 10px;
}
.logo { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; font-size: 20px; }
.logo-mark { font-size: 22px; }
.logo-txt { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hdr-right { display: flex; align-items: center; gap: 8px; }
.lang {
  background: transparent; border: 1px solid var(--card-brd); color: var(--muted);
  border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.lang .lang-opt.active { color: var(--txt); }
.lang .lang-sep { opacity: 0.4; margin: 0 2px; }
.code-btn {
  background: transparent; border: 1px solid var(--card-brd); color: var(--muted); gap: 5px;
  border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.code-btn:hover { border-color: var(--accent); color: var(--txt); }
.balance-pill {
  background: var(--card); border: 1px solid var(--card-brd); color: var(--txt);
  border-radius: 999px; padding: 7px 13px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.acc-btn {
  background: var(--accent-grad); border: 0; color: #fff;
  border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; font-size: 14px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

/* ── Hero ── */
.hero { position: relative; text-align: center; padding: 54px 18px 40px; overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% 0 auto 0; height: 480px;
  background: radial-gradient(50% 60% at 50% 0%, rgba(236, 72, 153, 0.28), transparent 70%);
  pointer-events: none;
}
.hero-in { position: relative; max-width: 760px; margin: 0 auto; }
.badge {
  display: inline-block; background: var(--card); border: 1px solid var(--card-brd);
  color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: 38px; letter-spacing: -0.5px; margin-bottom: 16px; }
.hero-sub { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 auto 26px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 24px; color: var(--muted); font-size: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius-sm); padding: 14px 20px;
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer; line-height: 1.1;
  transition: transform 0.12s ease, opacity 0.12s ease; width: 100%;
}
/* все мелкие кнопки в шапке — выравнивание содержимого по центру */
.lang, .code-btn, .balance-pill, .acc-btn, .modal-x {
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 22px rgba(139, 92, 246, 0.42); }
.btn-soft { background: var(--card); color: var(--txt); border: 1px solid var(--card-brd); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--card-brd); }
.btn-lg { padding: 17px 28px; font-size: 17px; width: auto; }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.row { display: flex; gap: 10px; margin: 12px 0; }
.row .btn { flex: 1; }

/* ── Wizard / card ── */
.wizard { max-width: 620px; margin: 8px auto 12px; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--card-brd); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow);
}
.step { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.back {
  background: none; border: 0; color: var(--muted); font-family: inherit; font-size: 14px;
  cursor: pointer; padding: 0 0 10px; font-weight: 600;
}
.alt-actions { margin-top: 14px; }
.divider { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0; position: relative; }
.divider::before, .divider::after { content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--card-brd); }
.divider::before { left: 0; } .divider::after { right: 0; }

/* inputs */
textarea, input[type="text"], input[type="tel"] {
  width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--card-brd);
  border-radius: var(--radius-sm); color: var(--txt); font-family: inherit; font-size: 16px;
  padding: 14px; resize: vertical; margin-bottom: 12px;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); }
.code-field { text-align: center; letter-spacing: 12px; font-size: 28px; font-weight: 800; padding-left: 24px; }

/* chips */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.chip {
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.22); border: 1px solid var(--card-brd); border-radius: var(--radius-sm);
  min-height: 54px; padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 15px;
  text-align: center; line-height: 1.25;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
}
.chip:active { transform: scale(0.97); }
.chip:hover { border-color: var(--accent); background: rgba(139, 92, 246, 0.12); }

/* generating / result */
.generating { text-align: center; padding: 24px 0; }
.spinner {
  width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.12); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-timer { margin-top: 14px; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-2); }
.player { background: rgba(0,0,0,0.25); border: 1px solid var(--card-brd); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.ptitle { font-weight: 700; margin-bottom: 8px; }
.player audio { width: 100%; }
.lyrics { background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); padding: 14px; white-space: pre-wrap; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }

/* ── History section (app mode) ── */
.history-sec { max-width: 620px; margin: 18px auto; padding: 0 16px; }
.history-sec h2 { text-align: center; }

/* ── How it works ── */
.how { max-width: 980px; margin: 36px auto; padding: 30px 16px; text-align: center; }
.how-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 22px 0 28px; }
.how-card { background: var(--card); border: 1px solid var(--card-brd); border-radius: var(--radius); padding: 22px 18px; text-align: left; }
.how-n {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px;
}
.how-card h3 { font-size: 17px; margin-bottom: 6px; }
.how-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ── Footer ── */
.ftr { text-align: center; padding: 30px 16px 40px; border-top: 1px solid var(--card-brd); margin-top: 20px; }
.ftr .logo { justify-content: center; margin-bottom: 8px; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(5, 3, 18, 0.72); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fade 0.2s ease; }
.modal-card {
  background: var(--bg-2); border: 1px solid var(--card-brd); border-radius: 22px 22px 0 0;
  width: 100%; max-width: 480px; padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
  position: relative; box-shadow: var(--shadow); animation: slideup 0.28s cubic-bezier(.2,.8,.2,1); max-height: 92vh; overflow-y: auto;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.modal-x { position: absolute; top: 14px; right: 14px; background: var(--card); border: 1px solid var(--card-brd); color: var(--muted); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }

/* cabinet */
.cab-phone { margin-bottom: 14px; font-weight: 600; }
.cab-balance { background: rgba(0,0,0,0.25); border: 1px solid var(--card-brd); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; }
.cab-balance-val { font-size: 30px; font-weight: 800; }
.cab-h3 { font-size: 16px; margin: 22px 0 10px; }
.cab-history { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.cab-item { background: rgba(0,0,0,0.22); border: 1px solid var(--card-brd); border-radius: var(--radius-sm); padding: 12px; }
.cab-item .ct { font-weight: 700; font-size: 14px; }
.cab-item audio { width: 100%; margin-top: 8px; }
.cab-item .cs { font-size: 12px; color: var(--muted); }

/* ── Toast ── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f1640; border: 1px solid var(--card-brd); color: var(--txt); padding: 13px 18px; border-radius: 12px; z-index: 200; max-width: 90vw; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }

/* ── Small phones: ужимаем шапку, чтобы «Кабинет» помещался ── */
@media (max-width: 480px) {
  .hdr-in { padding: 11px 12px; gap: 7px; }
  .code-btn .lbl { display: none; }      /* остаётся только иконка 🎟 */
  .code-btn { padding: 7px 10px; gap: 0; }
  .lang { padding: 6px 8px; }
  .acc-btn { padding: 8px 13px; font-size: 13px; }
  .balance-pill { padding: 7px 10px; font-size: 13px; }
}
@media (max-width: 360px) {
  .logo-txt { display: none; }            /* очень узкие экраны — только 🎵 */
}

/* ── Desktop ── */
@media (min-width: 720px) {
  .hero h1 { font-size: 52px; }
  .hero { padding: 80px 18px 56px; }
  .how-grid { grid-template-columns: repeat(4, 1fr); }
  .chips { grid-template-columns: repeat(3, 1fr); }
  .modal { align-items: center; }
  .modal-card { border-radius: 22px; }
}
