:root {
  --primary-color: #6c63ff;
  --secondary-color: #ff6584;
  --accent-color: #f12b6b;
  --dark-color: #1e1b4b;
  --darker-color: #080f1c;
  --light-color: #f5f5f5;
  --gray-color: #64748b;
  --success-color: #2ecc71;
  --error-color: #e74c3c;
  --text-color: #f5f5f5;
  --header-height: 70px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --transition-fast: 0.3s ease;
  --transition-normal: 0.5s ease;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.25);
  --gradient-primary: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  --gradient-secondary: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  --bg-overlay-light: rgba(255, 255, 255, 0.05);
  --bg-overlay-medium: rgba(255, 255, 255, 0.08);
  --bg-overlay-dark: rgba(0, 0, 0, 0.8);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  --gradient-start: #6c63ff;
  --gradient-end: #5a56e9;
  --border-color: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.07);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark-color), var(--darker-color));
  color: var(--light-color);
  line-height: 1.6;
  font-size: 16px;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(61, 90, 241, 0.05) 0%, rgba(0, 0, 0, 0) 25%),
    radial-gradient(circle at 85% 85%, rgba(34, 209, 238, 0.05) 0%, rgba(0, 0, 0, 0) 30%),
    radial-gradient(circle at 75% 25%, rgba(241, 43, 107, 0.03) 0%, rgba(0, 0, 0, 0) 20%),
    radial-gradient(circle at 25% 65%, rgba(34, 209, 238, 0.04) 0%, rgba(0, 0, 0, 0) 25%);
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, h4, h5, h6, p {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

header {
  padding: 20px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 100;
  background: rgba(30, 27, 75, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

header.scrolled {
  padding: 10px 0;
  background: rgba(30, 27, 75, 0.95);
}

header.scrolled nav {
  padding: 5px 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  min-height: 50px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--light-color);
  text-decoration: none;
  position: relative;
  z-index: 10;
  transform: none !important;
  transition: color 0.3s;
  padding: 0 15px 0 0;
}

.logo:hover {
  color: var(--secondary-color);
  transform: none !important;
}

.logo i {
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.nav-links a {
  color: var(--light-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  padding: 5px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: width 0.3s;
}

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

.nav-links .btn {
  border-radius: 50px;
  padding: 8px 20px;
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.nav-links .btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.hero {
  position: relative;
  padding: 120px 0 60px;
  overflow: hidden;
  margin-top: 50px;
  text-align: center;
  position: relative;
  background: linear-gradient(135deg, 
    var(--dark-color), 
    #1a2b52, 
    #253a6e, 
    #2b499e);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(30, 27, 75, 0.8));
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(0, 210, 255, 0.1) 0%, rgba(0, 0, 0, 0) 5%),
    radial-gradient(circle at 50% 80%, rgba(0, 210, 255, 0.08) 0%, rgba(0, 0, 0, 0) 6%),
    radial-gradient(circle at 80% 15%, rgba(0, 210, 255, 0.12) 0%, rgba(0, 0, 0, 0) 4%),
    radial-gradient(circle at 15% 60%, rgba(0, 210, 255, 0.1) 0%, rgba(0, 0, 0, 0) 6%),
    radial-gradient(circle at 75% 50%, rgba(0, 210, 255, 0.15) 0%, rgba(0, 0, 0, 0) 5%);
  pointer-events: none;
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: 5;
  background-color: rgba(8, 15, 28, 0.7);
  padding: 50px;
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateZ(0);
  animation: contentFadeIn 1s ease-out forwards;
}

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

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% 100%;
  animation: gradient-shift 8s infinite alternate;
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero h1::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--gradient-end), var(--secondary-color));
  z-index: -1;
  transition: transform 0.5s;
  transform: scaleX(0);
  transform-origin: right;
}

.btn:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.hero-btn {
  padding: 15px 38px;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.hero-btn-secondary {
  background: transparent;
  border: 2px solid var(--gradient-start);
}

.hero-btn-secondary::before {
  background: var(--gradient-start);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1rem;
  opacity: 0.8;
}

.features, .categories, .testimonials {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

.features {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(28, 43, 80, 0.9));
}

.categories {
  padding: 100px 0;
  background: linear-gradient(to bottom, #100e29, var(--dark-color));
}

.testimonials {
  background: linear-gradient(to top, rgba(8, 15, 28, 0.9), rgba(15, 23, 42, 0.8));
}

.features::before, .categories::before, .testimonials::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.features::before {
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(61, 90, 241, 0.1) 0%, rgba(0, 0, 0, 0) 20%),
    radial-gradient(circle at 90% 90%, rgba(34, 209, 238, 0.1) 0%, rgba(0, 0, 0, 0) 25%);
}

.categories::before {
  background-image: 
    radial-gradient(circle at 80% 20%, rgba(241, 43, 107, 0.05) 0%, rgba(0, 0, 0, 0) 25%),
    radial-gradient(circle at 20% 80%, rgba(34, 209, 238, 0.08) 0%, rgba(0, 0, 0, 0) 30%);
}

.testimonials::before {
  background-image: 
    radial-gradient(circle at 70% 30%, rgba(61, 90, 241, 0.07) 0%, rgba(0, 0, 0, 0) 20%),
    radial-gradient(circle at 30% 60%, rgba(34, 209, 238, 0.05) 0%, rgba(0, 0, 0, 0) 25%);
}

.section-header {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 2.5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
  max-width: 90%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--secondary-color));
}

.features-grid, .category-grid {
  display: grid;
  gap: 30px;
}

.features-grid {
  grid-template-columns: repeat(4, 1fr);
}

.category-grid {
  grid-template-columns: repeat(4, 1fr);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.feature-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 40px 30px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--gradient-start), var(--secondary-color));
  transform: scaleX(0);
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
  transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--light-color);
  font-weight: 600;
}

