:root {
  color-scheme: dark;
  --bg: #070a12;
  --card: rgba(18, 23, 36, 0.94);
  --text: #f4f6fc;
  --muted: #9aa4bc;
  --accent: #7c8cff;
  --accent-strong: #5f74ff;
  --danger: #ff7182;
  --ok: #48d89b;
  --gold: #f5d56e;
  --emerald: #34d399;
  --border: rgba(155, 168, 205, 0.16);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  --font: "Vazirmatn", "Vazir", "Sahel", Tahoma, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.light-rays-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.light-rays-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

main {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}
.hero { text-align: center; padding: 10px 8px 8px; }

.brand-wrap {
  position: relative;
  width: min(220px, 72vw);
  height: 120px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  overflow: visible;
}
.brand-glow {
  position: absolute;
  z-index: 0;
  width: 88px;
  height: 88px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(245, 213, 110, 0.55) 0%,
    rgba(52, 211, 153, 0.28) 42%,
    transparent 72%
  );
  filter: blur(8px);
  animation: brand-core-glow 2.2s ease-in-out infinite;
}
.brand-mark {
  position: relative;
  z-index: 3;
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245, 213, 110, 0.55))
    drop-shadow(0 0 22px rgba(52, 211, 153, 0.35));
  animation: brand-mark-glow 2.2s ease-in-out infinite;
}
.brand-beam {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  border-radius: 999px;
}
.brand-beam-h {
  width: min(210px, 70vw);
  height: 3.5px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold) 12%,
    #fde68a 30%,
    #a7f3d0 50%,
    var(--emerald) 70%,
    #6ee7b7 88%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(245, 213, 110, 0.9),
    0 0 18px rgba(245, 213, 110, 0.55),
    0 0 32px rgba(52, 211, 153, 0.55),
    0 0 48px rgba(52, 211, 153, 0.28);
  animation: beam-pulse-h 2.1s ease-in-out infinite;
}
.brand-beam-h-soft {
  z-index: 0;
  height: 14px;
  width: min(230px, 78vw);
  filter: blur(7px);
  opacity: 0.55;
  box-shadow: none;
  animation: beam-pulse-h-soft 2.1s ease-in-out infinite;
}
.brand-beam-v {
  width: 3px;
  height: 78px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--gold) 18%,
    #a7f3d0 50%,
    var(--emerald) 82%,
    transparent 100%
  );
  box-shadow:
    0 0 8px rgba(245, 213, 110, 0.75),
    0 0 18px rgba(52, 211, 153, 0.45),
    0 0 30px rgba(52, 211, 153, 0.25);
  animation: beam-pulse-v 2.1s ease-in-out infinite;
}
.brand-beam-v-soft {
  z-index: 0;
  width: 12px;
  height: 92px;
  filter: blur(7px);
  opacity: 0.5;
  box-shadow: none;
  animation: beam-pulse-v-soft 2.1s ease-in-out infinite;
}

@keyframes brand-core-glow {
  0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.82); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
}
@keyframes brand-mark-glow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(245, 213, 110, 0.35))
      drop-shadow(0 0 14px rgba(52, 211, 153, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(245, 213, 110, 0.85))
      drop-shadow(0 0 28px rgba(52, 211, 153, 0.55));
  }
}
@keyframes beam-pulse-h {
  0%, 100% {
    transform: translate(-50%, -50%) scaleX(0.58);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) scaleX(1.16);
    opacity: 1;
  }
}
@keyframes beam-pulse-h-soft {
  0%, 100% {
    transform: translate(-50%, -50%) scaleX(0.55);
    opacity: 0.25;
  }
  50% {
    transform: translate(-50%, -50%) scaleX(1.22);
    opacity: 0.75;
  }
}
@keyframes beam-pulse-v {
  0%, 100% {
    transform: translate(-50%, -50%) scaleY(0.72);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) scaleY(1.1);
    opacity: 1;
  }
}
@keyframes beam-pulse-v-soft {
  0%, 100% {
    transform: translate(-50%, -50%) scaleY(0.7);
    opacity: 0.22;
  }
  50% {
    transform: translate(-50%, -50%) scaleY(1.16);
    opacity: 0.7;
  }
}

