:root {
  --bg: #0a0a0f;
  --card: #13131a;
  --primary: #7c3aed;
  --primary-2: #4f46e5;
  --accent: #a78bfa;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(124, 58, 237, 0.2);
  --success: #22c55e;
  --danger: #fb7185;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 58, 237, 0.18), transparent 34rem),
    radial-gradient(circle at 92% 22%, rgba(79, 70, 229, 0.14), transparent 30rem),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.app-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 20px 18px 52px;
  animation: riseIn 0.6s ease both;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand {
  display: grid;
  gap: 1px;
  min-height: 44px;
}

.brand span {
  width: fit-content;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand small, .support-text, .trust-line, .help-line, .legal-line, .result-meta {
  color: var(--muted);
}

.brand small { font-size: 0.76rem; }

.nav-links {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a {
  min-height: 44px;
  display: grid;
  place-items: center;
}

.hero {
  display: grid;
  gap: 22px;
  padding: 48px 0 0;
}

.hero-copy { display: grid; gap: 14px; }

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.35rem, 10vw, 5.5rem);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: 0;
}

.subheadline {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.6;
}

.search-panel, .loading-card, .result-card, .not-found, .policy-card {
  border: 1px solid var(--border);
  background: rgba(19, 19, 26, 0.88);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.search-panel, .loading-card, .result-card, .not-found {
  border-radius: 24px;
  padding: 16px;
}

.search-form { display: grid; gap: 14px; }

textarea {
  width: 100%;
  min-height: 148px;
  resize: vertical;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 20px;
  padding: 18px;
  background: rgba(10, 10, 15, 0.82);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

textarea:focus {
  border-color: rgba(167, 139, 250, 0.78);
  box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.16), 0 0 34px rgba(124, 58, 237, 0.22);
  animation: focusPulse 1.7s ease infinite;
}

.primary-button, .secondary-button, .copy-button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  padding: 0 22px;
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease, background-position 0.3s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-2), var(--primary));
  background-size: 220% 100%;
  box-shadow: 0 16px 36px rgba(79, 70, 229, 0.28);
}

.primary-button:hover, .copy-button:hover {
  transform: scale(1.02);
  background-position: 100% 50%;
}

.primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.loading-card { overflow: hidden; }

.pulse-dots {
  display: flex;
  gap: 9px;
  margin-bottom: 18px;
}

.pulse-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  animation: dotPulse 1.2s ease infinite;
}

.pulse-dots span:nth-child(2) { animation-delay: 0.16s; }
.pulse-dots span:nth-child(3) { animation-delay: 0.32s; }

.steps {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.steps p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.steps p span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  display: grid;
  place-items: center;
}

.steps p.done { color: var(--text); }
.steps p.done span { background: var(--success); border-color: var(--success); }
.steps p.done span::after { content: "✓"; font-size: 0.78rem; font-weight: 800; }

.shimmer-list {
  display: grid;
  gap: 12px;
}

.shimmer-list i {
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(167,139,250,0.16), rgba(255,255,255,0.04));
  background-size: 220% 100%;
  animation: shimmer 1.25s ease infinite;
}

.result-card {
  display: grid;
  gap: 12px;
  transition: filter 0.45s ease, transform 0.45s ease;
}

.result-card.locked .url-box {
  filter: blur(5px);
  user-select: none;
}

.result-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.source-badge {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
}

.result-card h2, .not-found h2, .payment-sheet h2 {
  margin: 0;
  font-size: 1.35rem;
}

.url-box, .blurred-preview {
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 16px;
  padding: 14px;
  min-height: 54px;
  background: rgba(10, 10, 15, 0.72);
  color: var(--text);
  word-break: break-word;
}

.copy-button {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.search-again {
  min-height: 44px;
  display: grid;
  align-items: center;
  color: var(--accent);
  font-weight: 700;
}

.not-found {
  display: grid;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 6, 0.54);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.payment-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  gap: 13px;
  padding: 12px 18px 22px;
  border-radius: 26px 26px 0 0;
  border: 1px solid var(--border);
  background: rgba(19, 19, 26, 0.98);
  box-shadow: 0 -22px 70px rgba(0, 0, 0, 0.46);
  transform: translateY(110%);
  transition: transform 0.35s ease;
}

.payment-sheet.visible { transform: translateY(0); }

.sheet-handle {
  justify-self: center;
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.34);
  margin-bottom: 4px;
}

.blurred-preview { filter: blur(4px); }

.price {
  font-size: 1.85rem;
  font-weight: 800;
}

.pay-button { width: 100%; }

.trust-line, .help-line, .legal-line {
  margin: 0;
  text-align: center;
  font-size: 0.86rem;
}

