/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #dc2626;
  --color-secondary: #b91c1c;
  --color-accent: #ef4444;
  --color-red-dark: #991b1b;
  --color-red-light: #f87171;
  --color-dark: #000000;
  --color-dark-light: #0a0a0a;
  --color-dark-lighter: #1a1a1a;
  --color-dark-border: #2a2a2a;
  --color-text: #ffffff;
  --color-text-light: #e5e5e5;
  --color-text-muted: #a3a3a3;
  --gradient-red: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  --gradient-red-light: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-dark: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a1a1a 100%);
  --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.4);
  --shadow-glow-strong: 0 0 30px rgba(220, 38, 38, 0.6);
  --shadow-red: 0 4px 15px rgba(220, 38, 38, 0.4);
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--color-dark);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Banner Styles */
.top-banner-container {
  width: 100%;
  position: relative;
  z-index: 999;
  background: var(--color-dark);
}

.banner-link {
  display: block;
  width: 100%;
  text-decoration: none;
  line-height: 0;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  border: none;
}

/* Desktop Banners - два баннера рядом */
.banner-desktop-wrapper {
  display: none;
  width: 100%;
  overflow: hidden;
}

.banner-desktop-left,
.banner-desktop-right {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  min-width: 50%;
  height: auto;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
}

/* Small Phone Banner (320px) */
.banner-phone-s {
  display: block;
}

/* Medium Phone Banner (375px) */
.banner-phone-m {
  display: none;
}

/* Large Phone Banner */
.banner-phone {
  display: none;
}

/* Tablet Banner */
.banner-tablet {
  display: none;
}

/* Desktop: показать два баннера, скрыть мобильные */
@media (min-width: 1025px) {
  .banner-desktop-wrapper {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
  }
  
  .banner-phone-s,
  .banner-phone-m,
  .banner-phone,
  .banner-tablet {
    display: none !important;
  }
  
  .banner-desktop-left,
  .banner-desktop-right {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    min-width: 50% !important;
    display: block !important;
    object-fit: cover;
  }
}

/* Tablet: показать планшетный баннер */
@media (min-width: 768px) and (max-width: 1024px) {
  .banner-tablet {
    display: block !important;
  }
  
  .banner-phone-s,
  .banner-phone-m,
  .banner-phone,
  .banner-desktop-wrapper {
    display: none !important;
  }
}

/* Small Phones: показать маленький мобильный баннер (до 374px) */
@media (max-width: 374px) {
  .banner-phone-s {
    display: block !important;
  }
  
  .banner-phone-m,
  .banner-phone,
  .banner-tablet,
  .banner-desktop-wrapper {
    display: none !important;
  }
}

/* Medium Phones: показать средний мобильный баннер (375px) */
@media (min-width: 375px) and (max-width: 375px) {
  .banner-phone-m {
    display: block !important;
  }
  
  .banner-phone-s,
  .banner-phone,
  .banner-tablet,
  .banner-desktop-wrapper {
    display: none !important;
  }
}

/* Large Phones: показать большой мобильный баннер (376px - 767px) */
@media (min-width: 376px) and (max-width: 767px) {
  .banner-phone {
    display: block !important;
  }
  
  .banner-phone-s,
  .banner-phone-m,
  .banner-tablet,
  .banner-desktop-wrapper {
    display: none !important;
  }
}

/* Header Styles */
.main-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-dark);
}

.header-link {
  display: block;
  width: 100%;
  text-decoration: none;
  line-height: 0;
}

.header-img {
  width: 100%;
  height: auto;
  display: block;
  border: none;
}

/* Small Phone Header (320px) */
.header-phone-s {
  display: block;
}

/* Medium Phone Header (375px) */
.header-phone-m {
  display: none;
}

/* Large Phone Header */
.header-phone {
  display: none;
}

/* Tablet Header */
.header-tablet {
  display: none;
}

/* Desktop Header */
.header-desktop {
  display: none;
}

/* Desktop: показать десктопный хэдер */
@media (min-width: 1025px) {
  .header-desktop {
    display: block !important;
  }
  
  .header-phone-s,
  .header-phone-m,
  .header-phone,
  .header-tablet {
    display: none !important;
  }
}

/* Tablet: показать планшетный хэдер */
@media (min-width: 768px) and (max-width: 1024px) {
  .header-tablet {
    display: block !important;
  }
  
  .header-phone-s,
  .header-phone-m,
  .header-phone,
  .header-desktop {
    display: none !important;
  }
}

/* Small Phones: показать маленький мобильный хэдер (до 374px) */
@media (max-width: 374px) {
  .header-phone-s {
    display: block !important;
  }
  
  .header-phone-m,
  .header-phone,
  .header-tablet,
  .header-desktop {
    display: none !important;
  }
}

/* Medium Phones: показать средний мобильный хэдер (375px) */
@media (min-width: 375px) and (max-width: 375px) {
  .header-phone-m {
    display: block !important;
  }
  
  .header-phone-s,
  .header-phone,
  .header-tablet,
  .header-desktop {
    display: none !important;
  }
}

/* Large Phones: показать большой мобильный хэдер (376px - 767px) */
@media (min-width: 376px) and (max-width: 767px) {
  .header-phone {
    display: block !important;
  }
  
  .header-phone-s,
  .header-phone-m,
  .header-tablet,
  .header-desktop {
    display: none !important;
  }
}

.btn-primary {
  background: var(--gradient-red);
  color: var(--color-text);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-red);
  border: none;
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-strong);
  filter: brightness(1.1);
}

/* Main Content */
main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

section {
  margin-bottom: 1rem;
  padding: 1rem;
}