.feature-card p {
  color: var(--gray-color);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.category-card {
  height: 220px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 40%, var(--bg-overlay-dark));
  z-index: 1;
  transition: all var(--transition-fast);
}

.category-card:hover {
  transform: translateY(-10px);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.category-card:hover img {
  transform: scale(1.12);
}

.category-card img:not([src]), 
.category-card img[src=""], 
.category-card img.error {
  opacity: 0;
  display: none;
}

.category-name {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: white;
  padding: 20px 15px;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  transition: padding 0.3s;
}

.category-card:hover .category-name {
  padding-bottom: 25px;
}

.testimonial-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 35px 30px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
}

.testimonial-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.testimonial-rating {
  color: #ffc107;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.testimonial-text {
  font-style: italic;
  margin-bottom: 25px;
  flex-grow: 1;
  position: relative;
  padding-left: 20px;
  line-height: 1.8;
}

.testimonial-text::before {
  content: '"';
  font-size: 4rem;
  position: absolute;
  top: -20px;
  left: -10px;
  color: rgba(108, 99, 255, 0.2);
  font-family: sans-serif;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 15px;
}

.testimonial-author img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gradient-start);
}

.author-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.author-name {
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.2;
  color: var(--light-color);
  font-family: 'Montserrat', sans-serif;
}

.author-title {
  font-size: 0.9rem;
  color: var(--secondary-color);
  line-height: 1.2;
}

footer {
  flex-shrink: 0;
  background: var(--dark-color);
  padding: 50px 0 30px;
  margin-top: auto;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(108, 99, 255, 0.2) 25%, 
    rgba(255, 101, 132, 0.2) 50%, 
    rgba(108, 99, 255, 0.2) 75%, 
    transparent 100%);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--light-color);
  transition: transform 0.3s ease;
}

.footer-logo:hover {
  transform: translateY(-3px);
}

.footer-logo i {
  color: var(--secondary-color);
  transition: transform 0.3s ease;
}

.footer-logo:hover i {
  transform: scale(1.1);
}

.copyright {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.footer-content:hover .copyright {
  color: rgba(255, 255, 255, 0.9);
}

/* Модальное окно логина */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 15, 28, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.show {
  display: flex;
  animation: fadeIn 0.4s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(22, 16, 48, 0.95));
  width: 100%;
  max-width: 450px;
  border-radius: 20px;
  padding: 40px 30px;
  position: relative;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.4s;
}

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

.modal-content h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  background: linear-gradient(90deg, var(--gradient-start), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition-fast);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  color: var(--light-color);
  background: rgba(255, 255, 255, 0.1);
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 18px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 10px;
}

#reset-form {
  color: var(--light-color);
}

#reset-form h3 {
  margin-bottom: 15px;
  text-align: center;
}

#reset-form p {
  margin-bottom: 20px;
  text-align: center;
  opacity: 0.8;
  font-size: 0.9rem;
}

@media (max-width: 1024px) {
  .features-grid, .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-card {
    aspect-ratio: auto;
    height: 350px;
  }
}

