/**
 * HlForms — Estilos de formularios custom
 * Reemplazo de Bootstrap form-control, form-select, etc.
 * Scope: .hl-form (envolver el form en esta clase)
 * v7.0.0
 */

.hl-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
  line-height: 1.5;
}

.hl-form input[type="text"],
.hl-form input[type="email"],
.hl-form input[type="number"],
.hl-form input[type="date"],
.hl-form input[type="time"],
.hl-form input[type="tel"],
.hl-form input[type="password"],
.hl-form input[type="search"],
.hl-form input[type="url"],
.hl-form select,
.hl-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.4375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #fff;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.hl-form select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
}

.hl-form input:focus,
.hl-form select:focus,
.hl-form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hl-form input:disabled,
.hl-form select:disabled,
.hl-form textarea:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.hl-form input::placeholder,
.hl-form textarea::placeholder {
  color: #9ca3af;
}

/* Input pequeño (equivale a form-control-sm) */
.hl-form .hl-input-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

/* Switch toggle (reemplazo de form-check form-switch) */
.hl-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.hl-switch input[type="checkbox"] {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  appearance: none;
  -webkit-appearance: none;
  background: #d1d5db;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.hl-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.hl-switch input[type="checkbox"]:checked {
  background: #2563eb;
}

.hl-switch input[type="checkbox"]:checked::after {
  transform: translateX(1.125rem);
}

.hl-switch span {
  font-size: 0.875rem;
  color: #374151;
}

/* Grid de formulario — mobile-first (reemplazo de row g-3) */
.hl-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}

@media (min-width: 768px) {
  .hl-form-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    row-gap: 1.25rem;
  }
}

.hl-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.25rem;
}

/* Span columnas */
.hl-col-full { grid-column: 1 / -1; }

/* Utility: compatibilidad con toggles JS existentes (d-none) */
.d-none { display: none !important; }
