/* assets/css/components.css */

/* --- Botones --- */
.boton {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.boton:disabled { opacity: 0.55; cursor: not-allowed; }

.boton-primario { background: var(--signal-amber); color: var(--signal-amber-contrast); }
.boton-primario:hover:not(:disabled) { background: var(--signal-amber-dark); }

.boton-secundario { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.boton-secundario:hover:not(:disabled) { background: var(--paper); border-color: var(--ink-muted); }

.boton-peligro { background: var(--danger); color: white; }
.boton-peligro:hover:not(:disabled) { background: #A6392F; }

.boton-texto { background: none; border: none; color: var(--signal-amber-dark); font-weight: 600; padding: var(--space-2); cursor: pointer; }
.boton-texto:hover:not(:disabled) { text-decoration: underline; }

/* --- Formularios --- */
.campo { margin-bottom: var(--space-4); }
.campo label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }

.campo input:not([type="checkbox"]):not([type="radio"]),
.campo select,
.campo textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  padding: var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink);
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--signal-amber); }

.campo .error-campo { color: var(--danger); font-size: var(--text-xs); margin-top: var(--space-1); }
.campo input.con-error, .campo select.con-error { border-color: var(--danger); }

/* --- Modal --- */
.modal-fondo {
  position: fixed;
  inset: 0;
  background: rgba(28, 33, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-4);
}

.modal-panel {
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-sm { max-width: 380px; }
.modal-md { max-width: 480px; }
.modal-lg { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
}
.modal-header h3 { margin: 0; font-size: var(--text-lg); }

.modal-cerrar {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
}
.modal-cerrar:hover { color: var(--ink); }

.modal-cuerpo {
  padding: var(--space-5);
  overflow-y: auto;
}

.modal-acciones {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line);
}

/* --- Toasts --- */
#contenedor-toasts {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 360px;
}

.toast {
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-panel);
  border-left: 4px solid transparent;
}
.toast-exito { background: var(--success-bg); color: var(--success); border-left-color: var(--success); }
.toast-error { background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }

/* --- Etiqueta de estado --- */
.etiqueta-estado { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600; }
.etiqueta-estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-estado, var(--ink-muted)); }
