/* ========== BRAND CONFIGURATION ========== */
/* Легко изменяемые переменные для быстрой смены брендинга */
:root {
  --brand-primary: #667eea;
  --brand-secondary: #764ba2;
  --brand-accent: #ff6b6b;
  --brand-success: #51cf66;
  --brand-warning: #ffd43b;
  --brand-text: #333;
  --brand-text-light: #666;
  --brand-light: #f8f9fa;
  --brand-white: #ffffff;

  /* Градиенты */
  --gradient-main: linear-gradient(
    135deg,
    var(--brand-primary) 0%,
    var(--brand-secondary) 100%
  );
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
  --gradient-button: linear-gradient(
    45deg,
    var(--brand-accent),
    var(--brand-primary)
  );

  /* Тени */
  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.1);
  --shadow-button: 0 8px 25px rgba(255, 107, 107, 0.3);
  --shadow-hover: 0 12px 35px rgba(255, 107, 107, 0.4);
}

/* ========== RESET & BASE STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--gradient-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  color: var(--brand-text);
}

/* ========== TYPOGRAPHY ========== */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-button);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--brand-text);
  line-height: 1.3;
}

h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--brand-text);
}

p {
  font-size: 1.1rem;
  color: var(--brand-text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.brand-logo {
  font-size: 1.8rem;
  font-weight: bold;
  text-decoration: none;
  background: var(--gradient-button);
  -webkit-background-clip: text;
  -webkit-text-fill-color: #00000059;
  background-clip: text;
  /* transition: transform 0.3s ease; */
}

.brand-logo:hover {
  transform: scale(1.05);
}

/* Placeholder для логотипа */
.logo-placeholder {
  width: 120px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.logo-placeholder:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* ========== LANGUAGE SELECTOR ========== */
.language-selector {
  position: relative;
}

.lang-dropdown {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid transparent;
  border-radius: 25px;
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-text);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-size: 0.95rem;
  outline: none;
}

.lang-dropdown:hover,
.lang-dropdown:focus {
  border-color: var(--brand-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

/* ========== MAP BACKGROUND ========== */
.map-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M40 40c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8 8-3.6 8-8zm0-32c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8 8-3.6 8-8zm32 32c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8 8-3.6 8-8z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
  opacity: 0.8;
  z-index: 1;
  animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-10px);
  }
}

/* ========== MAIN CONTAINER ========== */
.container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 40px;
}

/* ========== SURVEY CARD ========== */
.survey-card {
  background: var(--gradient-card);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 500px;
  width: 100%;
  padding: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.8s ease-out;
}

.survey-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-button);
}

.survey-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    rgba(255, 107, 107, 0.1),
    transparent
  );
  animation: rotate 20s linear infinite;
  z-index: -1;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========== LOCATION INFO ========== */
.location-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.8rem 1.5rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 50px;
  color: var(--brand-primary);
  font-weight: 600;
  border: 1px solid rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
}

.location-info:hover {
  background: rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.location-icon {
  width: 20px;
  height: 20px;
  fill: var(--brand-accent);
  animation: pulse 2s infinite;
}

/* ========== SURVEY STEPS ========== */
.survey-step {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.survey-step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.6s ease-out;
}

.step-counter {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: var(--gradient-button);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* ========== BUTTONS ========== */
.gender-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.gender-btn,
.option-btn,
.age-btn,
.continue-btn {
  background: var(--brand-white);
  border: 2px solid #e9ecef;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
  outline: none;
}

.gender-btn:hover,
.option-btn:hover,
.age-btn:hover,
.interest-btn:hover {
  border-color: var(--brand-accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 107, 107, 0.2);
}

.gender-btn:active,
.option-btn:active,
.age-btn:active,
.interest-btn:active {
  transform: translateY(-1px);
}

.gender-btn.selected,
.option-btn.selected,
.age-btn.selected,
.interest-btn.selected {
  background: var(--gradient-button);
  color: white;
  border-color: var(--brand-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-button);
}

.gender-btn.selected::before,
.option-btn.selected::before,
.age-btn.selected::before,
.interest-btn.selected::before {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1rem;
  font-weight: bold;
}

.gender-icon {
  font-size: 2.5rem;
  transition: transform 0.3s ease;
}

.gender-btn:hover .gender-icon {
  transform: scale(1.1);
}

/* ========== AGE SELECTION ========== */
.age-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 2rem 0;
}

.age-btn {
  padding: 1rem;
  font-size: 1rem;
}

/* ========== INTERESTS GRID ========== */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin: 2rem 0;
}

