/**
 * HostMap Contact Form Styles
 * Minimal styles that inherit theme typography (Changa font)
 */

/* Form Wrapper */
.hostmap-contact-form-wrapper {
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}

/* Form */
.hostmap-contact-form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Honeypot - hidden spam trap */
.hostmap-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Form Rows */
.hostmap-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

@media (max-width: 768px) {
  .hostmap-form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Form Fields */
.hostmap-form-field {
  margin-bottom: 20px;
  box-sizing: border-box;
  max-width: 100%;
}

.hostmap-form-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: inherit;
}

.hostmap-form-field .required {
  color: #d63638;
  margin-left: 2px;
}

.hostmap-form-field input[type="text"],
.hostmap-form-field input[type="email"],
.hostmap-form-field input[type="tel"] {
  width: 100%;
  max-width: 100%;
  padding: 8px 16px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
}

.hostmap-form-field textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
}

.hostmap-form-field input:focus,
.hostmap-form-field textarea:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 1px #0073aa;
}

.hostmap-form-field textarea {
  min-height: 120px;
  resize: vertical;
}

/* Error States */
.hostmap-form-field.has-error input,
.hostmap-form-field.has-error textarea {
  border-color: #d63638;
}

.hostmap-form-field.has-error input:focus,
.hostmap-form-field.has-error textarea:focus {
  border-color: #d63638;
  box-shadow: 0 0 0 1px #d63638;
}

.hostmap-error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  color: #d63638;
  font-weight: 500;
}

.hostmap-form-field.has-error .hostmap-error {
  display: block;
}

/* Messages */
.hostmap-form-messages {
  display: none;
  margin: 20px 0;
  padding: 15px;
  border-radius: 4px;
}

.hostmap-form-messages.success {
  display: block;
  background-color: #d1f0d1;
  border: 1px solid #5cb85c;
  color: #2d5016;
}

.hostmap-form-messages.error {
  display: block;
  background-color: #f8d7da;
  border: 1px solid #d63638;
  color: #721c24;
}

.hostmap-success-message,
.hostmap-error-message {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

/* Submit Button */
.hostmap-form-submit {
  margin-top: 25px;
}

.hostmap-submit-btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background-color: #0073aa;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-family: inherit;
  min-width: 160px;
}

.hostmap-submit-btn:hover:not(:disabled) {
  background-color: #005a87;
  transform: translateY(-1px);
}

.hostmap-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.hostmap-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hostmap-submit-btn .btn-loading {
  display: none;
}

/* Accessibility */
.hostmap-form-field input[aria-invalid="true"],
.hostmap-form-field textarea[aria-invalid="true"] {
  border-color: #d63638;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hostmap-contact-form-wrapper {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .hostmap-contact-form {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .hostmap-form-row {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .hostmap-form-field {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
  }

  .hostmap-form-field label {
    display: block !important;
    margin-bottom: 8px !important;
    width: 100% !important;
  }

  .hostmap-form-field input[type="text"],
  .hostmap-form-field input[type="email"],
  .hostmap-form-field input[type="tel"],
  .hostmap-form-field textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .hostmap-submit-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Ensure form doesn't break out of container */
  .hostmap-form-messages {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