@media (max-width: 768px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 0;
    background: var(--dark-color);
  }
  
  header .container {
    padding: 0 15px;
  }
  
  nav {
    height: auto;
    padding: 0;
  }
  
  .logo {
    font-size: 1.2rem;
    padding: 0;
  }
  
  .logo i {
    font-size: 1.4rem;
    margin-right: 8px;
  }
  
  .mobile-menu-toggle {
    padding: 8px;
    margin-left: 10px;
  }
  
  main {
    padding-top: 60px;
  }
  
  .nav-links {
    display: none !important;
  }
  
  section {
    padding: 60px 0;
  }
  
  section:not(.hero) {
    margin-top: 30px;
  }
  
  .hero {
    padding-top: 80px;
    margin-top: 0;
  }
  
  .container {
    width: 90%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  .hero-content {
    width: 100%;
    max-width: 100%;
    padding: 30px 15px;
    box-sizing: border-box;
    overflow-wrap: break-word;
  }
  
  .hero h1 {
    font-size: 2.2rem;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .hero-buttons a {
    width: 100%;
    margin: 5px 0;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }
  
  .features-grid, 
  .category-grid, 
  .testimonial-grid {
    grid-template-columns: 1fr;
  }
  
  .feature-card {
    height: auto;
    padding: 30px;
    min-height: 300px;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 15px;
  }
  
  .forgot-password {
    width: 100%;
    text-align: center;
  }
  
  .login-btn {
    width: 100%;
  }
  
  .modal-content {
    width: 90%;
  }
  
  .section-header {
    padding: 0 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .section-title {
    font-size: 2rem;
    width: 100%;
    max-width: 100%;
    padding: 0 0 15px 0;
    margin-bottom: 40px;
    box-sizing: border-box;
    text-align: center;
  }
  
  .logo:hover {
    transform: none !important;
  }
  
  footer {
    padding: 30px 0 20px;
    background: var(--dark-color);
  }
}

@media (max-width: 576px) {
  header {
    padding: 10px 0;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .logo i {
    font-size: 1.2rem;
    margin-right: 6px;
  }
  
  main {
    padding-top: 50px;
  }
  
  .hero {
    padding-top: 70px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero-content,
  .feature-card, 
  .testimonial-card {
    padding: 20px 15px;
  }
  
  .section-header {
    padding: 0 5px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .section-title {
    font-size: 1.6rem;
    width: 100%;
    margin-bottom: 30px;
    padding: 0 0 12px 0;
    text-align: center;
  }
  
  .section-description {
    padding: 0 15px;
  }
  
  footer {
    padding: 25px 0 15px;
    background: var(--dark-color);
  }
}

/* Анимации для элементов при прокрутке */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Задержки анимации */
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* Задержка для элементов сетки */
.category-grid .animate-on-scroll:nth-child(n),
.features-grid .animate-on-scroll:nth-child(n),
.testimonial-grid .animate-on-scroll:nth-child(n) {
  transition-delay: calc(0.1s * var(--i, 1));
}

/* Последовательность задержек по порядку */
.category-grid .animate-on-scroll:nth-child(1) { --i: 1; }
.category-grid .animate-on-scroll:nth-child(2) { --i: 2; }
.category-grid .animate-on-scroll:nth-child(3) { --i: 3; }
.category-grid .animate-on-scroll:nth-child(4) { --i: 4; }
.category-grid .animate-on-scroll:nth-child(5) { --i: 5; }
.category-grid .animate-on-scroll:nth-child(6) { --i: 6; }
.category-grid .animate-on-scroll:nth-child(7) { --i: 7; }
.category-grid .animate-on-scroll:nth-child(8) { --i: 8; }

.features-grid .animate-on-scroll:nth-child(1) { --i: 1; }
.features-grid .animate-on-scroll:nth-child(2) { --i: 3; }
.features-grid .animate-on-scroll:nth-child(3) { --i: 5; }
.features-grid .animate-on-scroll:nth-child(4) { --i: 7; }

.testimonial-grid .animate-on-scroll:nth-child(1) { --i: 1; }
.testimonial-grid .animate-on-scroll:nth-child(2) { --i: 3; }
.testimonial-grid .animate-on-scroll:nth-child(3) { --i: 5; }

/* Здесь внесены только критически необходимые стили для оставшихся блоков */
.category-placeholder {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.category-label {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-align: center;
  z-index: 1;
  padding: 0 15px;
  width: 100%;
}

/* Стили для видео-категорий */
.video-category {
  position: relative;
}

.video-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.9));
  z-index: 1;
  transition: all var(--transition-fast);
}

.video-category .category-name {
  color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.video-category .category-name i {
  color: var(--accent-color);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.video-category:hover .category-name i {
  transform: scale(1.2);
}

.video-category::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  z-index: 2;
  opacity: 0;
  transition: all var(--transition-fast);
}

.video-category:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--light-color);
  z-index: 3;
  font-size: 1.2rem;
  opacity: 0;
  transition: all var(--transition-fast);
}

.video-category:hover .video-icon {
  opacity: 1;
}

/* Форма входа */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--light-color);
  font-size: 1rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.08);
  color: var(--light-color);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--gradient-start);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.25);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 10px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--light-color);
  font-size: 0.9rem;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--secondary-color);
  cursor: pointer;
}

.forgot-password {
  background: none;
  border: none;
  color: var(--secondary-color);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  text-align: center;
  position: relative;
  font-weight: 500;
  overflow: hidden;
  display: inline-block;
}

