/* =========================================================================
   Marktprognoze – styles.css (2025-06-02, улучшенная версия)
   Основные улучшения:
   - Стильные полупрозрачные формы с эффектом glassmorphism
   - Улучшенная читаемость текста на темном фоне
   - Элегантный футер с видео-фоном
   - Современные анимации и переходы
   - Оптимизированные размеры для trust seal
   ========================================================================= */

/* ===============================
   RESET & BASE
   =============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  line-height: 1.65;
  color: var(--text-light);
  background: #0a0a0a;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===============================
   CSS VARIABLES
   =============================== */
:root {
  /* Colors */
  --primary-500: #00cc99;
  --primary-600: #00b386;
  --primary-700: #009973;
  --accent-500: #ffdf00;
  --accent-600: #e6c900;
  --danger-500: #e53935;
  --surface-glass: rgba(255, 255, 255, 0.05);
  --surface-glass-hover: rgba(255, 255, 255, 0.08);
  --surface-dark: rgba(26, 37, 49, 0.9);
  --text-dark: #1a2531;
  --text-muted: #94a3b8;
  --text-light: #ffffff;
  --text-light-dim: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(255, 255, 255, 0.15);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  
  /* Radius */
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 24px;
  
  /* Shadows */
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --shadow-glow: 0 0 20px rgba(0, 204, 153, 0.3);
  --shadow-text: 0 2px 4px rgba(0, 0, 0, 0.8);
  
  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===============================
   BACKGROUND VIDEO - Optimized for performance
   =============================== */
.video-bg-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: #0a0a0a;
}

.video-bg-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
}

.video-bg,
#bgImageFallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

#bgImageFallback {
  display: none;
  background-color: #0a0a0a;
}

/* Mobile optimization */
@media (max-width: 768px) {
  .video-bg {
    display: none !important;
  }
  #bgImageFallback {
    display: block !important;
  }
}

/* ===============================
   TYPOGRAPHY
   =============================== */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.3;
  margin-block-end: var(--space-s);
  text-shadow: var(--shadow-text);
}

h1 { 
  font-size: clamp(2rem, 5vw, 3rem);
  background: linear-gradient(135deg, var(--text-light) 0%, var(--primary-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
p { margin-block-end: var(--space-s); }

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus {
  color: var(--primary-600);
  text-decoration: underline;
}

/* Enhanced text readability on dark backgrounds */
.hero-subtitle,
section p,
section h2 {
  text-shadow: var(--shadow-text);
}

/* ===============================
   LAYOUT & CONTAINERS
   =============================== */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-m);
}

@media (max-width: 600px) {
  .container { padding-inline: var(--space-s); }
}

.flex { display: flex; gap: var(--space-m); }
.flex-col { flex-direction: column; }
.grid { display: grid; gap: var(--space-m); }

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* ===============================
   HEADER & NAVIGATION
   =============================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-s) var(--space-m);
}

.logo img {
  height: 40px;
  width: auto;
  filter: brightness(1.1);
}

nav ul {
  display: flex;
  gap: var(--space-m);
  list-style: none;
}

nav a {
  font-size: 1rem;
  font-weight: 500;
  padding: var(--space-xs) var(--space-s);
  color: var(--text-light-dim);
  transition: all var(--transition);
  border-radius: var(--radius-s);
}

nav a:hover {
  color: var(--text-light);
  background: var(--surface-glass-hover);
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--primary-500);
  background: rgba(0, 204, 153, 0.1);
  border: 1px solid rgba(0, 204, 153, 0.3);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-s);
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-light);
  margin-block: 4px;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 768px) {
  nav {
    position: absolute;
    top: 100%;
    right: var(--space-m);
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-m);
    border: 1px solid var(--border-glass);
    padding: var(--space-m);
    display: none;
  }

  nav.active { display: block; }
  nav ul { flex-direction: column; }

  .mobile-menu-toggle { display: flex; flex-direction: column; }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

/* ===============================
   HERO SECTION
   =============================== */
.hero {
  padding-block: clamp(4rem, 10vh, 6rem);
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-light-dim);
  max-width: 600px;
  margin-inline: auto;
  line-height: 1.8;
}

