/* legal-notice.css
   Banner legal de privacidad + Panel de Ayuda + compactación de Ajustes en smartphone.
   Usa variables CSS de los skins (css/themes.css) y respeta modo claro/oscuro. */

/* ═══════════ BANNER LEGAL (primera visita) ═══════════ */
#legalNoticeBanner {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  animation: legalFadeIn 0.25s ease;
  padding: 0;
}
@keyframes legalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.legal-notice-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 14px auto;
  background: var(--panel-bg, #fffdf7);
  color: var(--text-color, #333);
  border-radius: 16px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  animation: legalSlideUp 0.3s ease;
}
@keyframes legalSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.legal-notice-icon { font-size: 26px; line-height: 1; margin-top: 2px; }
.legal-notice-icon img { width: 30px; height: 30px; margin-top: 2px; }

.legal-notice-body { flex: 1; min-width: 0; }
.legal-notice-body strong { font-size: 0.95rem; display: block; margin-bottom: 4px; }
.legal-notice-body p { font-size: 0.8rem; line-height: 1.45; margin: 0 0 10px 0; opacity: 0.9; }

.legal-notice-actions { display: flex; gap: 8px; justify-content: flex-end; }
.legal-notice-actions button {
  border: none; border-radius: 20px; padding: 7px 14px;
  font-size: 0.78rem; cursor: pointer; font-weight: 600;
}
.legal-notice-more {
  background: transparent; color: var(--accent-color, #8a6d3b);
  text-decoration: underline;
}
.legal-notice-ok {
  background: var(--accent-color, #8a6d3b); color: #fff;
}
.legal-notice-close {
  position: absolute; top: 6px; right: 10px;
  background: none; border: none; font-size: 1.1rem;
  cursor: pointer; color: var(--text-color, #333); opacity: 0.5;
}
.legal-notice-close:hover { opacity: 1; }

/* Escritorio: tarjeta flotante en esquina inferior derecha */
@media (min-width: 1180px) {
  #legalNoticeBanner { align-items: flex-end; justify-content: flex-end; padding: 20px; background: transparent; pointer-events: none; }
  .legal-notice-card { margin: 0; max-width: 420px; pointer-events: auto; }
}
/* BANNER_END */

/* ═══════════ PANEL DE AYUDA ═══════════ */
#helpPanelOverlay {
  position: fixed; inset: 0; z-index: 99995;
  background: rgba(0, 0, 0, 0.45);
  display: none; align-items: center; justify-content: center;
}
#helpPanelOverlay.show { display: flex; animation: legalFadeIn 0.2s ease; }

.help-panel {
  display: flex; flex-direction: column;
  width: min(560px, 100%); height: min(82vh, 780px);
  background: var(--panel-bg, #fffdf7);
  color: var(--text-color, #333);
  border-radius: 18px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.help-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.08));
}
.help-panel-header h3 {
  margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px;
}
.help-header-icon { width: 18px; height: 18px; }
.help-panel-close {
  background: none; border: none; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--text-color, #333); opacity: 0.6; padding: 0 4px;
}
.help-panel-close:hover { opacity: 1; }

.help-panel-body { flex: 1; overflow-y: auto; padding: 10px 12px 20px 12px; }
/* HELP_CSS_B */

/* Secciones (acordeón) */
.help-section {
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  border-radius: 12px; margin-bottom: 8px; overflow: hidden;
  background: var(--card-bg, rgba(255,255,255,0.5));
}
.help-section-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--text-color, #333); font-size: 0.88rem; font-weight: 600;
}
.help-section-icon { display: inline-flex; width: 22px; height: 22px; }
.help-section-icon img { width: 22px; height: 22px; object-fit: contain; }
.help-section-title { flex: 1; }
.help-section-arrow { font-size: 0.8rem; opacity: 0.5; transition: transform 0.2s; }
.help-section.open .help-section-arrow { transform: rotate(180deg); }

.help-section-content { padding: 2px 12px 10px 44px; }

.help-item { padding: 8px 0; border-top: 1px dashed var(--border-color, rgba(0,0,0,0.08)); }
.help-item:first-child { border-top: none; }
.help-item-title { font-size: 0.82rem; font-weight: 700; margin-bottom: 2px; }
.help-item-desc { font-size: 0.78rem; line-height: 1.5; opacity: 0.85; }

/* Privacidad (texto legal) */
.hl-privacy-body h4 { margin: 8px 0 6px 0; font-size: 0.88rem; }
.hl-privacy-body h5 { margin: 12px 0 4px 0; font-size: 0.8rem; }
.hl-privacy-body p, .hl-privacy-body li { font-size: 0.76rem; line-height: 1.55; opacity: 0.9; margin: 4px 0; }
.hl-privacy-body ul { padding-left: 18px; margin: 4px 0; }
.hl-privacy-date { margin-top: 14px !important; font-style: italic; opacity: 0.6 !important; }

/* Móvil: panel a pantalla casi completa (bottom sheet) */
@media (max-width: 1179px) {
  #helpPanelOverlay { align-items: flex-end; }
  .help-panel {
    width: 100%; height: 88vh; max-height: none;
    border-radius: 18px 18px 0 0;
  }
}
/* HELP_CSS_C */

/* ═══════════ BOTÓN ❓ EN HEADER DE AJUSTES ═══════════ */
.settings-header-actions { display: flex; align-items: center; gap: 6px; }
.help-settings-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.95rem; line-height: 1; padding: 4px 6px;
  opacity: 0.7; color: inherit;
}
.help-settings-btn:hover { opacity: 1; transform: scale(1.1); }

/* Filas de enlace (Ayuda / Privacidad) en Ajustes */
.settings-link-row { cursor: pointer; user-select: none; }
.settings-link-row:hover { background: var(--hover-bg, rgba(0,0,0,0.04)); }
.settings-link-icon { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.settings-link-arrow { margin-left: auto; opacity: 0.4; font-size: 1rem; }

/* ═══════════ COMPACTACIÓN DE AJUSTES EN SMARTPHONE ═══════════ */
@media (max-width: 1179px) {
  .settings-panel { font-size: 0.85rem; }
  .settings-panel .settings-panel-header h3 { font-size: 0.95rem; }
  .settings-lang-flags { gap: 4px; }
  .lang-flag-btn { width: 20px; height: 20px; }
  .settings-item {
    padding: 8px 10px;
    min-height: 38px;
    gap: 10px;
  }
  .settings-item > span:first-child,
  .settings-item > label:first-child { font-size: 0.82rem; }
  /* Switches más pequeños */
  .settings-item .switch { transform: scale(0.85); }
  /* Selector de temas dentro del acordeón */
  .settings-item.skin-item { flex-direction: column; align-items: flex-start; }
  .settings-item.skin-item .skin-selector {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
  }
  .skin-option { display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .skin-label { font-size: 0.62rem; }
}

/* ═══════════ MODAL DE ONBOARDING & GUÍA PWA ═══════════ */
#onboardingOverlay, #pwaGuideOverlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: legalFadeIn 0.25s ease;
}

.onboarding-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: var(--panel-bg, #fffdf7);
  color: var(--text-color, #333);
  border-radius: 20px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.12));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: legalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.08));
  background: var(--card-bg, rgba(0,0,0,0.02));
}

