﻿:root {
  --bg-main: #040404;
  --bg-soft: #0a0a0a;
  --bg-card: #111;
  --ink: #f5eaea;
  --muted: #ac9a9a;
  --line: rgba(255, 72, 72, 0.16);
  --line-strong: rgba(255, 84, 84, 0.36);
  --accent: #cb2121;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #090909 0%, #050505 55%, #020202 100%);
  color-scheme: dark;
}

body {
  overflow-x: hidden;
  position: relative;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(72px);
  opacity: 0.22;
}

.glow-a {
  width: 280px;
  height: 280px;
  background: #9d1919;
  left: -120px;
  top: -70px;
  animation: slowFloatA 18s ease-in-out infinite;
}

.glow-b {
  width: 320px;
  height: 320px;
  background: #650f0f;
  right: -140px;
  top: 45%;
  animation: slowFloatB 21s ease-in-out infinite;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 50, 50, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 50, 50, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 90%);
}

.top-toast {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  transform: translate(-50%, -130%);
  width: min(92vw, 540px);
  z-index: 80;
  border: 1px solid rgba(255, 98, 98, 0.28);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(25, 11, 11, 0.96), rgba(14, 8, 8, 0.96));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(146, 22, 22, 0.22);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.top-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.7) 70%, transparent 100%);
  backdrop-filter: blur(6px);
  animation: topbarIn 0.6s ease;
}

.brand {
  font-family: "Russo One", sans-serif;
  letter-spacing: 0.12em;
  font-size: 18px;
  color: #e44444;
  text-shadow: 0 0 10px rgba(169, 36, 36, 0.35);
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 8px 12px calc(var(--safe-bottom) + 20px);
}

.screen[hidden] {
  display: none;
}

.screen {
  animation: screenIn 0.45s ease;
}

.hero {
  padding: 14px 0 18px;
}

.hero-badge {
  text-align: center;
  font-family: "Russo One", sans-serif;
  letter-spacing: 0.14em;
  font-size: clamp(34px, 12vw, 56px);
  color: #dc4d4d;
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 24px 14px;
  background: linear-gradient(145deg, rgba(15, 15, 15, 0.96), rgba(12, 12, 12, 0.96));
  box-shadow: inset 0 0 20px rgba(120, 23, 23, 0.24), 0 20px 40px rgba(0, 0, 0, 0.45);
  animation: badgeGlow 7s ease-in-out infinite;
}

.hero-subtitle {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.cards {
  display: grid;
  gap: 12px;
}

.feature-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 16px;
  background: linear-gradient(145deg, rgba(16, 16, 16, 0.98), rgba(12, 12, 12, 0.98));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(123, 24, 24, 0.08) 100%);
}

.feature-card h2 {
  margin: 6px 0 6px;
  font-size: 21px;
  font-family: "Russo One", sans-serif;
  position: relative;
}

.feature-card p {
  margin: 0 0 14px;
  font-size: 14px;
  color: #bca8a8;
  position: relative;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(161, 28, 28, 0.16);
  border: 1px solid rgba(217, 86, 86, 0.18);
  color: #d86a6a;
  position: relative;
}

.screen-plans {
  padding-top: 6px;
}

.plans-head {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(14, 14, 14, 0.98), rgba(10, 10, 10, 0.98));
  padding: 14px;
  margin-bottom: 12px;
}

.plans-head h3 {
  margin: 4px 0 6px;
  font-family: "Russo One", sans-serif;
  font-size: 22px;
}

.plans-head p {
  margin: 0;
  color: #b5a3a3;
  font-size: 14px;
}

