/**
 * Safari-specific fixes for registration form
 * Ensures compatibility with Safari on macOS and iOS
 */

/* Registration Hero Section - Safari Compatible */
.registration-hero {
  background: -webkit-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: -moz-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: -o-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: linear-gradient(135deg, #FF6A00 0%, #FF8C3A 100%);
  padding: 60px 0;
  margin-bottom: 50px;
}

/* Flexbox fixes for Safari */
.section-header {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

/* Button gradient with Safari prefix */
.btn-submit {
  background: -webkit-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: -moz-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: -o-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: linear-gradient(135deg, #FF6A00 0%, #FF8C3A 100%);
  border: none;
  -webkit-border-radius: 12px;
  -moz-border-radius: 12px;
  border-radius: 12px;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
  -moz-box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
  box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
}

.btn-submit:hover {
  background: -webkit-linear-gradient(315deg, #E66000 0%, #FF7A2A 100%);
  background: -moz-linear-gradient(315deg, #E66000 0%, #FF7A2A 100%);
  background: -o-linear-gradient(315deg, #E66000 0%, #FF7A2A 100%);
  background: linear-gradient(135deg, #E66000 0%, #FF7A2A 100%);
  -webkit-transform: translateY(-2px);
  -moz-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  -o-transform: translateY(-2px);
  transform: translateY(-2px);
  -webkit-box-shadow: 0 6px 20px rgba(255, 106, 0, 0.4);
  -moz-box-shadow: 0 6px 20px rgba(255, 106, 0, 0.4);
  box-shadow: 0 6px 20px rgba(255, 106, 0, 0.4);
  color: #ffffff;
}

.btn-submit:active {
  -webkit-transform: translateY(0);
  -moz-transform: translateY(0);
  -ms-transform: translateY(0);
  -o-transform: translateY(0);
  transform: translateY(0);
}

/* Form section styling */
.form-section {
  background: #ffffff;
  -webkit-border-radius: 16px;
  -moz-border-radius: 16px;
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 30px;
  -webkit-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  -moz-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Form controls for Safari */
.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: 'Noto Sans Thai', sans-serif;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #FF6A00;
  -webkit-box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
  -moz-box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

/* Custom checkbox/radio for Safari */
.custom-control-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Info box */
.info-box {
  background: #fff3e6;
  border-left: 4px solid #FF6A00;
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 30px;
  -webkit-box-shadow: 0 2px 8px rgba(255, 106, 0, 0.1);
  -moz-box-shadow: 0 2px 8px rgba(255, 106, 0, 0.1);
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.1);
}

/* Section icon */
.section-icon {
  width: 50px;
  height: 50px;
  background: -webkit-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: -moz-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: -o-linear-gradient(315deg, #FF6A00 0%, #FF8C3A 100%);
  background: linear-gradient(135deg, #FF6A00 0%, #FF8C3A 100%);
  -webkit-border-radius: 12px;
  -moz-border-radius: 12px;
  border-radius: 12px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -moz-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -moz-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-right: 15px;
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* Safari date input fix */
input[type="date"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
}

/* Safari select fix */
select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Responsive fixes for Safari iOS */
@media (max-width: 576px) {
  .registration-hero {
    padding: 40px 15px;
    margin-bottom: 30px;
  }

  .form-section {
    padding: 20px 15px;
    margin-bottom: 20px;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
  }

  .btn-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .section-header {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-orient: horizontal;
    -moz-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
  }
}

/* Fix for Safari iOS zoom on input focus */
@media (max-width: 767px) {
  input[type="text"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Safari-specific media query */
@supports (-webkit-appearance: none) {
  .form-control {
    font-size: 16px;
  }

  input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.8;
  }

  input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
  }
}

/* Prevent iOS Safari from zooming */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select,
  textarea,
  input {
    font-size: 16px !important;
  }
}