section h1 {
  color: var(--color-accent);
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(220, 38, 38, 0.5);
}

section h2 {
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
}

section h3 {
  color: var(--color-red-light);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

section p {
  color: var(--color-text-light);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  line-height: 1.8;
}

section ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
  color: var(--color-text-light);
}

section ul li {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

section ul li::marker {
  color: var(--color-red-light);
}

/* 404 Page Styles */
body.error-404 main section {
  text-align: center;
  max-width: 800px;
  margin: 4rem auto;
  padding: 3rem 2rem;
}

body.error-404 section h1 {
  font-size: 4rem;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

body.error-404 section p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--color-text-light);
}

body.error-404 section ul {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

body.error-404 section ul li {
  margin: 0;
}

body.error-404 section ul li a {
  display: inline-block;
  background: var(--gradient-red);
  color: var(--color-text);
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-red);
  min-width: 250px;
}

body.error-404 section ul li a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow-strong);
  filter: brightness(1.1);
}

body.error-404 section p:last-child {
  margin-top: 2rem;
  font-size: 1rem;
}

body.error-404 section p:last-child a {
  color: var(--color-red-light);
  text-decoration: underline;
  transition: var(--transition);
}

body.error-404 section p:last-child a:hover {
  color: var(--color-primary);
}

@media (max-width: 768px) {
  body.error-404 section h1 {
    font-size: 3rem;
  }
  
  body.error-404 section ul li a {
    min-width: 200px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--color-dark-lighter);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-dark-border);
}

table thead {
  background: var(--gradient-red);
}

table th {
  padding: 1rem;
  text-align: left;
  color: var(--color-text);
  font-weight: 600;
}

table td {
  padding: 1rem;
  border-top: 1px solid var(--color-dark-border);
  color: var(--color-text-light);
}

table tbody tr:hover {
  background: rgba(220, 38, 38, 0.15);
}

/* Table Container for Horizontal Scroll */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
}

.table-container table {
  margin: 0;
  min-width: 600px;
}

/* FAQ Styles */
dl {
  margin: 2rem 0;
}

dt {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 1rem;
  background: rgba(220, 38, 38, 0.1);
  border-left: 4px solid var(--color-primary);
  border-radius: 5px;
}

dd {
  color: var(--color-text-light);
  margin-left: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  line-height: 1.8;
  font-size: 1.1rem;
}

/* Footer Styles */
.main-footer {
  background: var(--gradient-dark);
  border-top: 2px solid var(--color-primary);
  box-shadow: 0 -4px 20px rgba(220, 38, 38, 0.3);
  margin-top: 4rem;
  padding: 3rem 0 1.5rem;
  padding-bottom: calc(1.5rem + 80px); /* Отступ для плашки */
}

@media (max-width: 768px) {
  .main-footer {
    padding-bottom: calc(1.5rem + 60px); /* Компактный отступ на мобильных */
  }
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  margin-bottom: 1rem;
}

.footer-logo-img {
  height: 50px;
  width: auto;
  filter: brightness(1.1);
}

.footer-text {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-section-title {
  color: var(--color-red-light);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 0.25rem 0;
  display: inline-block;
}

.footer-link:hover {
  color: var(--color-red-light);
  padding-left: 0.5rem;
}

.btn-footer {
  background: var(--gradient-red);
  color: var(--color-text);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: var(--shadow-red);
  display: inline-block;
  text-align: center;
  margin-top: 0.5rem;
}

.btn-footer:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-strong);
  filter: brightness(1.1);
}

.footer-bottom {
  border-top: 1px solid var(--color-dark-border);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-copyright {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.footer-warning {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {

  .btn-primary {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  main {
    padding: 2rem 1rem;
  }

  section {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  section h1 {
    font-size: 2rem;
  }

  section h2 {
    font-size: 1.75rem;
  }

  section h3 {
    font-size: 1.25rem;
  }

  section p,
  section ul li,
  dd {
    font-size: 1rem;
  }

  table {
    font-size: 0.9rem;
  }

  table th,
  table td {
    padding: 0.75rem 0.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {

  .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  section h1 {
    font-size: 1.75rem;
  }

  section h2 {
    font-size: 1.5rem;
  }

}

/* Smooth Scroll */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Sticky Bottom Banner */
.sticky-bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--gradient-red);
  color: var(--color-text);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 998;
  box-shadow: 0 -4px 20px rgba(220, 38, 38, 0.5);
  border-top: 2px solid var(--color-primary);
}

.sticky-bottom-banner-text {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.sticky-bottom-banner-btn {
  background: var(--color-dark);
  color: var(--color-text);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-red);
  white-space: nowrap;
  flex-shrink: 0;
}

.sticky-bottom-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-strong);
  filter: brightness(1.1);
  background: var(--color-dark-lighter);
}

@media (max-width: 768px) {
  .sticky-bottom-banner {
    padding: 0.5rem 0.75rem;
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
  }
  
  .sticky-bottom-banner-text {
    font-size: 0.8rem;
    line-height: 1.3;
    flex: 1;
  }
  
  .sticky-bottom-banner-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: auto;
    text-align: center;
    flex-shrink: 0;
  }
}

/* Scroll to Top Button - поднят выше плашки */
.scroll-to-top {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-red);
  color: var(--color-text);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 999;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
}

.scroll-to-top.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow-strong);
  filter: brightness(1.1);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .scroll-to-top {
    width: 45px;
    height: 45px;
    bottom: 4.5rem;
    right: 1.5rem;
    font-size: 1.3rem;
  }
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
.footer-link:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .main-header,
  .main-footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  section {
    background: white;
    border: 1px solid #ddd;
  }
}