.onboarding-header-icon {
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.onboarding-header-text h3 {
  margin: 0 0 2px 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent-color, #8a6d3b);
}

.onboarding-header-text p {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.8;
  line-height: 1.35;
}

.onboarding-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-color, #333);
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 4px;
}
.onboarding-close-btn:hover { opacity: 1; }

.onboarding-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-privacy-box {
  background: rgba(138, 109, 59, 0.08);
  border: 1px solid rgba(138, 109, 59, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-color, #333);
}

.onboarding-section {
  background: var(--card-bg, rgba(0,0,0,0.02));
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.onboarding-section-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0.85;
}

.onboarding-os-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.onboarding-os-picker label {
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.85;
}

.onboarding-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.18));
  background: var(--panel-bg, #fff);
  color: var(--text-color, #333);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.onboarding-select:focus {
  border-color: var(--accent-color, #8a6d3b);
  box-shadow: 0 0 0 2px rgba(138, 109, 59, 0.2);
}

.pwa-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.pwa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.pwa-step-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-color, #8a6d3b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pwa-native-install-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.pwa-native-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Indicador de pasos del Wizard */
.onboarding-wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 0 16px;
}
.onboarding-step-dot {
  width: 24px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-color, rgba(0,0,0,0.12));
  transition: all 0.3s ease;
}
.onboarding-step-dot.active {
  background: var(--accent-color, #8a6d3b);
  width: 38px;
}
.onboarding-step-dot.done {
  background: #10b981;
}

/* Selector de idioma (Paso 1) */
.onboarding-lang-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}
.onboarding-lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.15));
  background: var(--panel-bg, #fff);
  color: var(--text-color, #333);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.onboarding-lang-option:hover {
  border-color: var(--accent-color, #8a6d3b);
  background: rgba(138, 109, 59, 0.05);
}
.onboarding-lang-option.selected {
  border-color: var(--accent-color, #8a6d3b);
  background: rgba(138, 109, 59, 0.1);
  color: var(--accent-color, #8a6d3b);
}

/* Tabs de Autenticación (Paso 3) */
.onboarding-auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.12));
  margin-bottom: 8px;
}
.onboarding-auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-color, #333);
  opacity: 0.6;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.onboarding-auth-tab.active {
  opacity: 1;
  color: var(--accent-color, #8a6d3b);
  border-bottom-color: var(--accent-color, #8a6d3b);
}

/* Campos de Formulario */
.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.onboarding-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onboarding-field label {
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0.8;
}
.onboarding-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.18));
  background: var(--panel-bg, #fff);
  color: var(--text-color, #333);
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}
.onboarding-input:focus {
  border-color: var(--accent-color, #8a6d3b);
  box-shadow: 0 0 0 2px rgba(138, 109, 59, 0.15);
}

.onboarding-error-msg {
  color: #dc2626;
  font-size: 0.78rem;
  line-height: 1.35;
  background: rgba(220, 38, 38, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
}

.onboarding-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #374151;
  border: 1px solid rgba(0,0,0,0.16);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.15s, border-color 0.15s;
}
.onboarding-btn-google:hover {
  background: #f9fafb;
  border-color: rgba(0,0,0,0.25);
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.onboarding-btn-login {
  background: var(--accent-color, #8a6d3b);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.2s, transform 0.1s;
}
.onboarding-btn-login:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.onboarding-btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.onboarding-btn-skip {
  background: transparent;
  color: var(--text-color, #333);
  border: 1px solid var(--border-color, rgba(0,0,0,0.15));
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
  transition: background 0.2s, opacity 0.2s;
}
.onboarding-btn-skip:hover {
  background: rgba(0,0,0,0.04);
  opacity: 1;
}

/* Advertencia Invitado (Saltar Login) */
.onboarding-guest-warning {
  background: rgba(234, 179, 8, 0.09);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: legalSlideUp 0.25s ease;
}

.guest-warning-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guest-restricted-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.guest-restricted-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.guest-active-features {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-color, #333);
}
.guest-active-features p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.guest-active-features small { display: block; margin-top: 4px; opacity: 0.85; }

.guest-warning-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.guest-warning-actions button { flex: 1; }

.onboarding-btn-guest-confirm {
  background: rgba(0,0,0,0.06);
  color: var(--text-color, #333);
  border: 1px solid var(--border-color, rgba(0,0,0,0.2));
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.onboarding-btn-guest-confirm:hover {
  background: rgba(0,0,0,0.1);
}

@media (max-width: 480px) {
  .guest-warning-actions { flex-direction: column; }
}
