/* ===== safedcore — light minimalist theme ===== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --ink: #14181f;
  --ink-soft: #4b5563;
  --ink-faint: #8a93a3;
  --line: #e6e8ec;
  --accent: #3b6fd1;
  --accent-ink: #2c56ab;
  --accent-soft: #eaf1fc;
  --navy: #0b1e3d;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.10);
  --max-w: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 12px; color: var(--ink-soft); }

a { color: var(--accent-ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #1e293b; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-header-img { height: 38px; width: auto; display: block; }
.main-nav {
  display: flex;
  gap: 26px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
}
.main-nav a:hover { color: var(--accent-ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.lang-switch button.is-active {
  background: var(--navy);
  color: #fff;
}

.header-cta { display: inline-flex; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  margin: 0 8px;
  border-radius: 2px;
}

/* ---------- hero ---------- */
.hero {
  padding: 84px 0 64px;
  background:
    radial-gradient(700px 320px at 85% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.hero-inner { max-width: 760px; }
.badge {
  display: block;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero .brand { color: var(--accent-ink); }
.hero-subtitle { font-size: 1.15rem; max-width: 620px; }
.hero-cta { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

/* ---------- sections ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 620px; margin-bottom: 40px; }
.section-head p { font-size: 1.05rem; }

.grid { display: grid; gap: 20px; }

/* ---------- services ---------- */
.services-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.service-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.service-icon { font-size: 1.8rem; margin-bottom: 12px; }
.service-card h3 { margin-bottom: 6px; }
.service-card p { margin: 0; font-size: 0.94rem; }

/* ---------- pricing ---------- */
.pricing-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: stretch; }
.price-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
}
.price-card.is-popular { border-color: var(--accent); box-shadow: var(--shadow); }
.price-popular-tag {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.price-card h3 { margin-bottom: 10px; }
.price-amount { display: flex; align-items: baseline; gap: 6px; margin-bottom: 16px; }
.price-amount .from { font-size: 0.85rem; color: var(--ink-faint); }
.price-amount .value { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.price-amount .unit { font-size: 0.82rem; color: var(--ink-faint); }
.price-features { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; }
.price-features li {
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}
.price-features li:first-child { border-top: none; }
.price-features li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.pricing-note { text-align: center; color: var(--ink-faint); font-size: 0.9rem; margin-top: 30px; }

/* ---------- products / portfolio ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-btn.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

.products-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-cover {
  aspect-ratio: 16 / 10;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.product-cover img { width: 100%; height: 100%; object-fit: cover; }
.product-cover .placeholder {
  color: var(--ink-faint);
  font-size: 2rem;
  font-weight: 800;
}
.product-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.product-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 3px 8px;
  border-radius: 999px;
}
.product-card h3 { margin-bottom: 2px; font-size: 1.05rem; }
.product-card p { font-size: 0.9rem; margin-bottom: 4px; }
.product-gallery { display: flex; gap: 6px; margin: 4px 0; }
.product-gallery img {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}
.product-price { font-weight: 800; color: var(--navy); font-size: 0.95rem; }
.product-price .from { font-weight: 500; color: var(--ink-faint); font-size: 0.78rem; }
.products-empty { text-align: center; color: var(--ink-faint); padding: 30px 0; }

/* ---------- about ---------- */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 44px;
}
.about-story {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.about-story h3 { color: var(--accent-ink); }
.values-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.value-card {
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}
.value-card h3 { color: var(--navy); }
.value-card p { margin: 0; font-size: 0.9rem; }

/* ---------- contact ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
  align-items: start;
}
.direct-contacts {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.direct-title { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.direct-link { display: block; text-decoration: none; font-size: 0.95rem; margin-bottom: 6px; }
.direct-link span:first-child { color: var(--ink-faint); font-weight: 600; }

.contact-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-status { margin: 12px 0 0; font-size: 0.88rem; min-height: 20px; }
.form-status.is-success { color: var(--accent-ink); }
.form-status.is-error { color: var(--danger); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; background: var(--bg-alt); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { height: 26px; width: auto; }
.footer-tagline { margin: 0; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; color: var(--navy); }
.footer-rights { margin: 0; font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 30px;
}
/* атрибут [hidden] должен побеждать display:flex выше — иначе окно не скрывается */
.lightbox[hidden] {
  display: none;
}
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- app product pages (public/apps/<slug>/) ---------- */
.app-header {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.app-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-back-link { font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.app-back-link:hover { color: var(--accent-ink); }

.app-hero { padding: 56px 0 48px; }
.app-hero-inner { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.app-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}
.app-hero-text { flex: 1; min-width: 240px; }
.app-hero-text h1 { margin-bottom: 6px; }
.app-tagline { font-size: 1.05rem; margin-bottom: 16px; }
.app-store-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--bg-alt);
}

.app-screens {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.app-screens a { flex-shrink: 0; }
.app-screens img {
  height: 340px;
  width: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.app-sources { font-size: 0.88rem; color: var(--ink-faint); }
.app-sources li { margin-bottom: 4px; }

.app-support {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.app-support h2 { margin-bottom: 8px; }
.app-support p { max-width: 520px; margin-left: auto; margin-right: auto; }

.app-privacy-cta { text-align: center; }

/* ---------- legal / policy pages ---------- */
.legal { max-width: 740px; }
.legal h1 { margin-bottom: 6px; }
.legal .legal-meta { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 40px; }
.legal h2 { font-size: 1.2rem; margin-top: 36px; }
.legal p, .legal li { color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .about-layout, .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    display: none;
    padding: 8px 20px 16px;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 0; border-top: 1px solid var(--line); }
  .main-nav a:first-child { border-top: none; }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .app-screens img { height: 240px; }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }
  .header-inner { gap: 10px; }
  .logo-header-img { height: 30px; }
  .header-actions { gap: 8px; }
  .lang-switch button { padding: 5px 7px; font-size: 0.72rem; }
  .nav-toggle { width: 34px; height: 34px; }
}
