/* ── Selector de idioma (dropdown con banderas) ── */
.lang-dd { position: relative; display: inline-block }
.lang-dd-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-overlay); border: 1px solid var(--border-light);
  color: var(--text-primary); cursor: pointer;
  padding: 5px 9px; border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 700; line-height: 1;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.lang-dd-trigger:hover { background: var(--border-light) }
.lang-dd-caret { font-size: .7rem; opacity: .6 }
.lang-dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 200;
  display: none; flex-direction: column; min-width: 150px; padding: 5px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
.lang-dd.open .lang-dd-menu { display: flex }
/* En el menú móvil (footer abajo) el dropdown abre hacia arriba */
.mobile-nav-footer .lang-dd-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto }
.lang-dd-opt {
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: none; cursor: pointer; text-align: left;
  color: var(--text-secondary); font-size: .88rem; font-weight: 500;
  padding: 9px 10px; border-radius: var(--radius-sm); white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-dd-opt:hover  { background: var(--bg-overlay); color: var(--text-primary) }
.lang-dd-opt.active { background: var(--brand-green); color: #fff }
.lang-flag { font-size: 1.1rem; line-height: 1 }
.lang-flag img.emoji { height: 1.1em; width: 1.1em; vertical-align: -.15em }

/* ── Twemoji: emoji/banderas como imágenes (consistente en Android/iOS/PC) ── */
img.emoji {
  height: 1em; width: 1em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
  display: inline-block;
}

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 18px; border: none; border-radius: var(--radius-full);
  font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.btn:active { transform: scale(.97) }
.btn:disabled { opacity: .45; cursor: not-allowed }
.btn-primary   { background: var(--brand-green); color: #fff }
.btn-primary:hover:not(:disabled) { background: #6348C9 }
.btn-secondary { background: var(--bg-overlay); color: var(--text-primary); border: 1px solid var(--border-light) }
.btn-secondary:hover:not(:disabled) { background: var(--border-light) }
.btn-ghost     { background: transparent; color: var(--text-secondary) }
.btn-ghost:hover:not(:disabled) { background: var(--bg-overlay); color: var(--text-primary) }
.btn-danger    { background: var(--brand-red); color: #fff }
.btn-danger:hover:not(:disabled) { background: #c93b3a }

/* ── Zona de peligro (perfil) ── */
.danger-zone {
  margin-top: 28px; padding: 18px 20px;
  border: 1px solid rgba(226,75,74,.35); border-radius: var(--radius-md, 14px);
  background: rgba(226,75,74,.06);
}
.danger-zone h3 { color: var(--brand-red); font-size: 1rem; margin-bottom: 14px }
.danger-row {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 12px 0; border-top: 1px solid rgba(226,75,74,.15);
}
.danger-row:first-of-type { border-top: 0 }
.danger-text { flex: 1; min-width: 0 }
.danger-text strong { display: block; font-size: .92rem; margin-bottom: 2px }
.danger-text p { font-size: .8rem; color: var(--text-secondary); line-height: 1.45 }
.danger-row .btn { flex-shrink: 0 }
@media (max-width: 480px) {
  .danger-row { flex-direction: column; align-items: stretch }
  .danger-row .btn { width: 100% }
}
.btn-full      { width: 100% }
.btn-sm        { min-height: 32px; padding: 5px 12px; font-size: .82rem }
.btn-icon      { min-height: 36px; width: 36px; padding: 0; border-radius: var(--radius-full) }
.btn-whatsapp  { background: #25D366; color: #fff }
.btn-whatsapp:hover:not(:disabled) { background: #1ebe5d }

/* ── Cards ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}

/* ── Forms ── */
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary) }
.form-input, .form-select {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--bg-subtle); border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md); font-size: .95rem; transition: border-color var(--t-fast);
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--brand-green); box-shadow: 0 0 0 3px rgba(124,92,230,.18);
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: .78rem; font-weight: 600;
}
.badge-success { background: rgba(124,92,230,.15); color: var(--brand-green) }
.badge-warning { background: rgba(239,159,39,.15);  color: var(--brand-amber) }
.badge-danger  { background: rgba(226,75,74,.15);   color: var(--brand-red) }
.badge-info    { background: rgba(55,138,221,.15);  color: var(--brand-blue) }

/* ── Progress bar ── */
.progress-bar  { height: 6px; background: var(--border-light); border-radius: var(--radius-full); overflow: hidden }
.progress-fill { height: 100%; background: var(--brand-green); border-radius: var(--radius-full); transition: width .6s ease }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: .875rem; border-left: 3px solid }
.alert-danger  { background: rgba(226,75,74,.1);  color: var(--brand-red);  border-color: var(--brand-red) }
.alert-success { background: rgba(124,92,230,.1); color: var(--brand-green); border-color: var(--brand-green) }
.alert-info    { background: rgba(55,138,221,.1); color: var(--brand-blue);  border-color: var(--brand-blue) }

/* ── Spinner ── */
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border-light); border-top-color: var(--brand-green);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ── Toasts ── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px }
.toast {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: 12px 18px; font-size: .875rem; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateX(16px); transition: opacity var(--t-base), transform var(--t-base);
  max-width: 320px;
}
.toast-show { opacity: 1; transform: translateX(0) }
.toast-success { border-left: 3px solid var(--brand-green) }
.toast-error   { border-left: 3px solid var(--brand-red) }
.toast-info    { border-left: 3px solid var(--brand-blue) }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-secondary) }
.empty-state > div { font-size: 3rem; margin-bottom: 12px }

/* ── Loading ── */
.loading-center { display: flex; justify-content: center; padding: 60px 0 }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}
.modal-overlay.open { opacity: 1; visibility: visible }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); padding: 28px 32px;
  width: 100%; max-width: 480px;
  transform: translateY(14px);
  transition: transform var(--t-base);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal-box { transform: none }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.modal-title { font-size: 1.1rem; font-weight: 700 }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--text-tertiary);
  padding: 2px 8px; border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--bg-overlay); color: var(--text-primary) }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px }
