body.modal-open {overflow: hidden;}
.form-success-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.form-success-modal.active {
  display: flex;
}
.form-success-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.form-success-dialog {
  position: relative;
  max-width: 420px;
  width: calc(100% - 32px);
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.3s ease;
}
.form-success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
}
.form-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e8fcf1;
  color: #1abc9c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: 0 auto 16px;
}
.form-success-content {
  text-align: center;
}
.form-success-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.form-success-actions .btn + .btn {
  margin-left: 12px;
}
@media (max-width: 575px) {
  .form-success-actions {
    flex-direction: column;
  }
  .form-success-actions .btn {
    width: 100%;
    margin-left: 0;
  }
}

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.form-success-actions .btn {
  min-width: 160px;
}
@media (max-width: 575px) {
  .form-success-actions {
    flex-direction: column;
    width: 100%;
  }
  .form-success-actions .btn {
    width: 100%;
  }
}
.form-success-actions .btn {
  min-width: 160px;
}
@media (max-width: 575px) {
  .form-success-actions {
    flex-direction: column;
  }
  .form-success-actions .btn {
    width: 100%;
  }
}
@keyframes modalIn {
  from {transform: translateY(15px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}


.sent-message .sent-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sent-message .sent-actions .btn + .btn {
  margin-left: 10px;
}
@media (max-width: 575px) {
  .sent-message .sent-actions {
    flex-direction: column;
  }
  .sent-message .sent-actions .btn {
    width: 100%;
    margin-left: 0;
  }
}

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sent-message .sent-actions .btn {
  min-width: 140px;
}
@media (max-width: 575px) {
  .sent-message .sent-actions {
    flex-direction: column;
  }
  .sent-message .sent-actions .btn {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .sent-message .sent-actions {
    flex-direction: column;
    width: 100%;
  }
  .sent-message .sent-actions .btn {
    width: 100%;
  }
}
.sent-message .sent-actions .btn {
  font-size: 0.875rem;
}

.php-email-form .sent-message .btn {
  margin-top: 8px;
}
/* Enhanced Contact Form Styles with Improved Responsive Design */

/* Base form styling */
.php-email-form {
  width: 100%;
  padding: 20px;
  background: #fff !important; /* Принудительно белый фон */
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/* Form controls base styling */
.form-control {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 12px 15px;
  font-size: 16px; /* Prevents zoom on iOS */
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff !important; /* Принудительно белый фон */
  color: #495057 !important; /* Темный текст для читаемости */
}

.form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
  background-color: #fff !important;
  color: #495057 !important;
}

/* International phone input styling */
.iti {
  width: 100%;
  position: relative;
}

.iti__flag-container {
  border-right: 2px solid #e9ecef;
}

.iti__selected-flag {
  padding: 12px 15px;
  border-radius: 6px 0 0 6px;
  background: #f8f9fa !important;
  border: 2px solid #e9ecef;
  border-right: none;
}

.iti__selected-flag:hover {
  background: #e9ecef !important;
}

.iti__selected-flag:focus {
  background: #fff !important;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Phone input field specific styling */
.iti input[type="tel"] {
  background-color: #fff !important;
  color: #495057 !important;
  border: 2px solid #e9ecef;
  border-left: none;
  border-radius: 0 6px 6px 0;
  padding: 12px 15px;
  font-size: 16px;
  width: 100%;
}

.iti input[type="tel"]:focus {
  background-color: #fff !important;
  color: #495057 !important;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
}

.iti input[type="tel"]::placeholder {
  color: #6c757d !important;
  opacity: 1;
}

/* Country dropdown styling */
.iti__country-list {
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dee2e6;
  z-index: 1050;
}

.iti__country {
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  color: #495057;
  cursor: pointer;
}

.iti__country:hover {
  background-color: #f8f9fa;
}

.iti__country.iti__highlight {
  background-color: #007bff !important;
  color: white !important;
}

.iti__country-name {
  color: #495057;
}

.iti__dial-code {
  color: #6c757d;
}

.iti__country.iti__highlight .iti__country-name,
.iti__country.iti__highlight .iti__dial-code {
  color: white !important;
}

/* Flag styling */
.iti__flag {
  background-image: url("../vendor/intl-tel-input/flags.png");
  background-repeat: no-repeat;
  background-size: contain;
  width: 20px;
  height: 15px;
  display: inline-block;
  margin-right: 8px;
}

/* File upload styling */
.form-control[type="file"] {
  padding: 12px;
  border: 2px dashed #dee2e6;
  background-color: #f8f9fa !important;
  transition: all 0.3s ease;
  cursor: pointer;
  color: #495057 !important;
}

.form-control[type="file"]:hover {
  border-color: #007bff;
  background-color: #e3f2fd !important;
}

.form-control[type="file"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  background-color: #fff !important;
}

/* Drag and drop styling */
.form-group.drag-over .form-control[type="file"] {
  border-color: #28a745;
  background-color: #d4edda !important;
}

/* File preview */
.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.875rem;
  max-width: 100%;
  color: #495057;
}

.file-preview-item .file-name {
  margin-right: 8px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  color: #495057;
}

.file-preview-item .file-size {
  color: #6c757d;
  margin-right: 8px;
  white-space: nowrap;
}

.file-preview-item .remove-file {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-preview-item .remove-file:hover {
  color: #c82333;
  background-color: #f8d7da;
}

/* Captcha styling */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background-color: #f8f9fa !important;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  flex-wrap: wrap;
}

.captcha-input {
  max-width: 120px;
  margin: 0;
  flex-shrink: 0;
  background-color: #fff !important;
  color: #495057 !important;
}

#captcha-question {
  font-weight: bold;
  color: #495057 !important;
  min-width: 80px;
  font-size: 1.1rem;
}

#refresh-captcha {
  padding: 8px 12px;
  font-size: 0.875rem;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: white !important;
  color: #495057 !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

#refresh-captcha:hover {
  background-color: #e9ecef !important;
  border-color: #adb5bd;
}

/* Auto-save indicator */
.auto-save-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  color: #28a745;
  font-size: 0.875rem;
  margin-top: 10px;
  padding: 8px 12px;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
}

