:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  direction: rtl;
  font-family: Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.install-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--success);
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.install-btn:hover {
  background: #047857;
  transform: translateY(-1px);
}

.hero {
  padding: 72px 16px 40px;
}

.hero-content {
  width: min(860px, 100%);
  margin: 0 auto;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.8;
}

.hero h1 {
  margin: 22px auto 18px;
  font-size: clamp(2.15rem, 5vw, 4.5rem);
  line-height: 1.18;
  font-weight: 800;
}

.hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 2;
  font-size: 1.08rem;
}

.generator {
  width: min(680px, 100%);
  margin: 42px auto 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
}

#text {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#text:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

#text::placeholder {
  color: #94a3b8;
}

#generateBtn,
.download-btn {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  transition: background 0.2s ease, transform 0.2s ease;
}

#generateBtn:hover,
.download-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.download-btn {
  width: 100%;
  margin-top: 16px;
  background: #111827;
}

.download-btn:hover {
  background: #020617;
}

.offline-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.95rem;
  line-height: 1.9;
}

.status {
  min-height: 28px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.status.error {
  color: var(--danger);
}

.download-counter {
  margin: 8px 0 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.7;
}

.download-counter span {
  font-size: 0.95rem;
  font-weight: 700;
}

.download-counter strong {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 800;
  white-space: nowrap;
}

.qr-card {
  min-height: 344px;
  margin-top: 8px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: var(--surface);
}

#qrcode {
  display: grid;
  place-items: center;
}

#qrcode canvas,
#qrcode img {
  display: block;
  width: min(300px, calc(100vw - 88px));
  height: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.noscript {
  margin: 18px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.features {
  width: min(1120px, calc(100% - 32px));
  margin: 72px auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature {
  min-height: 190px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.feature-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 1.25rem;
}

.feature h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.contact-section {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto 56px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.contact-section h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.contact-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.contact-card {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.seo-content {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto 72px;
  padding-top: 16px;
  color: #243041;
}

.seo-content h2 {
  margin: 34px 0 12px;
  font-size: 1.55rem;
}

.seo-content h3 {
  margin: 24px 0 8px;
  font-size: 1.08rem;
}

.seo-content p,
.seo-content li {
  color: var(--muted);
  line-height: 2;
}

.seo-content ul {
  margin: 0;
  padding: 0 22px 0 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 700;
}

@media (max-width: 720px) {
  .nav {
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .contact-link,
  .install-btn {
    min-height: 38px;
    font-size: 0.84rem;
  }

  .install-btn {
    padding: 0 12px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero p {
    font-size: 1rem;
  }

  .generator {
    margin-top: 32px;
    padding: 14px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .qr-card {
    min-height: 304px;
  }

  .download-counter {
    align-items: flex-start;
    flex-direction: column;
  }

  .features {
    grid-template-columns: 1fr;
    margin: 48px auto;
  }

  .contact-section {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }

  .contact-card {
    width: 100%;
  }
}

@media (min-width: 721px) and (max-width: 1020px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
