/* ==== Основные переменные и сброс === */
:root {
  --primary: #f36f21;
  --secondary: #007bff;
  --accent: #b3d4fc;
  --white: #ffffff;
  --dark: #212529;
  --gray-bg: #f8f9fa;
  --light-gray: #e9ecef;
  --border-color: #dee2e6;
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==== Шрифты и общие стили ==== */
h1, h2, h3 {
  font-weight: 700;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary);
}

/* ==== Кнопки ==== */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 120px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  border: none;
}

.btn-primary:hover {
  background-color: #e05c17;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #f9e1d2;
  color: #ff5f00;
  border: 2px solid #f9e1d2;
}

.btn-secondary:hover {
  background-color: rgba(243, 111, 33, 0.1);
  transform: translateY(-2px);
}

/* ==== Заголовки секций ==== */
section {
  padding: 5rem 0;
}

section h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

section p {
  color: #63798d;
  font-size: 1.1rem;
}

section ul {
  color: #6c757d;
  font-size: 1.1rem;
}

section li {
  color: #6c757d;
  font-size: 1.1rem;
}

/* ==== Header ==== */
.header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.header-back-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  color: inherit;
  white-space: nowrap;
}

.header-back-link:hover {
  background-color: var(--accent);
  color: var(--dark);
}

.logo img {
  height: 30px;
  object-fit: contain;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-menu a {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  background-color: var(--accent);
  color: var(--dark);
}

/* ==== Hero (обновлённый) ==== */
.hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
}

.hero-content-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 20px;
}

.hero-content {
  max-width: 670px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 2rem;
  color: var(--white);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-align: left;
}

.hero-content p {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  text-align: left;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-icons {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
  flex-wrap: wrap;
}

.hero-icons span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==== Документы ==== */
.documents-section {
  background-color: var(--gray-bg);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.doc-card {
  background: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.doc-card:hover {
  transform: translateY(-5px);
}

.doc-type {
  background-color: var(--accent);
  color: var(--dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.doc-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.doc-card p {
  color: #6c757d;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.doc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.download-btn {
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background-color: #0056b3;
}

/* ==== FAQ ==== */
.faq-container {
  margin-top: 2rem;
}

.faq-item {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--white);
  border: none;
  text-align: left;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background-color: var(--accent);
}

.faq-question i {
  transition: transform 0.3s ease;
}

.faq-question.active i {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background-color: var(--white);
}

.faq-answer.show {
  max-height: 1200px;
  padding: 1rem 1.5rem;
}

/* ==== Форма ==== */
.form-section {
  background-color: var(--white);
}

.supplier-form {
  max-width: 800px;
  margin: 2rem auto 0;
  padding: 2rem;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.form-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1 1 300px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input:invalid,
.form-group select:invalid {
  border-color: #dc3545;
}

.form-icon {
  position: absolute;
  right: 16px;
  top: 40px;
  color: #6c757d;
  pointer-events: none;
}

.file-upload {
  margin-top: 1.5rem;
}

.file-upload input[type="file"] {
  display: none;
}

.upload-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.upload-btn:hover {
  background-color: #0056b3;
}

.file-hint {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.5rem;
  text-align: center;
}

/* Антиспам: honeypot скрыт от людей */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-spam-check input {
  max-width: 120px;
}

/* ==== Чекбокс согласия ==== */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.consent input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
}

.consent label {
  font-size: 0.95rem;
  color: #495057;
  line-height: 1.4;
}

.consent a {
  color: var(--primary);
  text-decoration: underline;
}

.consent a:hover {
  color: var(--secondary);
}

.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.form-status.error {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

.form-status.success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

/* ==== Footer ==== */
.footer {
  background-color: var(--dark);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand img {
  height: 30px;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: #adb5bd;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: #adb5bd;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-copyright {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #495057;
  font-size: 0.85rem;
  color: #6c757d;
}

/* ==== Анимация появления при прокрутке ==== */
.section-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==== Модальное окно ==== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--white);
  border-radius: 15px;
  padding: 2rem;
  max-width: 650px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(-50px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6c757d;
  cursor: pointer;
  transition: color 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--primary);
  background-color: var(--light-gray);
}

.modal-body {
  text-align: center;
  padding: 1rem;
}

.modal-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.modal-body h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.modal-body p {
  color: #6c757d;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.modal-email {
  font-size: 1.3rem !important;
  font-weight: 600;
  color: var(--primary) !important;
  margin-top: 1rem;
}

/* ==== Стили для ПСЦ таблицы ==== */
#barcodeTable {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

#barcodeTable th,
#barcodeTable td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: left;
}

#barcodeTable th {
  background-color: var(--gray-bg);
  font-weight: 600;
}

#barcodeTable input {
  width: 100%;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.removeRow {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
}

.removeRow:hover {
  background-color: #c82333;
}

/* Стили для textarea */
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* ==== Стили для копирования email ==== */
.modal-email {
  position: relative;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
}

.modal-email:hover {
  background-color: var(--light-gray);
}

.copy-icon {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.modal-email:hover .copy-icon {
  opacity: 1;
}

/* ==== Адаптивность ==== */
@media (max-width: 1024px) {
  .hero-content {
    padding: 1.5rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  .header-brand {
    justify-content: center;
    width: 100%;
  }

  .nav-menu ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    height: auto;
    min-height: auto;
    padding: 4rem 0;
  }

  .hero-content {
    max-width: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem 1.5rem;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .form-row {
    flex-direction: column;
  }

  .faq-question {
    padding: 1rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .modal-body {
    padding: 0.5rem;
  }
  
  .modal-icon {
    font-size: 2.5rem;
  }
  
  .modal-body h3 {
    font-size: 1.3rem;
  }
  
  .modal-body p {
    font-size: 1rem;
  }
  
  .modal-email {
    font-size: 1.1rem !important;
  }
}

@media (max-width: 480px) {
  section {
    padding: 3rem 0;
  }

  .container {
    padding: 0 15px;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .doc-card {
    padding: 1rem;
  }

  .form-group input,
  .form-group select {
    padding: 10px 12px;
  }

  .hero-icons {
    flex-direction: column;
    gap: 0.75rem;
  }
}