/* =========================================================
   ГЛОБАЛЬНЫЕ НАСТРОЙКИ
   ========================================================= */

:root {
  --bg-main: #050816;
  --bg-elevated: #0f172a;
  --bg-muted: #0b1121;

  --text-main: #ffffff;
  --text-muted: #94a3b8;

  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.2);

  --radius: 14px;
  --shadow: 0 20px 40px rgba(0,0,0,0.45);
  --shadow-soft: 0 10px 20px rgba(0,0,0,0.25);

  --max-width: 1200px;
}

*,
*:before,
*:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  scroll-behavior: smooth;
}

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

a {
  text-decoration: none;
  color: var(--accent);
  transition: 0.2s;
}

a:hover {
  opacity: 0.8;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148,163,184,0.25);
  padding: 0.7rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-title {
  font-size: 1.4rem;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  gap: 1rem;
}

.header-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
}

.header-nav a:hover {
  background: rgba(148,163,184,0.2);
  color: var(--text-main);
}

.header-actions {
  display: flex;
  gap: 0.7rem;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn-primary,
button.btn-primary {
  background: var(--accent);
  color: #022c22;
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 8px 24px rgba(34,197,94,0.4);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-outline {
  border: 1px solid rgba(148,163,184,0.4);
  color: var(--text-main);
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.05);
}

.btn-ghost {
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}

/* =========================================================
   HERO SECTION
   ========================================================= */

.hero {
  padding: 4rem 0 3rem;
  background: radial-gradient(circle at top, #0f172a, #050816 65%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-title {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

.hero-subtitle {
  max-width: 520px;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.hero-list {
  margin-bottom: 1.5rem;
  list-style: none;
}

.hero-list li {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-right {
  display: grid;
  gap: 1rem;
}

.hero-card {
  background: linear-gradient(145deg, rgba(34,197,94,0.25), rgba(15,23,42,0.85));
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: var(--shadow-soft);
}

.hero-card h3 {
  margin-bottom: 0.3rem;
}

/* =========================================================
   SECTIONS
   ========================================================= */

.section {
  padding: 4rem 0;
}

.section-muted {
  padding: 4rem 0;
  background: rgba(255,255,255,0.02);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-title-left {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* =========================================================
   SERVICE CARDS
   ========================================================= */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 1.2rem;
}

.card {
  padding: 1.5rem;
  background: var(--bg-muted);
  border-radius: var(--radius);
  border: 1px solid rgba(148,163,184,0.3);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(34,197,94,0.3);
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  color: var(--text-muted);
}

.card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
  color: var(--accent);
}

/* =========================================================
   ABOUT
   ========================================================= */

.about-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 2rem;
}

.about-facts {
  display: grid;
  gap: 0.7rem;
}

.fact-card {
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(148,163,184,0.4);
  border-radius: var(--radius);
}

.fact-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.fact-value {
  font-size: 1.1rem;
  margin-top: 0.3rem;
}

/* =========================================================
   CLIENT LOGOS
   ========================================================= */

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 1.5rem;
  align-items: center;
  opacity: 0.9;
}

.clients-grid img {
  width: 100%;
  filter: grayscale(100%) brightness(0.9);
  transition: 0.3s;
}

.clients-grid img:hover {
  filter: none;
}

/* =========================================================
   LICENSES
   ========================================================= */

.licenses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 1.5rem;
  justify-items: center;
}

.licenses-grid img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.1);
}

/* =========================================================
   THANKS
   ========================================================= */

.thanks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 1.5rem;
}

.thanks-grid img {
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
}

/* =========================================================
   CONTACT FORM
   ========================================================= */

.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
}

.contact-info h3 {
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.contact-form {
  padding: 1.5rem;
  background: var(--bg-muted);
  border-radius: var(--radius);
  border: 1px solid rgba(148,163,184,0.3);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(148,163,184,0.3);
  padding: 0.6rem;
  color: var(--text-main);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.contact-form textarea {
  resize: vertical;
}

/* =========================================================
   MODALS
   ========================================================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.active {
  display: flex;
}

/* === Модальное окно с анимацией === */

/* базовое состояние: спрятано, но без display:none — чтобы работала анимация */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2000;
}

/* активное состояние */
.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* сама карточка модалки */
.modal-content {
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: var(--radius);
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;

  /* анимация появления */
  animation: modal-zoom-in 0.22s ease-out;
}

/* изображение по центру и адекватного размера */
.modal-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
}

/* кнопка закрытия */
.close-button {
  margin-top: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

/* keyframes для появления карточки */
@keyframes modal-zoom-in {
  from {
    transform: translateY(8px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  padding: 2.5rem 0;
  background: #06090f;
  border-top: 1px solid rgba(148,163,184,0.3);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-bottom {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Анимация загрузки кнопки */
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Состояние кнопки "loading" */
button.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* =========================================================
   ADAPTIVE
   ========================================================= */

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .header-nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .hero-title {
    font-size: 1.9rem;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    text-align: center;
  }

  .hero-actions {
    flex-direction: column;
  }
}


@media (max-width: 960px) {
  .site-header {
    padding: 0.5rem 0;
  }

  .header-inner {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  /* меню уже скрыто в твоём CSS, оставляем только лого + кнопки */
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .header-actions .btn-outline,
  .header-actions .btn-primary {
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
  }
}

@media (max-width: 520px) {
  .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .header-actions .btn-outline,
  .header-actions .btn-primary {
    flex: 1 1 auto;
    justify-content: center;
  }
}