.auto-save-indicator.show {
  display: flex;
}

.auto-save-indicator i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Field validation styling */
.field-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 8px;
  display: none;
  padding: 8px 12px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

.field-error.show {
  display: block;
}

.form-control.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  background-color: #fff !important;
  color: #495057 !important;
}

.form-control.is-valid {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
  background-color: #fff !important;
  color: #495057 !important;
}

/* Service type select styling */
.form-control option {
  padding: 8px;
  background-color: #fff;
  color: #495057;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  padding-right: 40px;
  appearance: none;
  background-color: #fff !important;
  color: #495057 !important;
}

/* Textarea styling */
textarea.form-control {
  background-color: #fff !important;
  color: #495057 !important;
  resize: vertical;
  min-height: 120px;
}

textarea.form-control:focus {
  background-color: #fff !important;
  color: #495057 !important;
}

/* Enhanced form security info */
.form-security-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background-color: #e8f5e8 !important;
  border: 1px solid #c3e6c3;
  border-radius: 6px;
  color: #155724 !important;
  font-size: 0.875rem;
  margin-top: 15px;
}

.form-security-info i {
  color: #28a745 !important;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Loading state improvements */
.loading {
  display: none;
  text-align: center;
  padding: 15px;
  color: #007bff !important;
  font-weight: 500;
  background-color: #fff !important;
}

.loading.show {
  display: block;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success/Error message improvements */
.sent-message, .error-message {
  padding: 15px;
  border-radius: 6px;
  margin: 15px 0;
  display: none;
  font-weight: 500;
}

.sent-message {
  background-color: #d4edda !important;
  border: 1px solid #c3e6cb;
  color: #155724 !important;
}

.error-message {
  background-color: #f8d7da !important;
  border: 1px solid #f5c6cb;
  color: #721c24 !important;
}

.sent-message.show, .error-message.show {
  display: block;
  animation: slideIn 0.3s ease-out;
}

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

/* Submit button improvements */
button[type="submit"] {
  position: relative;
  transition: all 0.3s ease;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #007bff, #0056b3) !important;
  color: white !important;
  cursor: pointer;
  width: 100%;
  min-height: 48px; /* Better touch target */
}

button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3, #004085) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

button[type="submit"]:active {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button[type="submit"].loading::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Form labels */
.form-label {
  font-weight: 500;
  color: #495057 !important;
  margin-bottom: 8px;
  display: block;
}

/* Form groups spacing */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Responsive Design - Mobile First Approach */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 575.98px) {
  .php-email-form {
    padding: 15px;
    margin: 10px;
    border-radius: 6px;
    background: #fff !important;
  }
  
  .form-control {
    padding: 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    background-color: #fff !important;
    color: #495057 !important;
  }
  
  .iti__selected-flag {
    padding: 10px 12px;
  }
  
  .iti input[type="tel"] {
    padding: 10px 12px;
    background-color: #fff !important;
    color: #495057 !important;
  }
  
  .captcha-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    background-color: #f8f9fa !important;
  }
  
  .captcha-input {
    max-width: 100%;
    background-color: #fff !important;
    color: #495057 !important;
  }
  
  #captcha-question {
    text-align: center;
    min-width: auto;
    color: #495057 !important;
  }
  
  #refresh-captcha {
    align-self: center;
    width: auto;
    background: white !important;
    color: #495057 !important;
  }
  
  .file-preview-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    background-color: #f8f9fa;
    color: #495057;
  }
  
  .file-preview-item .file-name {
    max-width: 100%;
    margin-right: 0;
    color: #495057;
  }
  
  .file-preview-item .remove-file {
    align-self: flex-end;
    margin-top: 5px;
  }
  
  .form-security-info {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    background-color: #e8f5e8 !important;
    color: #155724 !important;
  }
  
  button[type="submit"] {
    padding: 14px 20px;
    font-size: 16px;
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
  }
  
  /* International phone input mobile adjustments */
  .iti__country-list {
    max-height: 150px;
    background: #fff;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .php-email-form {
    padding: 20px;
    background: #fff !important;
  }
  
  .captcha-container {
    flex-wrap: wrap;
    justify-content: space-between;
    background-color: #f8f9fa !important;
  }
  
  .captcha-input {
    max-width: 140px;
    background-color: #fff !important;
    color: #495057 !important;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 768px) {
  .php-email-form {
    padding: 25px;
    background: #fff !important;
  }
  
  .form-control {
    padding: 12px 15px;
    background-color: #fff !important;
    color: #495057 !important;
  }
  
  button[type="submit"] {
    width: auto;
    min-width: 200px;
    padding: 12px 40px;
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
  }
  
  .captcha-container {
    flex-wrap: nowrap;
    background-color: #f8f9fa !important;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .php-email-form {
    padding: 30px;
    background: #fff !important;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .iti__flag {
    background-image: url("../vendor/intl-tel-input/flags@2x.png");
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .form-control {
    min-height: 44px; /* Better touch targets */
    background-color: #fff !important;
    color: #495057 !important;
  }
  
  button[type="submit"] {
    min-height: 48px;
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white !important;
  }
  
  .remove-file {
    min-width: 44px;
    min-height: 44px;
  }
  
  #refresh-captcha {
    min-height: 44px;
    min-width: 44px;
    background: white !important;
    color: #495057 !important;
  }
}

