/* ============================================================
   shared.css — общие стили для всех страниц
   Калькулятор автоимпорта в Беларусь
   ============================================================ */

:root {
  --bg: #f5f4ef;
  --bg-card: #ffffff;
  --bg-elev: #faf9f4;
  --ink: #14202e;
  --ink-2: #4d5b6f;
  --ink-3: #8e94a3;
  --line: #e8e6df;
  --line-2: #cfccc1;
  --accent: #1d4e60;
  --accent-soft: #d6e4e8;
  --accent-dark: #143a48;
  --gold: #a87425;
  --gold-soft: #c89554;
  --gold-pale: #f5e8d0;
  --good: #2d6a3e;
  --bad: #a13b2e;
  --warn: #a87425;
  --info: #1d4e60;
  --shadow: 0 1px 3px rgba(20,32,46,0.05), 0 8px 24px rgba(20,32,46,0.06);
  --shadow-strong: 0 4px 12px rgba(20,32,46,0.1), 0 20px 50px rgba(20,32,46,0.12);
  --radius: 6px;
  --radius-lg: 10px;
  --fs-xxs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --fs-4xl: 36px;
  --fs-5xl: 48px;
  --topnav-h: 60px;
  --container-pad: 32px;
}

@media (max-width: 1024px) {
  :root {
    --fs-xs: 13px;
    --fs-sm: 14px;
    --fs-base: 15px;
    --fs-md: 16px;
    --fs-lg: 17px;
    --fs-xl: 19px;
    --fs-3xl: 26px;
    --fs-4xl: 32px;
    --fs-5xl: 40px;
    --container-pad: 20px;
  }
}

@media (max-width: 640px) {
  :root {
    --fs-2xl: 20px;
    --fs-3xl: 23px;
    --fs-4xl: 28px;
    --fs-5xl: 36px;
    --topnav-h: 56px;
    --container-pad: 14px;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topnav-h) + 12px); }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(29,78,96,0.04) 0%, transparent 35%),
    radial-gradient(circle at 85% 90%, rgba(168,116,37,0.04) 0%, transparent 35%);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px var(--container-pad);
  padding-top: calc(var(--topnav-h) + 24px);
}

@media (max-width: 640px) {
  .container { padding-top: calc(var(--topnav-h) + 14px); padding-bottom: 90px; }
}

/* TOP NAVIGATION */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.topnav-inner {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  gap: 24px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.topnav-brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--gold-pale);
  border-radius: 8px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.topnav-brand-text {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topnav-brand-text small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 12px;
}

.topnav-links a {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  letter-spacing: -0.005em;
}

.topnav-links a:hover, .topnav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.topnav-cta {
  padding: 8px 16px;
  background: var(--ink);
  color: white !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.topnav-cta:hover { background: var(--accent); }

.topnav-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.topnav-menu-toggle span {
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}

.topnav-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.topnav-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.topnav-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 1024px) {
  .topnav-links {
    position: fixed;
    top: var(--topnav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    padding: 8px;
    gap: 2px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    box-shadow: 0 8px 20px rgba(20,32,46,0.08);
  }
  .topnav-links.open { max-height: 500px; padding: 12px 16px; }
  .topnav-links a { padding: 12px 14px; font-size: 15px; border-radius: 6px; }
  .topnav-menu-toggle { display: flex; order: 5; }
  .topnav-cta { display: none; }
}

@media (max-width: 640px) {
  .topnav-inner { gap: 12px; }
  .topnav-brand-icon { width: 32px; height: 32px; font-size: 18px; }
  .topnav-brand-text { font-size: 13px; }
  .topnav-brand-text small { font-size: 8.5px; }
}

@media (max-width: 380px) {
  .topnav-brand-text small { display: none; }
}

/* HERO - заголовок страницы */
.page-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
  margin-bottom: 32px;
}

.page-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-kicker::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: var(--accent);
}

.page-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: var(--fs-4xl);
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.025em;
  max-width: 760px;
  font-variation-settings: "opsz" 144;
}

