/* FairPari APK — стили в духе Ahrefs: чистый, профессиональный интерфейс */
:root {
  --bg: #f7f8fa;
  --bg-card: #ffffff;
  --accent: #0075ff;
  --accent-hover: #0062d9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --max-width: 1100px;
  --header-h: 64px;
  --phone-frame: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header — фиксированный, как у Ahrefs */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo-link { display: flex; align-items: center; }
.logo-link img { height: 32px; width: auto; object-fit: contain; }
/* Бургер-кнопка: скрыта на десктопе */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: background .2s;
}
.burger-btn:hover { background: var(--bg); }
.burger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}
.burger-btn[aria-expanded="true"] .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn[aria-expanded="true"] .burger-line:nth-child(2) { opacity: 0; }
.burger-btn[aria-expanded="true"] .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 880px) {
  .burger-btn { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .site-header .wrap { position: relative; }
}
.header-cta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-download:hover { background: var(--accent-hover); text-decoration: none; }
.btn-register {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-register:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* Language + TOC dropdown */
.lang-toc-wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lang-dropdown select {
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.toc-toggle {
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
.toc-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 0;
  z-index: 200;
}
.toc-dropdown.open { display: block; }
.toc-dropdown a {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text);
}
.toc-dropdown a:hover { background: var(--bg); color: var(--accent); }

/* Hero: desktop — телефон со скриншотом */
.hero-section { padding: 40px 0 48px; }
.hero-desktop {
  display: none;
  justify-content: center;
  align-items: flex-start;
  gap: 48px;
  flex-wrap: wrap;
}
@media (min-width: 881px) { .hero-desktop { display: flex; } }
.phone-mockup {
  flex-shrink: 0;
  width: 280px;
  padding: var(--phone-frame);
  background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
  border-radius: 28px;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(255,255,255,0.05);
}
.phone-mockup img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #0f172a;
}
.hero-content { max-width: 520px; }
.hero-content h1 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}
.hero-mobile-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}
.hero-content .subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.hero-actions { margin-bottom: 16px; }
.hero-actions .btn-download { padding: 14px 28px; font-size: 16px; }
.hero-note { font-size: 13px; color: var(--text-muted); }
.hero-note .age { font-weight: 600; color: var(--text); }
.disclaimer-inline { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* Hero: mobile — баннер до 35vh */
.hero-mobile {
  display: none;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 35vh;
}
@media (max-width: 880px) {
  .hero-mobile { display: block; }
  .hero-mobile-content { display: block !important; padding-top: 16px; }
}
.hero-mobile img {
  display: block;
  width: 100%;
  height: 35vh;
  max-height: 280px;
  object-fit: cover;
  object-position: left top;
}

/* Sections */
section { padding: 40px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }
.section-with-list h3 { margin-top: 24px; }
.section-with-list ol { padding-left: 24px; margin: 12px 0; }
section ol {
  padding-left: 28px;
  padding-right: 20px;
  margin: 12px 0;
  list-style-position: outside;
}
h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
h3 { font-size: 17px; font-weight: 600; margin: 20px 0 10px; color: var(--text); }
p { font-size: 15px; color: var(--text-muted); margin-bottom: 12px; }
.section-intro { margin-bottom: 20px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg); font-weight: 600; color: var(--text); }
tr:last-child td { border-bottom: none; }
td { color: var(--text-muted); }
.table-compact { font-size: 13px; }
.table-compact th, .table-compact td { padding: 8px 12px; }
@media (max-width: 640px) {
  .table-compact { font-size: 12px; }
  .table-compact th, .table-compact td { padding: 6px 10px; }
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; font-size: 16px; }

/* Screenshot block */
.section-screenshot { margin: 20px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.section-screenshot img { display: block; width: 100%; height: auto; max-width: 800px; }
.section-screenshot figcaption { font-size: 13px; color: var(--text-muted); padding: 10px 16px; border-top: 1px solid var(--border); }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-item.open { border-color: var(--accent); box-shadow: var(--shadow); }
.faq-toggle {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.faq-toggle:hover { background: var(--bg); }
.faq-icon { color: var(--text-muted); transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(90deg); color: var(--accent); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .25s ease-out; }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner { padding: 0 20px 16px; font-size: 14px; color: var(--text-muted); }

/* Support */
.support-contacts ul { margin: 8px 0; padding-left: 24px; }
.support-list { margin: 8px 0 16px 24px; padding: 0; font-size: 15px; color: var(--text-muted); }
.support-list li { margin-bottom: 6px; }

/* Buttons in content */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }

/* Sticky banner */
.sticky-banner {
  position: fixed;
  bottom: 16px;
  left: 20px;
  right: 20px;
  z-index: 999;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}
.sticky-banner-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sticky-banner-title .bonus { color: var(--accent); }
.sticky-banner .btn-download { flex-shrink: 0; }
body { padding-bottom: 100px; }
@media (max-width: 640px) {
  .sticky-banner { flex-direction: column; text-align: center; left: 12px; right: 12px; bottom: 12px; }
  .sticky-banner .btn-download { width: 100%; justify-content: center; }
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0 24px;
  margin-top: 40px;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 14px;
}
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }
.footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
  font-size: 12px;
}
.footer-legal-nav a { color: var(--text-muted); }
.footer-legal-nav a:hover { color: var(--accent); }
.footer-legal { font-size: 12px; }
.footer-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.footer-logo-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}
.footer-logo-link img { height: 24px; width: auto; margin-right: 6px; }
.footer-logo-link:hover { color: var(--accent); }
.footer-disclaimer { font-size: 12px; color: var(--text-muted); }
.footer-disclaimer .age { font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Legal pages */
.legal-page main { padding: 32px 20px 80px; }
.legal-page h1 { font-size: 26px; margin-bottom: 16px; }
.legal-page h2 { font-size: 20px; margin-top: 24px; }
