/* ==========================================================================
   Raffly — стили страниц
   ========================================================================== */

/* ---------- Главная: герой ---------- */

.hero {
  position: relative;
  padding-block: clamp(32px, 6vw, 72px) clamp(40px, 7vw, 88px);
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  background: radial-gradient(
      60% 55% at 20% 20%,
      color-mix(in srgb, var(--accent) 18%, transparent) 0%,
      transparent 70%
    ),
    radial-gradient(
      45% 45% at 85% 10%,
      color-mix(in srgb, var(--gold) 16%, transparent) 0%,
      transparent 70%
    );
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.hero__grid {
  display: grid;
  gap: var(--s-10);
  align-items: center;
}

@media (min-width: 980px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--s-12);
  }
}

.hero__title {
  margin-top: var(--s-4);
}

.hero__lead {
  margin-top: var(--s-5);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: var(--muted);
  max-width: 34ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-8);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin-top: var(--s-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.hero__meta li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.hero__meta svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* Демо-карточка в герое */
.hero-demo {
  position: relative;
  padding: var(--s-5);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.hero-demo__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.hero-demo__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}

.hero-demo .draw-stage {
  min-height: 260px;
  background: var(--surface-2);
}

.hero-demo__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-4);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ---------- Логотипы/«полоса доверия» ---------- */

.trust-strip {
  padding-block: var(--s-6);
  border-block: 1px solid var(--line);
  background: var(--bg-elevated);
}

.trust-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2) var(--s-3);
}

.trust-strip__inner span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-inline: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--ink-soft);
}

/* ---------- Секции ---------- */

.section-head {
  display: grid;
  gap: var(--s-3);
  max-width: 62ch;
  margin-bottom: var(--s-10);
}

.section-head--center {
  justify-items: center;
  text-align: center;
  margin-inline: auto;
}

