/**
 * Design Toolkit - Formularios Universales
 * Estilos mínimos. No incluye colores, tipografía ni espaciado
 * que WordPress o el editor permiten configurar.
 */

/* ==========================================================================
   CAMPOS DE FORMULARIO
   ========================================================================== */

.dtk-universal-form .dtk-form-field {
  margin-bottom: 1rem;
}

.dtk-universal-form .dtk-form-field label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
}

.dtk-universal-form .dtk-form-field .required {
  color: inherit;
  opacity: 0.8;
}

.dtk-universal-form input[type="text"],
.dtk-universal-form input[type="email"],
.dtk-universal-form input[type="tel"],
.dtk-universal-form input[type="number"],
.dtk-universal-form input[type="date"],
.dtk-universal-form textarea,
.dtk-universal-form select {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  box-sizing: border-box;
  font: inherit;
  opacity: 0.9;
}

.dtk-universal-form input:focus,
.dtk-universal-form textarea:focus,
.dtk-universal-form select:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  opacity: 1;
}

.dtk-universal-form textarea {
  resize: vertical;
  min-height: 4rem;
}

.dtk-universal-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='currentColor' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.dtk-universal-form .dtk-checkbox-wrapper,
.dtk-universal-form .dtk-radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dtk-universal-form .dtk-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dtk-universal-form .dtk-radio-group-label {
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   MULTI-STEP
   ========================================================================== */

.dtk-form-step {
  display: none;
}

.dtk-form-step.dtk-step-active {
  display: block;
}

.dtk-step-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

.dtk-progress-container {
  margin-bottom: 1rem;
}

.dtk-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: currentColor;
  opacity: 0.2;
}

.dtk-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease;
  background: currentColor;
  opacity: 1;
}

.dtk-progress-text {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.dtk-form-navigation,
.dtk-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   MENSAJES
   ========================================================================== */

.dtk-form-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.dtk-message-success {
  border-left: 4px solid;
}

.dtk-message-error {
  border-left: 4px solid;
  font-weight: 500;
}

/* ==========================================================================
   CALENDARIO
   ========================================================================== */

.dtk-calendario-visual {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 0.5rem;
}

.dtk-calendario-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.dtk-calendario-month-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
}

.dtk-calendario-nav {
  border: 1px solid currentColor;
  background: transparent;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  font: inherit;
  opacity: 0.8;
}

.dtk-calendario-nav:hover {
  opacity: 1;
}

.dtk-calendario-weekday {
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875em;
  opacity: 0.7;
}

.dtk-calendario-day {
  padding: 0.5rem;
  text-align: center;
  border: 1px solid currentColor;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0.5;
}

.dtk-calendario-day.available {
  opacity: 1;
  cursor: pointer;
}

.dtk-calendario-day.available:hover {
  opacity: 0.9;
}

.dtk-calendario-day.selected {
  opacity: 1;
  font-weight: 600;
}

.dtk-calendario-day.unavailable {
  cursor: not-allowed;
}

.dtk-calendario-hora {
  margin-top: 0.75rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
  .dtk-form-navigation,
  .dtk-form-actions {
    flex-direction: column-reverse;
  }

  .dtk-form-navigation .wp-block-button__link,
  .dtk-form-actions .wp-block-button__link {
    width: 100%;
    justify-content: center;
  }
}