/* Enhanced Trust Seal */
img[alt="Vertrauenssiegel"] {
  width: auto;
  height: 80px;
  max-width: 250px;
  margin: var(--space-m) auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: transform var(--transition);
}

img[alt="Vertrauenssiegel"]:hover {
  transform: translateY(-2px);
}

/* ===============================
   FORMS - Glassmorphism Style
   =============================== */
.form-container {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-l);
  padding: var(--space-l);
  box-shadow: var(--shadow-glass);
  max-width: 600px;
  margin-inline: auto;
  border: 1px solid var(--border-glass);
  position: relative;
  overflow: hidden;
}

.form-container > * {
  position: relative;
  z-index: 1;
}

/* Hero form styling */
.hero .form-container {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  backdrop-filter: none;
}

.hero form {
  display: flex;
  gap: var(--space-m);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.form-group {
  margin-block-end: var(--space-m);
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-block-end: var(--space-xs);
  color: var(--text-light-dim);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: var(--space-s);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-m);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-light);
  transition: all var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-500);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 204, 153, 0.2);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  appearance: none;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
  margin-block-end: var(--space-m);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary-500);
}

.checkbox-group label {
  color: var(--text-light-dim);
  cursor: pointer;
}

.cta-button {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-m);
  padding: var(--space-s) var(--space-l);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-block;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 204, 153, 0.3);
  white-space: nowrap;
  text-align: center;
}

/* Yellow CTA buttons */
.cta-button[style*="background: var(--accent-500)"],
.cta-button[style*="background: #ffdf00"] {
  background: var(--accent-500) !important;
  color: var(--text-dark) !important;
  box-shadow: 0 4px 15px rgba(255, 223, 0, 0.3);
}

/* Danger CTA buttons */
.cta-button[style*="background: var(--danger-500)"] {
  background: var(--danger-500) !important;
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 204, 153, 0.4);
  text-decoration: none;
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 204, 153, 0.5);
}

.cta-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===============================
   PROGRESS BAR
   =============================== */
.progress-bar-container {
  text-align: center;
  margin-block: var(--space-l);
}

.progress-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.progress-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 2px solid var(--border-glass);
  transition: all var(--transition);
}

.progress-step.completed {
  background: var(--primary-500);
  color: var(--text-light);
  border-color: var(--primary-500);
  box-shadow: 0 0 10px rgba(0, 204, 153, 0.5);
}

.progress-step.active {
  border-color: var(--accent-500);
  color: var(--text-light);
  background: rgba(255, 223, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 223, 0, 0.5);
}

.progress-line {
  flex: 1;
  height: 4px;
  background: var(--border-glass);
  border-radius: 2px;
  max-width: 60px;
  position: relative;
  overflow: hidden;
}

.progress-line.completed {
  background: var(--primary-500);
}

.progress-line.completed::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-block-start: var(--space-xs);
  max-width: 300px;
  margin-inline: auto;
}

/* ===============================
   CARDS & ARTICLES
   =============================== */
.card,
article {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  box-shadow: var(--shadow-glass);
  border: 1px solid var(--border-glass);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover,
article:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45);
  border-color: rgba(0, 204, 153, 0.3);
}

.card::before,
article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.card:hover::before,
article:hover::before {
  transform: scaleX(1);
}

.card img,
article img {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-s);
  filter: none;
  opacity: 1;
}

/* Avatar images */
img[src*="avatar"] {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  filter: none;
}

/* Icon SVGs */
img[src*="icons/"] {
  width: 32px;
  height: 32px;
  filter: none;
}

/* Testimonial Cards */
figure.card blockquote {
  font-style: italic;
  color: var(--text-light-dim);
  margin: var(--space-s) 0;
}

figure.card figcaption {
  color: var(--primary-500);
  font-weight: 500;
}

/* ===============================
   FOOTER - Glassmorphism with smooth transition
   =============================== */
footer {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: var(--space-xl) var(--space-m);
  font-size: 0.875rem;
  color: var(--text-light-dim);
  border-top: 1px solid var(--border-glass);
  position: relative;
  z-index: 10;
  margin-top: var(--space-xl);
}

