/* ============================================================
   «Вера» — тёмная премиальная тема (Motion Design 2.0)
   Глубина через box-shadow, стекло через backdrop-filter,
   движение через CSS keyframes + IntersectionObserver.
   ============================================================ */

:root {
  --bg: #08090c;
  --bg-elevated: #0e1015;
  --fg: #f2f4f7;
  --muted: #8b93a1;

  --accent-1: #34d399;
  --accent-2: #22d3ee;
  --accent-fg: #04140d;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));

  --card-bg: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-ambient: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 12px 34px -10px rgba(52, 211, 153, 0.45);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

/* [hidden] должен побеждать любой display: класс .btn (display: inline-flex)
   имеет ту же специфичность, что и UA-правило [hidden], и как авторский
   стиль перебивает его по каскаду — без этого скрытые кнопки всё равно
   видны (нашли на скриншоте кнопки "Остановить запись"). */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Нативный переход между страницами — Chrome/Edge применят кросс-фейд,
   остальные браузеры просто игнорируют правило и переходят как обычно. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.45s;
  animation-timing-function: var(--ease);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "SF Pro Display", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(52, 211, 153, 0.35); color: #fff; }

/* ---------------------------------------------------------- фон-«сияние» */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}
.aurora-bg span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  will-change: transform;
}
.aurora-bg span:nth-child(1) {
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
  top: -22%; left: -12%;
  animation: drift1 24s ease-in-out infinite alternate;
}
.aurora-bg span:nth-child(2) {
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  bottom: -26%; right: -16%;
  animation: drift2 28s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, 8vh) scale(1.15); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-8vw, -6vh) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora-bg span { animation: none; }
}

/* ---------------------------------------------------------------- шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--card-border);
}
.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.25s var(--ease);
}
.site-header nav a:hover { color: var(--fg); }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }
.hero-lead { color: var(--muted); font-size: 19px; }

/* ------------------------------------------------------------- reveal-in */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------- карточки-стекло */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-ambient);
  padding: 24px;
}

/* --------------------------------------------------------------- hero-видео */
.hero-video-placeholder {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-ambient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 16px;
  text-align: center;
  padding: 0 24px;
  --mx: 50%; --my: 50%;
}
.hero-video-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.10), transparent 60%);
  pointer-events: none;
}

.hero-video {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-ambient);
  margin-bottom: 24px;
}
.hero-video-el {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------- QR / слоган */
.qr-card {
  margin-top: 44px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.qr-card-img {
  flex: none;
  width: 108px;
  height: 108px;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
}
.qr-card-slogan {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.qr-card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
@media (max-width: 420px) {
  .qr-card { flex-direction: column; text-align: center; }
}

/* ------------------------------------------------------------------- кнопки */
.cta-row { margin: 24px 0; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 50px;
  font-family: inherit;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease), background 0.35s var(--ease);
}
.btn-primary {
  background: var(--accent-grad);
  color: var(--accent-fg);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.015); filter: brightness(1.06); box-shadow: 0 18px 44px -10px rgba(52, 211, 153, 0.6); }
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(0) scale(0.97); }

/* ------------------------------------------------------------- сообщество */
.community-teaser {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--card-border);
}
.community-teaser p { color: var(--muted); }

/* --------------------------------------------------------------- манифест */
.manifesto p {
  color: #d7dbe2;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------- вход */
.login-widget { margin: 24px 0; }
.login-note { color: var(--muted); }

/* ------------------------------------------------------------ формы шагов */
.step-hint { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.form input[type="tel"],
.form textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 18px;
  padding: 14px 16px;
  font-family: inherit;
  resize: vertical;
  cursor: text;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.form input[type="tel"]:hover,
.form textarea:hover { border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.08); }
.form input[type="tel"]::placeholder,
.form textarea::placeholder { color: var(--muted); opacity: 1; }
.form input[type="tel"]:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}

.recorder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
}
.rec-hint { color: var(--muted); margin: 0; font-size: 13px; }
.rec-status { color: var(--muted); min-height: 1.2em; margin: 0; font-size: 15px; }
.rec-player { width: 100%; }

.rec-stop { position: relative; }
.recorder.is-recording .rec-stop::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(239, 68, 68, 0.6);
  animation: pulse-ring 1.6s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .recorder.is-recording .rec-stop::before { animation: none; }
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* -------------------------------------------------------- выбор роли */
.role-form { display: grid; gap: 14px; margin-top: 28px; }
.role-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.role-card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: var(--shadow-ambient);
}
.role-card:active { transform: translateY(-1px) scale(0.99); }
.role-icon { font-size: 26px; }

/* ------------------------------------------------------------- кабинет */
.profile-card { margin: 24px 0; }
.profile-name { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.profile-meta { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.profile-roles { margin: 12px 0 0; }
.profile-status { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.tag {
  display: inline-block;
  background: var(--accent-grad);
  color: var(--accent-fg);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 700;
  margin-right: 8px;
}
.next-step-note { color: var(--muted); }

/* -------------------------------------------------------- флеш-результат */
.flash-card { margin: 20px 0; border-color: rgba(52, 211, 153, 0.35); }
.flash-title { font-weight: 700; margin: 0 0 6px; font-size: 19px; }
.flash-body { color: var(--muted); margin: 0; }
.privacy-form { margin-top: 14px; }
.privacy-buttons { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* --------------------------------------------------- "магическая кнопка" */
.talk-card { margin: 24px 0; }

/* ------------------------------------------------------------ свои заявки */
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin: 32px 0 14px; }
.requests-list { display: flex; flex-direction: column; gap: 14px; }
.request-card { padding: 18px 20px; }
.request-status {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.request-status.is-open { color: var(--accent-1); }
.request-status.is-closed { color: var(--muted); }
.request-text { margin: 0 0 10px; font-size: 17px; }
.request-meta { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.privacy-label { color: var(--muted); font-size: 14px; margin-right: 8px; }
.btn-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s var(--ease);
}
.btn-chip:hover { border-color: rgba(52, 211, 153, 0.4); color: var(--fg); }
.btn-chip.is-active {
  background: var(--accent-grad);
  color: var(--accent-fg);
  border-color: transparent;
}

/* ----------------------------------------------------------- статус-блок */
.status-card { margin: 24px 0; }
.status-row { color: var(--muted); margin: 0 0 8px; }
.status-card form { margin-top: 10px; }

.logout-link { margin-top: 12px; }

/* -------------------------------------------------------------- ошибки */
.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ff9a9a;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

/* -------------------------------------------------------------- подвал */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 32px 24px;
}