.btn-back {
  width: auto;
  margin-bottom: 8px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plan-card {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px 10px;
  color: #fff2f2;
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.plan-name {
  display: block;
  font-size: 13px;
  color: #e8d7d7;
}

.plan-price {
  display: block;
  margin-top: 2px;
  font-family: "Russo One", sans-serif;
  font-size: 20px;
}

.plan-70 {
  background: linear-gradient(145deg, #2a1212, #1c0d0d);
}

.plan-200 {
  background: linear-gradient(145deg, #341313, #220d0d);
}

.plan-400 {
  background: linear-gradient(145deg, #431515, #290e0e);
}

.plan-800 {
  background: linear-gradient(145deg, #5b1616, #320e0e);
}

.plan-card.is-selected {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(168, 39, 39, 0.25);
}

.payment-panel {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 17, 17, 0.98), rgba(11, 11, 11, 0.98));
  padding: 12px;
}

.payment-panel p {
  margin: 0 0 10px;
  font-size: 14px;
  color: #d2bbbb;
}

.btn {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(208, 85, 85, 0.25);
  color: #f7eded;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.28s ease, filter 0.28s ease, border-color 0.28s ease;
  position: relative;
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: rgba(22, 22, 22, 0.9);
}

.topbar .btn {
  width: auto;
  min-width: 96px;
}

#openAuthModal {
  width: fit-content !important;
  min-width: 96px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 16px;
}

#openAuthModal.is-user-chip {
  border-color: rgba(86, 178, 116, 0.35);
  color: #caf7d7;
  background: linear-gradient(145deg, rgba(17, 35, 21, 0.95), rgba(12, 24, 15, 0.95));
}

.btn-primary {
  background: linear-gradient(145deg, #761515, #4f1111);
}

.btn-pay {
  background: linear-gradient(145deg, #a01d1d, #631212);
  font-family: "Russo One", sans-serif;
  letter-spacing: 0.04em;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -47%);
  width: min(94vw, 420px);
  border-radius: 18px;
  border: 1px solid rgba(255, 95, 95, 0.2);
  background: linear-gradient(145deg, rgba(15, 15, 15, 0.98), rgba(10, 10, 10, 0.98));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.65);
  padding: 14px;
  animation: modalIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-window h3 {
  margin: 0 0 12px;
  font-family: "Russo One", sans-serif;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #bf9e9e;
  cursor: pointer;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-tab {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(188, 66, 66, 0.2);
  background: rgba(18, 18, 18, 0.95);
  color: #d6c2c2;
  cursor: pointer;
}

.auth-tab.is-active {
  border-color: rgba(230, 82, 82, 0.45);
  background: linear-gradient(145deg, #5e1515, #3a1010);
  color: #fff4f4;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.input-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #d6c0c0;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(188, 68, 68, 0.24);
  background: linear-gradient(145deg, rgba(12, 12, 12, 0.95), rgba(16, 16, 16, 0.95));
  padding: 0 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.input-shell:focus-within {
  border-color: rgba(227, 82, 82, 0.6);
  box-shadow: 0 0 0 3px rgba(162, 32, 32, 0.18);
}

.input-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #a53333;
  box-shadow: 0 0 8px rgba(165, 51, 51, 0.5);
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  border: 0;
  outline: none;
  background: transparent !important;
  color: #fef4f4;
  -webkit-text-fill-color: #fef4f4;
  font-family: inherit;
  font-size: 14px;
}

.auth-form input::placeholder {
  color: #8f7575;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #111 inset !important;
  -webkit-text-fill-color: #fef4f4 !important;
  caret-color: #fef4f4;
  border-radius: 10px;
  transition: background-color 9999s ease-in-out 0s;
}

.reveal {
  opacity: 0;
  transform: translateY(12px) scale(0.995);
  transition: opacity 0.75s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes slowFloatA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(22px, 18px);
  }
}

@keyframes slowFloatB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-18px, -16px);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -47%) scale(1);
  }
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes topbarIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes badgeGlow {
  0%,
  100% {
    box-shadow: inset 0 0 20px rgba(120, 23, 23, 0.24), 0 20px 40px rgba(0, 0, 0, 0.45);
  }
  50% {
    box-shadow: inset 0 0 28px rgba(150, 35, 35, 0.3), 0 20px 44px rgba(0, 0, 0, 0.52);
  }
}

@media (min-width: 540px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card:nth-child(3) {
    grid-column: span 2;
  }
}

@media (hover: hover) {
  .btn:hover,
  .plan-card:hover,
  .feature-card:hover {
    filter: brightness(1.08);
  }

  .plan-card:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce), (max-width: 390px) {
  .bg-glow,
  .screen,
  .modal-window,
  .hero-badge,
  .topbar {
    animation: none !important;
  }

  .reveal,
  .btn,
  .plan-card {
    transition: none !important;
  }
}
