@charset "utf-8";

/* =========================================================
   BOTONES BASE
   ========================================================= */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

button:active,
.btn:active {
  transform: translateY(1px);
}

/* =========================================================
   VARIANTES PRINCIPALES
   ========================================================= */

.btn--primary,
.btn_primary,
button,
.btn_action {
  background: var(--colorSecundario_1);
  color: #ffffff;
}

.btn--primary:hover,
.btn_primary:hover,
button:hover,
.btn_action:hover {
  background: var(--colorSecundario_2);
}

.btn--ghost {
  background: transparent;
  color: var(--colorSecundario_4);
  border: 1px solid var(--colorBase_4);
}

.btn--ghost:hover {
  background: var(--colorBase_2);
}

.btn--danger,
.btn_remove_doc,
.btn_action.danger {
  background: #ef4444;
  color: #ffffff;
}

.btn--danger:hover,
.btn_remove_doc:hover,
.btn_action.danger:hover {
  background: #dc2626;
}

.btn--secondary,
.btn_secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn--secondary:hover,
.btn_secondary:hover {
  background: #d1d5db;
}

/* =========================================================
   SELECTORES DE ARCHIVO
   ========================================================= */

.btn-file-input {
  color: #374151;
  font-size: 14px;
}

.btn-file-input::file-selector-button,
.btn-file-input::-webkit-file-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  padding: 9px 14px;
  border: 1px solid var(--colorBase_4);
  border-radius: 8px;
  background: #ffffff;
  color: var(--colorSecundario_4);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-file-input:hover::file-selector-button,
.btn-file-input:hover::-webkit-file-upload-button {
  background: var(--colorBase_2);
  border-color: var(--colorBase_4);
}

.btn-file-input:focus-visible {
  outline: 2px solid rgba(15, 157, 131, 0.25);
  outline-offset: 2px;
}

/* =========================================================
   BOTONES DE FORMULARIO
   ========================================================= */

.form_actions .btn {
  flex: 1;
  width: auto;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
}

/* =========================================================
   BOTONES DE ACCIÓN EN TABLAS
   ========================================================= */

.btn_action {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.btn_action.edit {
  background: var(--colorSecundario_2);
  color: #ffffff;
}

.btn_action.edit:hover {
  background: #1d4ed8;
}

/* =========================================================
   ENLACES CON ASPECTO DE BOTÓN
   ========================================================= */

/* Botón común para añadir elementos a una colección. */
.btn-add {
  position: static;
  width: 32px;
  height: 32px;
  min-width: 38px;
  min-height: 38px;
  flex-shrink: 0;
  border: 1px solid #c9d5dc;
  border-radius: 7px;
  background: transparent;
  color: #667985;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.btn-add:hover {
  background: #f3f7f9;
  color: #0d4f70;
}

.btn-add:focus-visible {
  outline: 2px solid #146c94;
  outline-offset: 2px;
}

.btn-add .btn-add-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: transparent;
  pointer-events: none;
}

.btn_new {
  display: inline-flex;
  text-decoration: none;
}

@media (max-width: 640px) {
  .form_actions {
    flex-direction: column;
  }

  .form_actions .btn {
    width: 100%;
  }
}
