@font-face {
  font-family: IRANSansX;
  src: url("../assets/fonts/IRANSansXV.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --bg: #f7fff7;
  --surface: rgba(255, 255, 255, 0.94);
  --text: #14221d;
  --muted: #697871;
  --line: rgba(15, 153, 112, 0.16);
  --green: #0f9970;
  --green-dark: #087356;
  --shadow: 0 28px 85px rgba(24, 47, 37, 0.14);
}

html[data-theme="dark"] {
  --bg: #101513;
  --surface: rgba(24, 33, 29, 0.94);
  --text: #f2f7f4;
  --muted: #b7c2bc;
  --line: rgba(255, 255, 255, 0.14);
  --green: #32c897;
  --green-dark: #54d3aa;
  --shadow: 0 28px 85px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100svh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(15, 153, 112, 0.17), transparent 28rem),
    radial-gradient(circle at 85% 82%, rgba(139, 92, 246, 0.09), transparent 25rem),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

html[dir="rtl"] body {
  font-family: IRANSansX, Tahoma, Arial, sans-serif;
}

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

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--green);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.card {
  position: relative;
  overflow: hidden;
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#languageSelect,
.theme-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

html[data-theme="dark"] #languageSelect,
html[data-theme="dark"] .theme-button {
  background: rgba(255, 255, 255, 0.06);
}

#languageSelect {
  padding: 0 12px;
}

.theme-button {
  width: 36px;
  padding: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

html[dir="rtl"] h1 {
  letter-spacing: 0;
}

.message {
  max-width: 430px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.store-button {
  display: inline-flex;
  min-height: 52px;
  min-width: 148px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-weight: 820;
  transition: transform 180ms ease, background-color 180ms ease;
}

.store-button:hover {
  transform: translateY(-2px);
  background: var(--green-dark);
}

.redirect-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.qr-panel {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.qr-panel h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.qr-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: 248px;
  height: 248px;
  margin: 20px auto 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

#qrImage {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}

.qr-url {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.download-qr {
  display: inline-flex;
  margin-top: 14px;
  color: var(--green);
  font-weight: 780;
}

.web-note {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.web-note a {
  color: var(--green);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.watermark {
  position: absolute;
  right: -58px;
  bottom: -76px;
  width: 250px;
  height: 250px;
  opacity: 0.045;
  transform: rotate(-8deg);
  pointer-events: none;
}

html[dir="rtl"] .topbar {
  direction: ltr;
}

html[dir="rtl"] .watermark {
  right: auto;
  left: -58px;
  transform: rotate(8deg);
}

@media (max-width: 560px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 24px 20px 28px;
  }

  .store-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-button {
    transition: none;
  }
}