.forgot-password::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(255, 101, 132, 0.1));
  z-index: -1;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.forgot-password:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.forgot-password:hover::before {
  opacity: 1;
}

.btn-secondary.forgot-password {
  color: white;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.7), rgba(255, 101, 132, 0.7));
  border-radius: 50px;
  padding: 12px 25px;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(108, 99, 255, 0.2);
  border: none;
  text-decoration: none;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary.forgot-password:hover {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.8), rgba(255, 101, 132, 0.8));
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(108, 99, 255, 0.3);
}

.login-options .forgot-password {
  padding: 5px 10px;
}

.login-btn {
  background: linear-gradient(135deg, var(--gradient-start), var(--secondary-color));
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
}

.login-btn:hover {
  background: linear-gradient(135deg, var(--secondary-color), var(--gradient-start));
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
  transform: translateY(-1px);
}

/* Анимация ошибки для формы */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake-error {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Стили для иконки загрузки */
.fa-spinner {
  margin-right: 6px;
}

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

.fa-spin {
  animation: spin 1s linear infinite;
}

/* Добавляем стили для мобильного меню */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--light-color);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 99;
}

.mobile-menu-toggle:hover {
  color: var(--secondary-color);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 350px;
  height: 100%;
  background: var(--dark-color);
  z-index: 1000;
  transition: right 0.3s ease;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
  display: block;
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-container {
  padding: 60px 20px 20px;
  display: flex;
  flex-direction: column;
}

.mobile-menu-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--light-color);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 5px;
  z-index: 1010;
}

.mobile-menu a {
  padding: 12px 0;
  color: var(--light-color);
  font-size: 1.1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  color: var(--primary-color);
}

/* Добавляем темный оверлей при открытом мобильном меню */
body.mobile-menu-open:before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

/* Обеспечиваем полную ширину секций */
section {
  width: 100%;
  overflow-x: hidden;
  padding: 80px 0;
  position: relative;
}

section:not(.hero) {
  margin-top: 40px;
}

section:last-of-type {
  margin-bottom: 40px;
}

/* Обязательно показываем кнопку мобильного меню на мобильных устройствах */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav-links {
    display: none;
  }
  
  body.mobile-menu-open {
    overflow: hidden;
  }
  
  body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
  }
}

/* Общие стили для улучшения отображения контента */
img {
  max-width: 100%;
  height: auto;
}

/* Предотвращаем прокрутку при открытом мобильном меню */
body.mobile-menu-open {
  overflow: hidden;
}

main {
  flex: 1 0 auto;
  overflow: hidden;
}

/* Улучшенные стили для мобильного логина */
.mobile-login-btn {
  margin-top: 15px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  text-decoration: none;
  border: none;
  font-size: 1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mobile-login-btn:hover, 
.mobile-login-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Стили для мобильного меню */
@media (max-width: 768px) {
  .mobile-menu-container {
    padding: 70px 25px 25px;
  }
  
  .mobile-menu a {
    padding: 14px 0;
    font-size: 1.15rem;
  }
  
  .mobile-menu-close {
    top: 18px;
    right: 18px;
  }
}

@media (max-width: 576px) {
  .mobile-menu-container {
    padding: 60px 20px 20px;
  }
  
  .mobile-menu a {
    padding: 12px 0;
    font-size: 1.1rem;
  }
  
  .mobile-menu-close {
    top: 15px;
    right: 15px;
  }
}

/* Обеспечиваем, чтобы футер был всегда в самом низу страницы */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  min-height: 100vh;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  overflow: hidden;
}

/* Стили для футера */
footer {
  flex-shrink: 0;
  background: var(--dark-color);
  padding: 50px 0 30px;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Корректировка отступов для мобильной версии */
@media (max-width: 768px) {
  footer {
    padding: 30px 0 20px;
  }
}

@media (max-width: 576px) {
  footer {
    padding: 25px 0 15px;
  }
}

/* RTL поддержка для мобильного меню */
[dir="rtl"] .mobile-menu {
  right: auto;
  left: -100%;
  transition: left 0.3s ease;
}

[dir="rtl"] .mobile-menu.active {
  right: auto;
  left: 0;
}

[dir="rtl"] .mobile-menu-close {
  right: auto;
  left: 15px;
}

[dir="rtl"] .mobile-menu a {
  text-align: right;
}

@media (max-width: 576px) {
  [dir="rtl"] .mobile-menu-close {
    left: 15px;
  }
}

@media (max-width: 768px) {
  [dir="rtl"] .mobile-menu-toggle {
    margin-right: 10px;
    margin-left: 0;
  }
  
  [dir="rtl"] .mobile-menu-close {
    left: 18px;
  }
} 