.legal-line a, .help-line a { color: var(--accent); }

.toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(19, 19, 26, 0.96);
  color: var(--text);
  text-align: center;
}

.policy-page {
  display: grid;
  gap: 22px;
  padding-top: 28px;
}

.policy-card {
  border-radius: 22px;
  padding: 20px;
  line-height: 1.7;
  color: var(--muted);
}

.policy-card h1, .policy-card h2 {
  color: var(--text);
}

.policy-card h1 {
  font-size: 2rem;
  line-height: 1.1;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 768px) {
  .app-shell { padding: 28px 28px 72px; }
  .hero { padding-top: 72px; grid-template-columns: 1.02fr 0.98fr; align-items: start; }
  .hero-copy { grid-column: 1 / -1; }
  .search-panel, .loading-card, .result-card, .not-found { padding: 22px; }
  .payment-sheet {
    left: 50%;
    right: auto;
    width: min(520px, calc(100% - 36px));
    transform: translate(-50%, 110%);
  }
  .payment-sheet.visible { transform: translate(-50%, 0); }
}

@media (min-width: 1024px) {
  .hero { grid-template-columns: 1fr 470px; }
  .hero-copy { grid-column: auto; padding-top: 14px; }
}

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

@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.13), 0 0 34px rgba(124, 58, 237, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(124, 58, 237, 0.2), 0 0 42px rgba(124, 58, 237, 0.26); }
}

@keyframes dotPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes shimmer {
  from { background-position: 0 0; }
  to { background-position: -220% 0; }
}

.video-result {
  display: grid;
  gap: 14px;
  animation: riseIn 0.45s ease both;
}

.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #050508;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.28), 0 22px 70px rgba(124, 58, 237, 0.28);
}

.video-player img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.player-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.05) 45%, rgba(0,0,0,0.78));
  transition: background 0.3s ease;
}

.video-player.buffering img { filter: brightness(0.55); transform: scale(1.015); }
.video-player.buffering .player-shade { background: rgba(0,0,0,0.56); }

.watermark {
  position: absolute;
  top: 14px;
  left: 14px;
  color: rgba(248, 250, 252, 0.58);
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0;
}

.play-control {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.play-control:hover { transform: translate(-50%, -50%) scale(1.04); background: rgba(255, 255, 255, 0.9); }

.play-control span {
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 22px solid #11111a;
  margin-left: 5px;
}

.buffer-spinner {
  position: absolute;
  left: calc(50% - 26px);
  top: calc(50% - 26px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.success-check {
  position: absolute;
  left: calc(50% - 32px);
  top: calc(50% - 32px);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(34, 197, 94, 0.95);
  font-size: 2.1rem;
  font-weight: 900;
  box-shadow: 0 0 34px rgba(34, 197, 94, 0.42);
}

.duration, .hd-badge {
  position: absolute;
  bottom: 18px;
  color: white;
  font-weight: 800;
  line-height: 1;
}

.duration {
  left: 14px;
  font-size: 14px;
}

.hd-badge {
  right: 14px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.26);
  font-size: 0.74rem;
}

.progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255,255,255,0.16);
}

.progress-track div {
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: width 2.2s cubic-bezier(.19,1,.22,1);
}

.video-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 0;
}

.video-info p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.inline-access {
  display: grid;
  gap: 10px;
  padding: 20px;
  margin-top: 2px;
  background: var(--card);
  border-top: 1px solid rgba(124, 58, 237, 0.58);
  border-radius: 0 0 16px 16px;
  animation: fadeInAccess 0.35s ease both;
}

.inline-access p, .inline-access h2 { margin: 0; }

.hosted-line {
  color: var(--muted);
  font-size: 12px;
}

.inline-access h2 {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
}

.social-proof {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 700;
}

.price-row strong {
  color: var(--text);
  font-size: 2.15rem;
  line-height: 1;
}

.discount {
  color: #86efac;
  font-size: 0.82rem;
  font-weight: 800;
}

.watch-button {
  min-height: 54px;
  width: 100%;
  font-size: 16px;
  animation: buttonPulse 2s ease-in-out infinite;
}

.access-note {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.opening-text {
  margin: 0;
  color: #86efac;
  font-weight: 800;
  text-align: center;
  animation: riseIn 0.35s ease both;
}

@media (max-width: 480px) {
  .video-player {
    aspect-ratio: auto;
    height: auto;
    padding-top: 56.25%;
  }
  .play-control {
    width: 64px;
    height: 64px;
  }
  .play-control span {
    border-top-width: 13px;
    border-bottom-width: 13px;
    border-left-width: 20px;
  }
  .inline-access { padding: 20px; }
  .duration { font-size: 14px; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

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