:root {
    --color-orange: #FE8400;
    --color-orange-hover: #e57500;
    --color-purple: #7257FF;
    --color-purple-hover: #5a42e0;
    --color-purple-light: #f0edff;
    --color-orange-light: #fff5eb;
    
    --color-text: #1a1a2e;
    --color-text-secondary: #4a4a68;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fc;
    --color-border: #e0e0f0;
    
    --shadow-sm: 0 2px 8px rgba(114, 87, 255, 0.1);
    --shadow-md: 0 4px 20px rgba(114, 87, 255, 0.15);
    --shadow-lg: 0 8px 40px rgba(114, 87, 255, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50%;
    
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: system-ui, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --page-gutter: clamp(1rem, 4vw, 2.5rem);
    --section-padding-y: clamp(4.5rem, 8vw, 6rem);
  }
  
  /* ===== СБРОС СТИЛЕЙ ===== */
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: var(--font-main);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
  }
  
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
  }
  
  ul {
    list-style: none;
  }
  
  /* ===== УТИЛИТЫ ===== */
  .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--page-gutter);
  }
  
  .section {
    padding: 80px 0;
  }
  
  main > section > h2,
  .section-title {
    font-family: var(--font-heading);
    text-align: center;
    font-size: clamp(2.25rem, 4.5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: clamp(2.5rem, 5vw, 3.25rem);
    color: var(--color-text);
    position: relative;
  }
  
  main > section > h2::after,
  .section-title::after {
    content: '';
    display: block;
    width: 96px;
    height: 5px;
    background: linear-gradient(90deg, var(--color-orange), var(--color-purple));
    margin: 18px auto 0;
    border-radius: 3px;
  }

  main h1,
  main h2,
  main h3 {
    font-family: var(--font-heading);
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--color-orange), var(--color-purple));
    color: white;
    box-shadow: var(--shadow-md);
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-orange-hover), var(--color-purple-hover));
  }
  
  .btn-outline {
    background: transparent;
    border: 2px solid var(--color-purple);
    color: var(--color-purple);
  }
  
  .btn-outline:hover {
    background: var(--color-purple);
    color: white;
  }
  
  /* ===== ШАПКА ===== */
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
  }
  
  header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  header .container > a:first-of-type {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
  }
  
  header a img {
    height: 48px;
    width: auto;
    object-fit: contain;
  }
  
  nav ul {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  nav ul li a {
    padding: 10px 18px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
  }
  
  nav ul li a:hover,
  nav ul li a:focus {
    color: var(--color-purple);
    background: var(--color-purple-light);
  }
  
  nav ul li a[href="#contact"] {
    background: var(--color-purple);
    color: white;
  }
  
  nav ul li a[href="#contact"]:hover {
    background: var(--color-purple-hover);
    transform: translateY(-1px);
  }

  /* ===== ОСНОВНОЙ КОНТЕНТ: отступы и разделители секций ===== */
  main > section:not(#hero) {
    padding-inline: var(--page-gutter);
    padding-block: var(--section-padding-y);
  }

  main > section + section {
    border-top: 1px solid var(--color-border);
  }
  
  /* ===== ГЛАВНЫЙ ЭКРАН (HERO) ===== */
  #hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px var(--page-gutter);
    background-color: var(--color-purple-light);
    background-image:
      linear-gradient(135deg, rgba(240, 237, 255, 0.88) 0%, rgba(255, 245, 235, 0.82) 100%),
      url('/static/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
  }
  
  #hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(254, 132, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle, rgba(114, 87, 255, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
  }
  
  @keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
  }
  
  #hero h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--color-text), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
  }
  
  #hero p {
    position: relative;
    z-index: 1;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
  }
  
  #hero a[href="#contact"] {
    position: relative;
    z-index: 1;
        font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--color-text-secondary);
  }
  
  /* ===== О НАС ===== */
  #about {
    background: var(--color-bg);
  }
  
  #about > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
  }
  
  #about > div > div {
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  #about > div > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-orange), var(--color-purple));
  }
  
  #about > div > div:hover {
    transform: translateY(-5px);
    border-color: var(--color-purple);
    box-shadow: var(--shadow-md);
  }
  
  #about h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  #about h3::before {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-orange), var(--color-purple));
  }
  
  #about ul li {
    padding: 12px 0 12px 32px;
    position: relative;
    color: var(--color-text-secondary);
    font-size: 1.05rem;
  }
  
  #about ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--color-purple);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
  }
  
  /* ===== КУРСЫ ===== */
  #courses {
    background: var(--color-bg-alt);
  }
  
  #courses ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
  }
  
  #courses ul li {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
  }
  
  #courses ul li:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
  }
  
  #courses ul li img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 3px solid var(--color-purple);
  }
  
  #courses ul li h3 {
    padding: 20px 20px 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
  }
  
  #courses ul li p {
    padding: 0 20px 20px;
    color: var(--color-text-secondary);
    flex-grow: 1;
    font-size: 0.95rem;
  }
  
  #courses ul li a {
    align-self: center;
    margin: 0 auto 20px;
    padding: 10px 16px;
    max-width: fit-content;
    background: var(--color-purple);
    color: white;
    border-radius: 999px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
  }
  
  /* ===== КОМАНДА ===== */
  #team {
    background: var(--color-bg);
  }
  
  #team ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
  }
  
  #team ul li {
    text-align: center;
    padding: 30px 20px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 12px rgba(114, 87, 255, 0.06);
    transition:
      transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  
  #team ul li:hover {
    transform: translateY(-6px);
    box-shadow:
      0 14px 32px rgba(114, 87, 255, 0.14),
      0 0 0 1px rgba(254, 132, 0, 0.28);
  }
  
  #team ul li img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 20px;
    object-fit: cover;
    border: none;
    box-shadow: 0 0 0 3px var(--color-purple-light);
    transition: box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    backface-visibility: hidden;
  }
  
  #team ul li:hover img {
    box-shadow: 0 0 0 3px rgba(254, 132, 0, 0.45);
  }
  
  #team ul li h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
  }
  
  #team ul li p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
  }
  
  /* ===== ОСТАВИТЬ ЗАЯВКУ ===== */
  #contact {
    background: linear-gradient(135deg, var(--color-purple-light) 0%, var(--color-bg) 100%);
  }
  
  #contact > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
  }
  
  #contact > div > div:first-child {
    text-align: center;
  }
  
  #contact > div > div:first-child img {
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 4px solid white;
  }
  
  #contact > div > div:first-child p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
  }
  
  .form-card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--color-purple-light);
  }
  
  .form-card h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 2.5vw, 2.125rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--color-text);
  }
  
  .form-card .subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 30px;
    font-size: 1.05rem;
  }
  
  .form-group {
    margin-bottom: 24px;
  }
  
  .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 0.95rem;
  }
  
  .form-group label .required {
    color: var(--color-orange);
    margin-left: 2px;
  }
  
  .form-group input,
  .form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--color-bg-alt);
  }
  
  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--color-purple);
    background: white;
    box-shadow: 0 0 0 4px var(--color-purple-light);
  }
  
  .form-group input:hover,
  .form-group textarea:hover {
    border-color: var(--color-orange);
  }
  
  .form-group textarea {
    min-height: 120px;
    resize: vertical;
  }
  
  .submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-purple));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    box-shadow: var(--shadow-md);
  }
  
  .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-orange-hover), var(--color-purple-hover));
  }
  
  .submit-btn:active {
    transform: translateY(0);
  }
  
  /* ===== ФУТЕР ===== */
  footer {
    background: var(--color-text);
    color: white;
    text-align: center;
    padding: 40px var(--page-gutter);
  }
  
  footer p {
    margin-bottom: 12px;
    opacity: 0.9;
  }
  
  footer p:first-child {
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 1;
  }
  
  footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--color-purple);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-top: 16px;
    transition: var(--transition);
  }
  
  footer a:hover {
    background: var(--color-orange);
    transform: translateY(-2px);
  }
  
  /* ===== АНИМАЦИИ ===== */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  section {
    animation: fadeInUp 0.6s ease forwards;
  }
  
  section:nth-child(2) { animation-delay: 0.1s; }
  section:nth-child(3) { animation-delay: 0.2s; }
  section:nth-child(4) { animation-delay: 0.3s; }
  section:nth-child(5) { animation-delay: 0.4s; }
  
  /* ===== АДАПТИВ ===== */
  @media (max-width: 900px) {
    #contact > div {
      grid-template-columns: 1fr;
      text-align: center;
    }
    
    #contact > div > div:first-child {
      order: 2;
    }
    
    .form-card {
      order: 1;
    }
  }
  
  @media (max-width: 768px) {
    header .container {
      flex-wrap: wrap;
    }
    
    nav ul {
      width: 100%;
      justify-content: center;
      flex-wrap: wrap;
      margin-top: 12px;
    }
    
    nav ul li a {
      padding: 8px 14px;
      font-size: 0.9rem;
    }
    
    .section {
      padding: 60px 0;
    }
    
    main > section:not(#hero) {
      padding-block: 3.5rem;
    }

    main > section > h2,
    .section-title {
      font-size: clamp(1.85rem, 5vw, 2.35rem);
    }
    
    #about > div > div {
      padding: 30px 24px;
    }
    
    .form-card {
      padding: 30px 24px;
    }
  }
  
  @media (max-width: 480px) {
    #hero h1 {
      font-size: 2rem;
    }
    
    #hero p {
      font-size: 1rem;
    }
    
    .btn {
      padding: 12px 24px;
      font-size: 0.95rem;
    }
    
    nav ul li a[href="#contact"] {
      width: 100%;
      justify-content: center;
    }
    
    .form-card h1 {
      font-size: 1.65rem;
    }
  }
  
  /* ===== ДОСТУПНОСТЬ ===== */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    
    html {
      scroll-behavior: auto;
    }
  }
  
  /* ===== ФОКУС ДЛЯ КЛАВИАТУРЫ ===== */
  a:focus,
  button:focus,
  input:focus,
  textarea:focus {
    outline: 3px solid var(--color-orange);
    outline-offset: 2px;
  }
  
  /* ===== СКРЫТЬ ИЗОБРАЖЕНИЯ-ЗАГЛУШКИ ПРИ ОТСУТСТВИИ ФАЙЛОВ ===== */
  img[src="logo.png"],
  img[src="hero-bg.jpg"],
  img[src^="course-"],
  img[src^="teacher-"],
  img[src="contact-image.jpg"] {
    background: linear-gradient(135deg, var(--color-purple-light), var(--color-orange-light));
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
  }
  
  img[alt="Логотип"] {
    font-weight: 700;
    color: var(--color-purple);
    font-size: 1.2rem;
  }

  /* ===== СТРАНИЦА БЛАГОДАРНОСТИ (после отправки формы) ===== */
  body.submit-success-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: var(--page-gutter);
    background-color: var(--color-purple-light);
    background-image:
      linear-gradient(135deg, rgba(240, 237, 255, 0.88) 0%, rgba(255, 245, 235, 0.82) 100%),
      url('/static/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-text);
  }

  .submit-success-card {
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem);
    max-width: 480px;
    width: 100%;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--color-purple-light);
  }

  .submit-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-orange), var(--color-purple));
    position: relative;
  }

  .submit-success-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 46%;
    width: 14px;
    height: 24px;
    border: solid white;
    border-width: 0 4px 4px 0;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .submit-success-card h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: var(--color-text);
  }

  .submit-success-card p {
    color: var(--color-text-secondary);
    margin: 0;
    font-size: 1.05rem;
  }

  .submit-success-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-purple));
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
  }

  .submit-success-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--color-orange-hover), var(--color-purple-hover));
  }