.page-subtitle {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: var(--fs-md);
  max-width: 720px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .page-hero { padding-bottom: 18px; margin-bottom: 18px; }
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

@media (max-width: 768px) {
  .card { padding: 22px 18px; border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .card { padding: 18px 14px; }
}

.section-anchor {
  margin-top: 28px;
  margin-bottom: 16px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: var(--fs-3xl);
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
}

@media (max-width: 640px) {
  .section-anchor { margin-top: 22px; margin-bottom: 12px; }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 46px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary { background: var(--ink); color: var(--bg-card); }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--ink); color: var(--ink); }

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ink);
  color: rgba(255,255,255,0.92);
  padding: 18px 0;
  z-index: 1500;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 3px solid var(--gold-soft);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
}

.cookie-banner.show { transform: translateY(0); }

.cookie-banner-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  font-size: var(--fs-sm);
  line-height: 1.55;
  min-width: 280px;
}

.cookie-banner-text strong { color: var(--gold-soft); font-weight: 700; }
.cookie-banner-text a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 2px; }

.cookie-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.cookie-banner-btn {
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s ease;
  min-height: 42px;
}

.cookie-banner-btn.accept { background: var(--gold-soft); color: var(--ink); }
.cookie-banner-btn.accept:hover { background: var(--gold-pale); }
.cookie-banner-btn.decline {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.25);
}
.cookie-banner-btn.decline:hover { color: white; border-color: white; }

@media (max-width: 640px) {
  .cookie-banner-inner { gap: 14px; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-btn { flex: 1; padding: 11px 14px; }
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(20,32,46,0.2);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.toast-icon {
  width: 22px;
  height: 22px;
  background: var(--gold-soft);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

/* FOOTER */
.footer-extended {
  margin-top: 40px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .footer-extended { grid-template-columns: 1fr; gap: 24px; }
}

.footer-block h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.footer-block p { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6; margin-bottom: 8px; }
.footer-block a { color: var(--ink-2); text-decoration: none; transition: color 0.15s ease; }
.footer-block a:hover { color: var(--accent); }
.footer-block-links { display: flex; flex-direction: column; gap: 8px; }
.footer-block-links a { font-size: var(--fs-sm); font-weight: 600; padding: 4px 0; }

.footer-brand {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: var(--fs-xl);
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.footer-tagline { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 14px; line-height: 1.55; }
.footer-dev { padding-top: 12px; margin-top: 12px; border-top: 1px dashed var(--line); font-size: var(--fs-xs); color: var(--ink-3); }
.footer-dev a { color: var(--accent); font-weight: 700; }

.footer-bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  flex-wrap: wrap;
}

.footer-bottom-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom-links a,
.footer-bottom-links button {
  color: var(--ink-3);
  text-decoration: none;
  font-size: var(--fs-xs);
  background: none; border: none; cursor: pointer; font-family: inherit; padding: 0;
}
.footer-bottom-links a:hover, .footer-bottom-links button:hover { color: var(--accent); }

/* Modal — для cookie ссылок (privacy/terms) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,32,46,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 740px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(20,32,46,0.25);
  margin-bottom: 40px;
}
.modal-header {
  padding: 24px 30px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.modal-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: var(--fs-3xl);
  color: var(--ink);
  letter-spacing: -0.015em;
}
.modal-close {
  width: 38px; height: 38px;
  border: 1px solid var(--line-2);
  background: var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ink); color: white; }
.modal-body {
  padding: 24px 30px;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--ink-2);
  max-height: 70vh;
  overflow-y: auto;
}
.modal-body h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: var(--fs-xl);
  color: var(--ink);
  margin: 20px 0 10px;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 12px; }
.modal-body strong { color: var(--ink); font-weight: 700; }
.modal-body ul { margin: 8px 0 14px 24px; }
.modal-body li { margin-bottom: 6px; }
.modal-body a { color: var(--accent); text-decoration: none; font-weight: 600; }
.modal-body a:hover { text-decoration: underline; }
