body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
  }
  .form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
  }
  .form-section h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
  }
  .form-group {
    margin-bottom: 15px;
    position: relative;
  }
  
  /* Стили для невалидных полей */
  .form-group.error input,
  .form-group.error select,
  .form-group.error input:focus,
  .form-group.error select:focus,
  select.error,
  select.error:focus {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 1px #e74c3c;
  }
  
  /* Подсветка метки при ошибке */
  .form-group.error label,
  label.error {
    color: #e74c3c;
  }
  
  /* Контейнер для сообщений об ошибках */
  .error-container {
    min-height: 0;
    overflow: hidden;
    transition: min-height 0.2s ease;
  }
  
  /* Стили для сообщений об ошибках */
  .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    display: none;
  }
  
  /* Стили для отображения сообщений об ошибках */
  .error-message:not(:empty) {
    display: block;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #fde8e8;
    border-left: 3px solid #e74c3c;
    border-radius: 4px;
  }
  
  /* Убираем все стили, которые могут скрывать сообщения об ошибках */
  /* .error-message[style*="display: none"],
  .error-message[style*="display:none"] {
    display: block !important;
  } */
  
  /* Base form row styling */
  .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
  }
  
  .form-row > div {
    flex: 1;
    min-width: 200px; /* Minimum width for form controls */
  }
    
  /* Блок 3: Контакты - расположение полей */
  #contacts-section .contacts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
  }
  
  #contacts-section .form-group {
    min-width: 0;
  }
        
  /* Блок 4: Конкурсный номер - расположение полей */
  #performance-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr) ;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
  }
  
  #performance-row .form-group {
    min-width: 0; /* Позволяет сжиматься элементам внутри контейнера */
  }
  
  
  
  /* Блок подтверждения информации */
  .confirmation-notice {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
  }
  
  .confirmation-notice p {
    margin: 0;
    color: #495057;
    font-size: 15px;
    line-height: 1.5;
  }
  
  .confirmation-details {
    margin: 20px 0;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
  }
  
  .confirmation-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  .confirmation-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.2em;
  }
  .confirmation-row {
    display: flex;
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    background-color: #fff;
    margin-bottom: 6px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: background-color 0.2s;
  }
  .confirmation-row:hover {
    background-color: #f8f9fa;
  }
  .confirmation-label {
    font-weight: 600;
    color: #495057;
    min-width: 180px;
    flex-shrink: 0;
    padding-right: 10px;
  }
  .confirmation-value {
    color: #212529;
    word-break: break-word;
    flex-grow: 1;
  }
  
  /* Блок 5: Местоположение - расположение полей */

  #performance-row .form-group:first-child {
      grid-column: 1 / -1;
  }

  #location-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
  }
  
  #location-row .form-group {
    min-width: 0; /* Позволяет сжиматься элементам внутри flex-контейнера */
  }
      
  /* Responsive adjustments for nomination section */
  #nomination-section .form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    
  }

  #nomination-section .form-group {
    min-width: 0; /* Позволяет сжиматься элементам внутри flex-контейнера */
  }
  
  /* Tablet view - 2 columns */
  @media (max-width: 768px) {
    #contacts-section .contacts-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    
    .confirmation-row {
      flex-direction: column;
      padding: 8px 10px;
    }
    .confirmation-label {
      min-width: 100%;
      margin-bottom: 4px;
      padding-right: 0;
    }
    .confirmation-label,
    .confirmation-value {
      width: 100%;
    }
    
    .confirmation-label {
      margin-bottom: 5px;
    }
    
    #location-row {
      grid-template-columns: repeat(2, 1fr);
    }
    
    #location-row .form-group:last-child {
      grid-column: 1 / -1;
    }

    #performance-row .form-group:nth-child(1) {
      grid-column: 1 / -1;
    }

    #nomination-section .form-row {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  /* Mobile view - 1 column */
  @media (max-width: 550px) {        
    #nomination-section .form-row,
    #participants-section,
    #contacts-section .contacts-grid,
    #performance-row,
    #location-row
    {
      grid-template-columns: 1fr;
      gap: 15px;
    }
  }

  /* Для контейнера участников */
  #participantsContainer {
    display: grid;
    gap: 15px;
  }

  /* Для строк с участниками */
  #participantsContainer > .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  /* Мобильная версия */
  @media (max-width: 550px) {
    #participantsContainer > .form-row {
      grid-template-columns: 1fr;
    }
  }

  label[for] {
    white-space: nowrap;
  }

  label a:has(span.required) {
    white-space: nowrap;
  }

  /* Навигация по шагам */
  .form-navigation {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #eee;
  }

  .progress-indicator {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    margin-bottom: 20px;
    border-radius: 3px;
    overflow: hidden;
  }

  .progress-bar {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
  }

  .navigation-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
  }

  .step-indicator {
    flex-grow: 1;
    text-align: center;
    font-weight: 500;
  }

  .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
  }

  .btn-primary {
    background-color: #3498db;
    color: white;
  }

  .btn-secondary {
    background-color: #95a5a6;
    color: white;
  }

  .btn-success {
    background-color: #2ecc71;
    color: white;
  }

  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Скрытие неактивных шагов */
  .form-section:not(:first-child) {
    display: none;
  }
  
  
  label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
  }
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
  }
  .checkbox-group {
    margin: 15px 0;
  }
  .checkbox-group label {
    
    align-items: center;
    font-weight: normal;
    cursor: pointer;
  }
  .checkbox-group input[type="checkbox"] {
    margin-right: 10px;
  }
  a {
    color: #3498db;
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }
  .required {
    color: #e74c3c;
  }

  /* Progress Popup Styles */
  .progress-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
  }

  .progress-popup-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative; /* Добавляем relative для правильного позиционирования крестика */
  }

  .progress-popup h3 {
    margin-top: 0;
    color: #2c3e50;
    text-align: center;
  }

  .progress-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin: 20px 0;
    height: 20px;
    overflow: hidden;
  }

  .progress-bar-upload {
    height: 100%;
    width: 0%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
    text-align: center;
    line-height: 20px;
    color: white;
    font-size: 12px;
  }

  .progress-details {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #555;
  }

  /* Progress Popup Controls */
  .popup-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
  }

  .popup-close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
  }

  .popup-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .popup-controls.show {
    opacity: 1;
    visibility: visible;
  }

  .upload-status {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    color: #2c3e50;
  }

  /* File Upload Styling */
  .file-upload-group {
    margin-bottom: 1rem;
  }

  .file-input-container {
    display: flex;
    width: 100%;
    margin-top: 0.5rem;
  }

  .file-name {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    background-color: #f9f9f9;
    font-size: 0.9rem;
    height: 38px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .file-input-label {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    height: 38px;
    box-sizing: border-box;
    line-height: 1.5;
  }

  .file-input-label:hover {
    background-color: #2980b9;
  }

  .file-input-label:active {
    background-color: #2472a4;
  }

  .file-requirements {
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
  }
  #progress {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
    display: none;
  }
  #progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s ease;
  }
  #upload-list {
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    display: none;
  }
  .hidden {
    display: none;
  }
  button[type="submit"] {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
  }
  button[type="submit"]:hover {
    background-color: #2980b9;
  }