/**
 * WPForms Custom Styling
 * Custom form field styles for Monteleva theme
 */

/* ==========================================================================
   Form Container
   ========================================================================== */

.wpforms-container {
  font-family: 'Nimbus Sans L', sans-serif !important;
}

.wpforms-form {
  position: relative;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
.wpforms-field.wpforms-field-radio.wpforms-list-inline ul {
  display: flex;
}

.wpforms-container .wpforms-field,
.wp-core-ui div.wpforms-container .wpforms-field {
  padding: 8px 0 !important;
}
/* Input Fields */
.wpforms-field input[type="text"],
.wpforms-field input[type="email"],
.wpforms-field input[type="tel"],
.wpforms-field input[type="url"],
.wpforms-field input[type="password"],
.wpforms-field input[type="search"],
.wpforms-field input[type="number"],
.wpforms-field input[type="date"],
.wpforms-field select,
.wpforms-field textarea {
  width: 100%;
  padding: 16px 8px;
  border: none;
  border-bottom: 2px solid var(--light);
  border-radius: 0;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.5;
  color: #374151;
  background-color: transparent;
  transition: all 0.3s ease;
  outline: none;
  box-shadow: none;
}

#referral-modal .wpforms-field input[type="text"],
#referral-modal .wpforms-field input[type="email"],
#referral-modal .wpforms-field input[type="tel"],
#referral-modal .wpforms-field input[type="url"],
#referral-modal .wpforms-field input[type="password"],
#referral-modal .wpforms-field input[type="search"],
#referral-modal .wpforms-field input[type="number"],
#referral-modal .wpforms-field input[type="date"],
#referral-modal .wpforms-field select,
#referral-modal .wpforms-field textarea {
  padding: 12px 8px !important;
}