.feature {
  display: grid;
  gap: var(--s-3);
  align-content: start;
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.feature__icon svg {
  width: 22px;
  height: 22px;
}

.feature__title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.feature__text {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

/* Шаги «как это работает» */
.how-grid {
  display: grid;
  gap: var(--s-5);
  counter-reset: how;
}

@media (min-width: 800px) {
  .how-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.how-step {
  position: relative;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.how-step__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

/* Блок честности */
.proof {
  display: grid;
  gap: var(--s-8);
  align-items: center;
}

@media (min-width: 900px) {
  .proof {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-12);
  }
}

.proof__code {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.proof__code-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.proof__code pre {
  margin: 0;
  padding: var(--s-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  color: var(--ink-soft);
}

.proof__code b {
  color: var(--accent);
  font-weight: 650;
}

/* Режимы */
.modes {
  display: grid;
  gap: var(--s-4);
}

@media (min-width: 720px) {
  .modes {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mode {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color var(--dur-base), transform var(--dur-base) var(--ease-out);
}

.mode:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.mode__visual {
  display: grid;
  place-items: center;
  height: 96px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent);
  margin-bottom: var(--s-2);
}

.mode__visual svg {
  width: 40px;
  height: 40px;
}

/* CTA-полоса */
.cta-band {
  position: relative;
  display: grid;
  gap: var(--s-5);
  justify-items: center;
  text-align: center;
  padding: clamp(32px, 6vw, 64px) var(--s-6);
  border-radius: var(--radius-xl);
  background: linear-gradient(
      140deg,
      color-mix(in srgb, var(--accent) 92%, #000) 0%,
      var(--accent) 55%,
      color-mix(in srgb, var(--accent) 70%, var(--gold)) 100%
    );
  color: #fff;
  overflow: hidden;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  color: rgb(255 255 255 / 82%);
  max-width: 52ch;
}

.cta-band .btn--secondary {
  --btn-bg: #fff;
  --btn-ink: var(--accent-active);
  --btn-border: transparent;
}

/* FAQ */
.faq {
  display: grid;
  gap: var(--s-3);
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--s-4) var(--s-5);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  align-items: center;
  min-height: 32px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-out);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin-top: var(--s-3);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ---------- Конструктор ---------- */

.builder {
  display: grid;
  gap: var(--s-8);
  align-items: start;
}

@media (min-width: 980px) {
  .builder {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: var(--s-10);
  }
}

.builder__panel {
  min-width: 0;
}

.builder__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--s-5));
  display: grid;
  gap: var(--s-4);
}

@media (max-width: 979px) {
  .builder__aside {
    position: static;
  }
}

.step-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.step-head__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 750;
}

.step-head__title {
  font-size: var(--text-lg);
  font-weight: 700;
}

/* Источники */
.sources {
  display: grid;
  gap: var(--s-2);
}

.source {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: var(--s-3) var(--s-4);
  align-items: center;
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast),
    box-shadow var(--dur-fast);
}

.source:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.source[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}

.source:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.source__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.source[aria-pressed="true"] .source__icon {
  background: var(--accent);
  color: var(--accent-ink);
}

.source__icon svg {
  width: 22px;
  height: 22px;
}

.source__title {
  font-weight: 650;
  font-size: var(--text-sm);
}

.source__desc {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* Статистика */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stat {
  padding: var(--s-4);
  background: var(--surface);
  display: grid;
  gap: 2px;
}

.stat__value {
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat__label {
  font-size: var(--text-xs);
  color: var(--muted);
}

.stat--danger .stat__value {
  color: var(--danger);
}

.stat--success .stat__value {
  color: var(--success);
}

/* ---------- Публичная страница розыгрыша ---------- */

.result-hero {
  padding-block: var(--s-10);
  background: radial-gradient(
      80% 100% at 50% 0%,
      color-mix(in srgb, var(--accent) 10%, transparent) 0%,
      transparent 70%
    ),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.result-hero__grid {
  display: grid;
  gap: var(--s-8);
  align-items: start;
}

@media (min-width: 900px) {
  .result-hero__grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.winner-card {
  display: grid;
  gap: var(--s-3);
  justify-items: center;
  padding: var(--s-8) var(--s-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.winner-card__avatar {
  width: 88px;
  height: 88px;
  font-size: var(--text-2xl);
}

.winner-card__name {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.winner-card__prize {
  font-size: var(--text-sm);
  color: var(--muted);
}

.protocol {
  display: grid;
  gap: var(--s-3);
}

.protocol__row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 1px dashed var(--line);
  font-size: var(--text-sm);
  align-items: baseline;
}

.protocol__row:last-child {
  border-bottom: 0;
}

.protocol__key {
  color: var(--muted);
}

.protocol__value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  word-break: break-all;
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
}

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.copy-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Страница блогера ---------- */

.profile-head {
  display: grid;
  gap: var(--s-5);
  padding-block: var(--s-10);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .profile-head {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-6);
  }
}

.profile-head__name {
  font-size: clamp(1.75rem, 4vw, var(--text-3xl));
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-head__bio {
  color: var(--muted);
  max-width: 56ch;
  margin-top: var(--s-2);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 var(--s-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 550;
  text-decoration: none;
}

.social-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.social-link svg {
  width: 16px;
  height: 16px;
}

.giveaway-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}

.giveaway-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: inherit;
}

.giveaway-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.giveaway-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

.giveaway-card__winner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

/* ---------- Рандомайзер ---------- */

.rng {
  display: grid;
  gap: var(--s-8);
}

@media (min-width: 900px) {
  .rng {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.rng__result {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--s-8) var(--s-5);
  border-radius: var(--radius-lg);
  background: radial-gradient(
      100% 100% at 50% 0%,
      color-mix(in srgb, var(--accent) 12%, transparent) 0%,
      transparent 70%
    ),
    var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
}

.rng__numbers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
}

.rng__number {
  display: grid;
  place-items: center;
  min-width: 88px;
  height: 88px;
  padding-inline: var(--s-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-2xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ---------- Правовые страницы ---------- */

.legal {
  padding-block: var(--s-10);
}

.legal h1 {
  font-size: clamp(1.75rem, 3.4vw, var(--text-3xl));
  margin-bottom: var(--s-2);
}

.legal__updated {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--s-8);
}

.legal h2 {
  font-size: var(--text-xl);
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
}

.legal h3 {
  font-size: var(--text-base);
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
}

.legal p,
.legal li {
  color: var(--ink-soft);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

.legal p + p,
.legal ul + p,
.legal p + ul {
  margin-top: var(--s-3);
}

.legal ul {
  list-style: disc;
  padding-left: 1.4em;
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.legal ol {
  list-style: decimal;
  padding-left: 1.6em;
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.legal__toc {
  padding: var(--s-5);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: var(--s-8);
}

.legal__toc ol,
.legal__toc ul {
  margin-top: var(--s-3);
  font-size: var(--text-sm);
}

.legal__toc ul {
  list-style: none;
  padding-left: 0;
}

.legal__toc li {
  padding-block: 3px;
}

.legal__note {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: var(--text-sm);
}

/* ---------- 404 ---------- */

.notfound {
  display: grid;
  place-items: center;
  min-height: 62vh;
  text-align: center;
  padding-block: var(--s-16);
}

.notfound__code {
  font-size: clamp(4rem, 16vw, 9rem);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Шаги-индикатор в конструкторе ---------- */

.progress {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  font-size: var(--text-sm);
  color: var(--muted);
}

.progress__bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}
