.application-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.application-form-container {
  position: relative;
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  margin: 2rem auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  min-height: fit-content;
}

.application-form-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 1;
}

.application-form-close:hover {
  color: #000000;
  background: rgba(0, 0, 0, 0.05);
}

.application-form-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.application-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.application-form-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #000000;
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}

.application-form-subtitle {
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.7);
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

.application-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.application-form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.application-form-required {
  color: #ef4444;
}

.application-form-input,
.application-form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  color: #000000;
  font-size: 0.95rem;
  font-family: 'Nunito Sans', 'Inter', 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
  outline: none;
}

.application-form-input::placeholder,
.application-form-textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.application-form-input:focus,
.application-form-textarea:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.application-form-input:disabled,
.application-form-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.application-form-input.error,
.application-form-textarea.error {
  border-color: #ef4444;
  background: #fff5f5;
}

.application-form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.application-form-radio-group,
.application-form-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

.application-form-hint {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.4;
}

.application-form-radio-group {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.application-form-radio-label,
.application-form-option-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.4;
}

.application-form-radio {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.application-form-radio:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.application-form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.5;
}

.application-form-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.application-form-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.application-form-checkbox-text {
  flex: 1;
}

.application-form-link {
  color: #3b82f6;
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.5);
  transition: color 0.2s ease;
}

.application-form-link:hover {
  color: #2563eb;
  text-decoration-color: rgba(37, 99, 235, 0.7);
}

.application-form-error {
  font-size: 0.85rem;
  color: #ef4444;
  margin-top: 0.25rem;
}

.application-form-error-message {
  padding: 0.875rem;
  background: #fff5f5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #ef4444;
  font-size: 0.875rem;
  text-align: center;
}

.application-form-submit {
  width: 100%;
  padding: 1rem 3rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Nunito Sans', 'Inter', 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.application-form-submit::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;
}

.application-form-submit:hover::before {
  left: 100%;
}

.application-form-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
  transform: translateY(-2px);
}

.application-form-submit:active:not(:disabled) {
  transform: translateY(0);
}

.application-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.application-form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
}

.application-form-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.application-form-success-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #000000;
  margin: 0 0 1rem 0;
}

.application-form-success-message {
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.6;
  margin: 0;
  max-width: 400px;
}

@media (max-width: 640px) {
  .application-form-overlay {
    padding: 1rem;
  }

  .application-form-container {
    padding: 1.5rem;
    border-radius: 20px;
    margin: 1rem auto;
  }

  .application-form-title {
    font-size: 1.5rem;
  }

  .application-form-subtitle {
    font-size: 0.9rem;
  }

  .application-form-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .application-form-submit {
    padding: 0.9rem 2.5rem;
    font-size: 1.1rem;
  }
}


/* Скрыто, пока не открыта (вместо размонтирования React) */
.application-form-overlay:not(.is-open) {
  display: none;
}

.application-form-overlay.is-open {
  display: flex;
}

.application-form-view[hidden] {
  display: none !important;
}

/* Компактнее на типичных десктопных разрешениях презентации */
@media (min-width: 1366px) and (max-width: 1599px), (max-width: 1365px) {
  .application-form-overlay {
    padding: 1rem !important;
  }

  .application-form-container {
    padding: 1.5rem !important;
    max-width: 520px !important;
    margin: 1rem auto !important;
    border-radius: 20px !important;
  }

  .application-form-title {
    font-size: 1.5rem !important;
    margin-bottom: 0.15rem !important;
  }

  .application-form-subtitle {
    font-size: 0.85rem !important;
    margin-bottom: 1rem !important;
  }

  .application-form {
    gap: 1rem !important;
  }

  .application-form-field {
    gap: 0.35rem !important;
  }

  .application-form-label {
    font-size: 0.85rem !important;
  }

  .application-form-input,
  .application-form-textarea {
    padding: 0.75rem 0.875rem !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
  }

  .application-form-textarea {
    min-height: 80px !important;
  }

  .application-form-checkbox-label {
    font-size: 0.8rem !important;
    gap: 0.6rem !important;
  }

  .application-form-checkbox {
    width: 18px !important;
    height: 18px !important;
  }

  .application-form-submit {
    padding: 0.85rem 2.5rem !important;
    font-size: 1.05rem !important;
    margin-top: 0.25rem !important;
  }

  .application-form-close {
    top: 0.75rem !important;
    right: 0.75rem !important;
    padding: 0.4rem !important;
  }

  .application-form-close svg {
    width: 20px !important;
    height: 20px !important;
  }

  .application-form-success {
    padding: 1.5rem 1rem !important;
  }

  .application-form-success-icon {
    width: 64px !important;
    height: 64px !important;
    margin-bottom: 1rem !important;
  }

  .application-form-success-icon svg {
    width: 32px !important;
    height: 32px !important;
  }

  .application-form-success-title {
    font-size: 1.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  .application-form-success-message {
    font-size: 0.9rem !important;
    max-width: 350px !important;
  }

  .application-form-error {
    font-size: 0.8rem !important;
  }

  .application-form-error-message {
    padding: 0.75rem !important;
    font-size: 0.8rem !important;
  }
}