/* Focus States */
.wpforms-field input[type="text"]:focus,
.wpforms-field input[type="email"]:focus,
.wpforms-field input[type="tel"]:focus,
.wpforms-field input[type="url"]:focus,
.wpforms-field input[type="password"]:focus,
.wpforms-field input[type="search"]:focus,
.wpforms-field input[type="number"]:focus,
.wpforms-field input[type="date"]:focus,
.wpforms-field select:focus,
.wpforms-field textarea:focus {
  border-bottom-color: var(--global-highlight-color, #0F4D77) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  outline: none !important;
  background-color: transparent !important;
}

/* Active/Hover States - Remove any flashing borders */
.wpforms-field input[type="text"]:active,
.wpforms-field input[type="email"]:active,
.wpforms-field input[type="tel"]:active,
.wpforms-field input[type="url"]:active,
.wpforms-field input[type="password"]:active,
.wpforms-field input[type="search"]:active,
.wpforms-field input[type="number"]:active,
.wpforms-field input[type="date"]:active,
.wpforms-field select:active,
.wpforms-field textarea:active {
  border-bottom-color: var(--global-highlight-color, #0F4D77) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  outline: none !important;
  background-color: transparent !important;
}

/* Placeholder Styling */
input::placeholder,
textarea::placeholder,
select:read-only {
  color: #9ca3af;
  opacity: 1;
  font-family: 'Nimbus Sans L', sans-serif !important;
}

/* ==========================================================================
   Field Labels
   ========================================================================== */

.wpforms-container .wpforms-field-label {
  display: none;
  font-size: 1.1em;
  margin-top: 1rem;
  font-weight: 400 !important;
}

.wpforms-required-label {
  color: #dc2626;
  margin-left: 4px;
}

/* ==========================================================================
   Field Descriptions
   ========================================================================== */

.wpforms-field-description {
  margin-top: 6px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.4;
}

/* ==========================================================================
   Specific Field Types
   ========================================================================== */

/* Textarea */
.wpforms-field textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select Dropdown */
.wpforms-field select {
  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 16px center;
  background-size: 16px;
  padding-right: 50px;
  appearance: none;
  cursor: pointer;
}

/* Checkbox and Radio Fields */
.wpforms-field-checkbox input[type="checkbox"],
.wpforms-field-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  border: 2px solid #d1d5db;
  background-color: #ffffff;
  cursor: pointer;
}

.wpforms-field-checkbox input[type="checkbox"]:checked,
.wpforms-field-radio input[type="radio"]:checked {
  background-color: var(--darker);
  border-color: var(--darker);
}

.wpforms-field-checkbox label,
.wpforms-field-radio label {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  font-weight: 400;
  cursor: pointer;
}

.wpforms-field-checkbox ul,
.wpforms-field-radio ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wpforms-field-checkbox li,
.wpforms-field-radio li {
  margin-bottom: 12px;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.wpforms-submit-container {
  margin-top: 20px;
}

.wpforms-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 32px;
  background-color: var(--darker);
  color: #ffffff;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 140px;
}

.wpforms-submit:hover {
  background-color: var(--darker);
  transform: translateY(-1px);
}

.wpforms-submit:active {
  transform: translateY(0);
}

.wpforms-submit:focus {
  outline: none;
}

/* ==========================================================================
   Error States
   ========================================================================== */

.wpforms-error .wpforms-field-label {
  color: #D63637;
}

/* Error state placeholders - match border error color */
.wpforms-container .wpforms-field input.wpforms-error::placeholder,
.wpforms-container .wpforms-field input.user-invalid::placeholder,
.wpforms-container .wpforms-field textarea.wpforms-error::placeholder,
.wpforms-container .wpforms-field textarea.user-invalid::placeholder {
  color: #D63637;
}

.wpforms-container .wpforms-field input.wpforms-error,
.wpforms-container .wpforms-field input.user-invalid,
.wpforms-container .wpforms-field textarea.wpforms-error,
.wpforms-container .wpforms-field textarea.user-invalid,
.wpforms-container .wpforms-field select.wpforms-error,
.wpforms-container .wpforms-field select.user-invalid {
  border: none !important;
  border-bottom: 2px solid #D63637 !important;
}

.wpforms-container label.wpforms-error, .wpforms-container em.wpforms-error {
  margin-top: 5px;
}

/* ==========================================================================
   Success Messages
   ========================================================================== */

.wpforms-confirmation-container-full {
  padding: 24px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.wpforms-confirmation-container-full h4 {
  color: #166534;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.wpforms-submit.wpforms-processing {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.wpforms-submit.wpforms-processing:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: wpforms-spin 1s linear infinite;
}

@keyframes wpforms-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   Theme Color Variants
   ========================================================================== */

/* Red Theme */
.wpforms-container.theme-red {
  --global-highlight-color: #813234;
  --global-highlight-color-dark: #6b2729;
}

/* Green Theme */
.wpforms-container.theme-green {
  --global-highlight-color: #909131;
  --global-highlight-color-dark: #787a29;
}

/* Blue Theme (Default) */
.wpforms-container.theme-blue {
  --global-highlight-color: #0F4D77;
  --global-highlight-color-dark: #0a3a5a;
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

.wpforms-field input:focus,
.wpforms-field select:focus,
.wpforms-field textarea:focus,
.wpforms-field input:active,
.wpforms-field select:active,
.wpforms-field textarea:active {
  outline: none !important;
  outline-offset: 0 !important;
  border: none !important;
  border-bottom: 2px solid var(--global-highlight-color, #0F4D77) !important;
}

.wpforms-submit:focus-visible {
  outline: 2px solid var(--global-highlight-color, #0F4D77);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .wpforms-field input,
  .wpforms-field select,
  .wpforms-field textarea {
    border-width: 3px;
  }

  .wpforms-submit {
    border: 3px solid var(--global-highlight-color, #0F4D77);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .wpforms-field input,
  .wpforms-field select,
  .wpforms-field textarea,
  .wpforms-submit {
    transition: none;
  }

  .wpforms-submit:hover {
    transform: none;
  }

  @keyframes wpforms-spin {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  }
}