/* Force light theme for form */
.php-email-form,
.php-email-form * {
  background-color: #fff !important;
  color: #495057 !important;
}

.php-email-form .form-control,
.php-email-form .form-control:focus,
.php-email-form .form-control:active {
  background-color: #fff !important;
  color: #495057 !important;
}

.php-email-form .captcha-container {
  background-color: #f8f9fa !important;
}

.php-email-form .form-security-info {
  background-color: #e8f5e8 !important;
  color: #155724 !important;
}

.php-email-form button[type="submit"] {
  background: linear-gradient(135deg, #007bff, #0056b3) !important;
  color: white !important;
}

/* Dark mode override - force light theme for form */
@media (prefers-color-scheme: dark) {
  .php-email-form {
    background: #fff !important;
    color: #495057 !important;
  }
  
  .php-email-form .form-control {
    background: #fff !important;
    border-color: #e9ecef !important;
    color: #495057 !important;
  }
  
  .php-email-form .form-control:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background: #fff !important;
    color: #495057 !important;
  }
  
  .php-email-form .captcha-container {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
  }
  
  .php-email-form .form-security-info {
    background-color: #e8f5e8 !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
  }
  
  .php-email-form .iti__selected-flag {
    background: #f8f9fa !important;
    border-color: #e9ecef !important;
  }
  
  .php-email-form .iti input[type="tel"] {
    background-color: #fff !important;
    color: #495057 !important;
    border-color: #e9ecef !important;
  }
  
  .php-email-form .iti__country-list {
    background: #fff !important;
  }
  
  .php-email-form .iti__country {
    background: #fff !important;
    color: #495057 !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .php-email-form {
    box-shadow: none;
    border: 1px solid #000;
    background: #fff !important;
  }
  
  button[type="submit"],
  .loading,
  .auto-save-indicator {
    display: none !important;
  }
}


/* Mobile header adjustments for language selector */
@media (max-width: 991px) {
  #header .language-selector {
    position: static;
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  #header .language-selector select,
  #header .language-selector button {
    width: auto;
  }
}