/* Smooth transition to footer */
footer::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin-inline: auto;
}

.footer-logo img {
  height: 36px;
  width: auto;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.footer-logo img:hover {
  opacity: 1;
}

.footer-links {
  display: flex;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-light-dim);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-s);
  transition: all var(--transition);
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--primary-500);
  background: rgba(0, 204, 153, 0.1);
  text-decoration: none;
}

.footer-copy {
  text-align: right;
  flex: 1;
  min-width: 200px;
}

.footer-copy small {
  display: block;
  margin-top: var(--space-xs);
  opacity: 0.7;
}

@media (max-width: 600px) {
  .footer-container { 
    flex-direction: column; 
    text-align: center; 
  }
  .footer-copy { 
    text-align: center; 
  }
  .footer-links {
    justify-content: center;
  }
}

/* ===============================
   SECTIONS WITH BACKGROUNDS
   =============================== */
section[style*="background: var(--primary-700)"] {
  background: linear-gradient(135deg, rgba(0, 122, 110, 0.95), rgba(0, 153, 115, 0.95)) !important;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

section[style*="background: var(--surface-200)"] {
  background: var(--surface-glass) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
}

/* ===============================
   LAYOUT FIXES
   =============================== */
/* Center alignment for hero content */
.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
}

/* Hero section spacing */
.hero {
  padding-block: clamp(4rem, 10vh, 6rem);
  text-align: center;
  position: relative;
  z-index: 1;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

/* Smooth section spacing */
section + section {
  margin-top: 0;
}

/* Container spacing */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-m);
  padding-block: var(--space-l);
}

/* Grid alignment */
.grid {
  display: grid;
  gap: var(--space-l);
  align-items: start;
}

/* How it works section */
#how-it-works .card,
#benefits .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-l);
}

/* Testimonial cards alignment */
figure.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

figure.card img {
  margin-bottom: var(--space-m);
}

/* Form alignment fixes */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Button group alignment */
.hero .cta-button {
  margin: var(--space-xs) 0;
}

/* Timer spacing */
.timer {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-500);
  text-shadow: 0 0 10px rgba(255, 223, 0, 0.5);
  margin: var(--space-m) 0;
  padding: var(--space-s);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-m);
  display: inline-block;
}

/* ===============================
   FLASH MESSAGES
   =============================== */
.flash-messages {
  max-width: 600px;
  margin: var(--space-m) auto;
  list-style: none;
  padding: 0;
}

.flash-messages li {
  padding: var(--space-s);
  margin-block-end: var(--space-s);
  border-radius: var(--radius-m);
  font-size: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-messages li.success { 
  background: rgba(16, 185, 129, 0.2); 
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-messages li.error { 
  background: rgba(239, 68, 68, 0.2); 
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-messages li.warning { 
  background: rgba(245, 158, 11, 0.2); 
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ===============================
   ERROR PAGES
   =============================== */
.error-page .hero h1 {
  background: linear-gradient(135deg, var(--danger-500) 0%, #ff6b6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===============================
   ACCESSIBILITY
   =============================== */
.skip-link {
  position: absolute;
  left: -1000px;
  top: var(--space-s);
  background: var(--accent-500);
  color: var(--text-dark);
  padding: var(--space-s);
  border-radius: var(--radius-s);
  z-index: 1000;
}

.skip-link:focus { left: var(--space-m); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ===============================
   ANIMATIONS
   =============================== */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.hero,
.form-container,
.card {
  animation: fadeIn 0.6s ease-out;
}

/* Stagger animations for cards */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

/* ===============================
   MEDIA QUERIES
   =============================== */
@media (max-width: 600px) {
  h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
  h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
  .form-container { padding: var(--space-m); }
  .cta-button { 
    font-size: 1rem; 
    padding: var(--space-s) var(--space-m);
  }
  img[alt="Vertrauenssiegel"] {
    height: 60px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-glass: rgba(255, 255, 255, 0.3);
    --text-light-dim: rgba(255, 255, 255, 1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}