/* ==========================================================================
   EquiPay · Componentes reutilizables: botones, insignias, tarjetas,
   formularios, acordeón y selector de idioma.
   ========================================================================== */

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

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

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--secondary-600);
  color: var(--white);
  box-shadow: 0 8px 20px -8px rgb(15 118 110 / 0.6);
}

.btn--primary:hover {
  background: var(--secondary-700);
  color: var(--white);
}

.btn--gold {
  background: var(--tertiary-500);
  color: var(--primary-900);
  box-shadow: 0 8px 20px -8px rgb(201 162 39 / 0.6);
}

.btn--gold:hover {
  background: var(--tertiary-400);
  color: var(--primary-900);
}

.btn--ghost {
  border-color: var(--neutral-200);
  background: var(--white);
  color: var(--primary-700);
}

.btn--ghost:hover {
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.btn--outline-light {
  border-color: rgb(255 255 255 / 0.3);
  background: transparent;
  color: var(--white);
}

.btn--outline-light:hover {
  border-color: var(--white);
  background: rgb(255 255 255 / 0.06);
  color: var(--white);
}

.btn--sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.88rem;
}

.btn--lg {
  min-height: 52px;
  padding: 14px 26px;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

/* ---------- Insignias ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.4;
}

.badge--teal {
  background: var(--secondary-50);
  color: var(--secondary-700);
}

.badge--gold {
  background: var(--tertiary-50);
  color: var(--tertiary-700);
}

.badge--danger {
  background: var(--danger-50);
  color: var(--danger-600);
}

.badge--neutral {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Tarjetas ---------- */
.card {
  height: 100%;
  padding: 28px;
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}

.card--hover:hover {
  transform: translateY(-4px);
  border-color: var(--primary-100);
  box-shadow: var(--shadow);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--secondary-50);
  color: var(--secondary-600);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__icon--gold {
  background: var(--tertiary-50);
  color: var(--tertiary-600);
}

.card__icon--primary {
  background: var(--primary-50);
  color: var(--primary-700);
}

.card__title {
  font-size: 1.12rem;
  font-weight: 700;
}

.card__text {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--neutral-600);
}

.card--dark {
  border-color: rgb(171 204 210 / 0.14);
  background: rgb(255 255 255 / 0.04);
  box-shadow: none;
}

.card--dark .card__title {
  color: var(--white);
}

.card--dark .card__text {
  color: var(--primary-200);
}

.card--dark .card__icon {
  background: rgb(95 208 192 / 0.12);
  color: var(--secondary-300);
}

/* ---------- Listas con check ---------- */
.check-list li {
  position: relative;
  padding-left: 30px;
}

.check-list li + li {
  margin-top: 10px;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--secondary-50)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230F766E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.5'/%3E%3C/svg%3E")
    center / 20px no-repeat;
}

.section--dark .check-list li::before {
  background-color: rgb(95 208 192 / 0.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235FD0C0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.5'/%3E%3C/svg%3E");
}

/* ---------- Formularios ---------- */
.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--neutral-700);
}

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--white);
  font-size: 0.96rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field__input::placeholder {
  color: var(--neutral-400);
}

.field__input:hover {
  border-color: var(--neutral-300);
}

.field__input:focus {
  outline: none;
  border-color: var(--secondary-500);
  box-shadow: 0 0 0 3px rgb(20 148 136 / 0.18);
}

.field__input[aria-invalid='true'] {
  border-color: var(--danger-600);
}

textarea.field__input {
  min-height: 110px;
  resize: vertical;
}

select.field__input {
  appearance: none;
  padding-right: 40px;
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2366768A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E")
    right 12px center / 18px no-repeat;
}

.field__hint {
  font-size: 0.8rem;
  color: var(--neutral-500);
}

.field__error {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger-600);
}

.field__error:empty {
  display: none;
}

/* ---------- Acordeón (preguntas frecuentes) ---------- */
.faq {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin-inline: auto;
}

.faq__item {
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq__item[open] {
  border-color: var(--primary-100);
  box-shadow: var(--shadow-sm);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  font-weight: 700;
  color: var(--primary-700);
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: '';
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-50)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2312343B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 5v10M5 10h10'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  transition: transform 0.3s var(--ease);
}

.faq__item[open] .faq__q::after {
  transform: rotate(45deg);
}

.faq__a {
  padding: 0 24px 22px;
  color: var(--neutral-600);
}

/* ---------- Selector de idioma ---------- */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  background: var(--white);
}

.lang-switch__btn {
  min-width: 40px;
  min-height: 34px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neutral-600);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-switch__btn[aria-pressed='true'] {
  background: var(--primary-700);
  color: var(--white);
}

.lang-switch__btn:not([aria-pressed='true']):hover {
  color: var(--primary-700);
}

/* ---------- Aviso (toast) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--primary-800);
  color: var(--white);
  font-size: 0.92rem;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- Botón volver arriba ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--primary-700);
  color: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s, background 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--secondary-600);
}

.to-top svg {
  width: 20px;
  height: 20px;
}
