/* CONTACTO FORM (also used by presupuesto-form) */

.contacto-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-xl);
  align-items: stretch;
}

/* Form card */
.contacto-layout-form {
  padding: var(--space-xl);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.contacto-layout-form .contacto-form-fields {
  margin-top: var(--space-lg);
}

.contacto-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.presupuesto-form .contacto-form-fields {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-xl);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: var(--font-semibold);
  color: var(--color-heading);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem var(--space-md);
  background-color: var(--color-bg);
  color: var(--color-body);
  border: 1px solid var(--color-text-soft);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-field textarea {
  min-height: 8rem;
  line-height: 1.5;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: var(--color-heading);
}

/* Focus: border plus a soft ring (the global outline is replaced, not removed) */
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(209, 51, 10, 0.22);
}

/* Error: only after the person interacted with the field */
.form-field input:user-invalid,
.form-field select:user-invalid,
.form-field textarea:user-invalid {
  border-color: var(--color-error);
  background-color: #fff7f7;
}

.form-field input:user-invalid:focus-visible,
.form-field textarea:user-invalid:focus-visible {
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.22);
}

.form-submit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.form-privacy {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.form-privacy .icon {
  flex: none;
  margin-top: 0.1rem;
  color: var(--color-brand-green);
}

.contacto-form-hint {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

.contacto-form-hint a {
  color: var(--color-primary);
  font-weight: var(--font-semibold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Honeypot: hidden from people, visible to bots */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Result notices (success / error) */
.form-notice {
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid currentColor;
  border-radius: var(--radius-md);
  font-weight: var(--font-medium);
  line-height: 1.5;
}

.presupuesto-form .form-notice {
  max-width: 820px;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}

.form-notice--success {
  background-color: #dcfce7;
  color: var(--color-success);
}

.form-notice--error {
  background-color: #fee2e2;
  color: var(--color-error);
}

@media (max-width: 1024px) {
  .contacto-layout {
    grid-template-columns: 1fr;
  }
}

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

  .contacto-layout-form,
  .presupuesto-form .contacto-form-fields {
    padding: var(--space-lg);
  }
}

@media (max-width: 640px) {
  .form-submit .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .form-field input,
  .form-field select,
  .form-field textarea {
    transition: none;
  }
}