h1 {
  margin: 0 0 7px;
  font-size: clamp(1.55rem, 6vw, 2rem);
  letter-spacing: -0.025em;
  font-weight: 800;
  background: linear-gradient(180deg, #fff 20%, #c9d2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 { margin: 0 0 14px; font-size: 1.12rem; font-weight: 700; }
#title, #subtitle { text-align: center; unicode-bidi: plaintext; }
#subtitle { margin: 0; font-size: 0.93rem; }
.muted { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  margin-top: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: card-in 180ms ease-out;
}
.hidden { display: none !important; }

.privacy, .note {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 14px;
  unicode-bidi: plaintext;
}
.note {
  background: linear-gradient(135deg, rgba(245, 213, 110, 0.06), rgba(52, 211, 153, 0.06));
  border: 1px solid rgba(124, 140, 255, 0.16);
  border-radius: 14px;
  padding: 12px 14px;
}
.note-cookie-chips {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  direction: ltr;
}
.devel-download {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent, #7c8cff);
  font-weight: 600;
  text-decoration: underline;
  direction: ltr;
  unicode-bidi: isolate;
}
.ltr-token {
  display: inline;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

.steps {
  color: var(--muted);
  margin: 0 0 16px;
  padding-inline-start: 1.35rem;
  line-height: 1.75;
  counter-reset: none;
}
.steps li {
  margin: 10px 0;
  unicode-bidi: plaintext;
}
.steps li.step-featured {
  list-style: none;
  margin: 12px 0 14px;
  margin-inline-start: -1.35rem;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(155, 168, 205, 0.18);
  background:
    linear-gradient(160deg, rgba(245, 213, 110, 0.07), rgba(18, 23, 36, 0.2) 42%, rgba(52, 211, 153, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.steps li.step-featured--cookies {
  background:
    linear-gradient(160deg, rgba(52, 211, 153, 0.08), rgba(18, 23, 36, 0.2) 45%, rgba(124, 140, 255, 0.08));
}
.step-lead {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.55;
  margin-bottom: 10px;
  unicode-bidi: plaintext;
}
.steps .step-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  direction: ltr;
  unicode-bidi: isolate;
}
.steps .step-path--nav {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}
.steps .step-path--nav .chip-arrow {
  align-self: center;
  transform: rotate(90deg);
  margin: -1px 0;
  opacity: 0.85;
}
.steps .step-path--cookies {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid rgba(245, 213, 110, 0.28);
  background: rgba(245, 213, 110, 0.08);
  color: #f6e7b0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  direction: ltr;
  unicode-bidi: isolate;
  word-break: break-word;
  text-align: center;
}
.chip-nav {
  width: 100%;
  border-color: rgba(245, 213, 110, 0.32);
  background: linear-gradient(135deg, rgba(245, 213, 110, 0.14), rgba(52, 211, 153, 0.06));
  box-shadow: 0 0 0 1px rgba(245, 213, 110, 0.04), 0 8px 18px rgba(0, 0, 0, 0.18);
}
.chip-url {
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.16), rgba(16, 185, 129, 0.06));
  color: #9af0c8;
  font-size: 0.72rem;
}
.chip-cookie {
  width: 100%;
  border-radius: 14px;
  border-color: rgba(124, 140, 255, 0.35);
  background: linear-gradient(145deg, rgba(124, 140, 255, 0.16), rgba(52, 211, 153, 0.08));
  color: #d7ddff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  padding: 11px 12px;
  font-size: 0.84rem;
}
.steps .step-path--cookies .chip-arrow {
  display: none;
}
.chip-arrow {
  color: var(--emerald);
  font-weight: 800;
  font-size: 0.82rem;
  opacity: 0.9;
  flex: 0 0 auto;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 15px 0 2px;
  line-height: 1.65;
}
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  flex: 0 0 auto;
  border: 1.5px solid rgba(155, 168, 205, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-content: center;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
input[type="checkbox"]::before {
  content: "";
  width: 11px;
  height: 11px;
  transform: scale(0);
  transition: transform 90ms ease-in-out;
  background: var(--emerald);
  clip-path: polygon(14% 44%, 0 65%, 36% 100%, 100% 18%, 82% 0, 36% 68%);
}
input[type="checkbox"]:checked {
  border-color: rgba(52, 211, 153, 0.75);
  background: rgba(52, 211, 153, 0.12);
}
input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.device-btn {
  margin: 0;
  min-height: 68px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  transition: border-color 140ms ease, background 140ms ease;
}
.device-btn:hover {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}
.device-btn span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  unicode-bidi: isolate;
}
.device-btn:active:not(:disabled) { transform: scale(0.98); }

.guide-videos {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.guide-video {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.guide-video summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  user-select: none;
}
.guide-video summary::-webkit-details-marker { display: none; }
.guide-video summary::after {
  content: "▾";
  float: inline-end;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.guide-video[open] summary::after { content: "▴"; }
.guide-video video {
  display: block;
  width: 100%;
  max-height: 280px;
  background: #000;
  border-top: 1px solid var(--border);
}

.cookie-fields {
  display: grid;
  gap: 14px;
  margin: 0 0 4px;
}
.cookie-field {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}
.cookie-field-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #e8edff;
  letter-spacing: 0.01em;
  unicode-bidi: plaintext;
  direction: ltr;
  text-align: start;
}
.cookie-field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  unicode-bidi: plaintext;
}
.cookie-field-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: stretch;
  direction: ltr;
  unicode-bidi: isolate;
}
.cookie-field-row input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: rgba(7, 10, 16, 0.78);
  color: var(--text);
  padding: 12px;
  font: 0.8rem/1.45 var(--font-mono);
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}
.cookie-field-row input:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}
button.cookie-paste {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 84px;
  min-height: 44px;
  margin: 0 !important;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}
button.cookie-paste:active:not(:disabled) { transform: scale(0.98); }
button.cookie-paste.ok {
  border-color: rgba(72, 216, 155, 0.45);
  color: var(--ok);
}
button.cookie-paste:disabled {
  opacity: 0.55;
}
button {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(85, 101, 230, 0.22);
}
button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  box-shadow: none;
}
button.ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  min-height: 40px;
  margin-top: 6px;
}
button:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
button.is-loading {
  opacity: 0.92;
  cursor: wait;
  box-shadow: 0 10px 25px rgba(85, 101, 230, 0.18);
  animation: probe-pulse 1.4s ease-in-out infinite;
}
@keyframes probe-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  margin: 15px 2px 0;
  text-align: center;
  line-height: 1.55;
  unicode-bidi: plaintext;
}

.role {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.role:last-child { border-bottom: 0; }
.role label { flex: 1; min-width: 0; line-height: 1.55; unicode-bidi: isolate; }
.role-main { display: block; font-weight: 700; }
.role-meta {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .card { direction: rtl; text-align: right; }
[dir="ltr"] .card { direction: ltr; text-align: left; }
[dir="rtl"] .role-meta, [dir="ltr"] .role-meta { text-align: start; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 380px) {
  main { padding-inline: 12px; }
  .card { padding: 16px; border-radius: 17px; }
  .device-grid { grid-template-columns: 1fr; }
  .steps li.step-featured { padding: 11px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