.interest-btn {
  background: var(--brand-white);
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--brand-text);
  text-align: center;
  position: relative;
  outline: none;
}

/* ========== CONTINUE BUTTON ========== */
.continue-btn {
  background: var(--gradient-button);
  color: white;
  border: none;
  width: 100%;
  margin-top: 2rem;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  position: relative;
  overflow: hidden;
}

.continue-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.continue-btn:hover::before {
  left: 100%;
}

.continue-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.continue-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: #ccc;
}

.continue-btn:disabled::before {
  display: none;
}

/* ========== EMAIL INPUT ========== */
#email-input {
  width: 100%;
  padding: 1.2rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: white;
  outline: none;
  font-family: inherit;
}

#email-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

#email-input.invalid {
  border-color: var(--brand-accent);
  background: rgba(255, 107, 107, 0.05);
}

#email-input.valid {
  border-color: var(--brand-success);
  background: rgba(81, 207, 102, 0.05);
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-button);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-20px);
  }
  100% {
    transform: translateX(20px);
  }
}

/* ========== FOOTER ========== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 100;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.footer-links a {
  color: var(--brand-text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.footer-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-accent);
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: var(--brand-accent);
  transform: translateY(-2px);
}

.footer-links a:hover::after {
  width: 100%;
}

/* ========== BACK LINK STYLES ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.1);
}

.back-link:hover {
  background: rgba(255, 107, 107, 0.2);
  transform: translateX(-5px);
}

/* ========== PAGE CONTENT STYLES ========== */
.page-content {
  max-width: 800px;
  margin: 100px auto 50px;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 10;
}

.page-content h1 {
  color: var(--brand-text);
  margin-bottom: 2rem;
  text-align: center;
}

.page-content h2 {
  color: var(--brand-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.page-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* ========== ANIMATIONS ========== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* ========== LOADING STATES ========== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .container {
    padding: 80px 15px 120px;
  }

  .survey-card {
    padding: 2rem 1.5rem;
    margin: 0 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .gender-buttons {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .age-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .header-content {
    padding: 0 1rem;
  }

  .footer-links {
    gap: 1rem;
    font-size: 0.8rem;
  }

  .page-content {
    margin: 80px 15px 120px;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .survey-card {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .gender-btn,
  .option-btn {
    padding: 1.2rem 0.8rem;
    font-size: 1rem;
  }

  .age-btn {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .interests-grid {
    gap: 0.6rem;
  }

  .interest-btn {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .location-info {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  #email-input {
    padding: 1rem;
    font-size: 1rem;
  }

  .continue-btn {
    padding: 1rem;
    font-size: 1.1rem;
  }

  .footer-links {
    gap: 0.8rem;
    flex-direction: column;
    text-align: center;
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .survey-card {
    border: 3px solid var(--brand-accent);
  }

  .gender-btn,
  .option-btn,
  .age-btn,
  .interest-btn {
    border-width: 3px;
  }

  .gender-btn.selected,
  .option-btn.selected,
  .age-btn.selected,
  .interest-btn.selected {
    border-width: 4px;
  }
}

/* Focus styles for keyboard navigation */
.gender-btn:focus,
.option-btn:focus,
.age-btn:focus,
.interest-btn:focus,
.continue-btn:focus,
#email-input:focus,
.lang-dropdown:focus {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .header,
  .footer,
  #cookie-banner {
    display: none !important;
  }

  .survey-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    background: white;
  }

  .map-background {
    display: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --brand-text: #f0f0f0;
    --brand-text-light: #bbb;
    --gradient-card: linear-gradient(145deg, #2a2a2a 0%, #1a1a2e 100%);
    --brand-white: #2a2a2a;
  }

  .survey-card {
    background: var(--gradient-card);
    color: var(--brand-text);
  }

  .gender-btn,
  .option-btn,
  .age-btn,
  .interest-btn {
    background: var(--brand-white);
    color: var(--brand-text);
    border-color: #444;
  }

  #email-input {
    background: var(--brand-white);
    color: var(--brand-text);
    border-color: #444;
  }

  .header,
  .footer {
    background: rgba(42, 42, 42, 0.95);
  }

  .page-content {
    background: var(--brand-white);
    color: var(--brand-text);
  }
}
