/* ==========================================================================
   PAYWALL & CONTROL DE ACCESO (MODO DEMO, BLOQUEO Y PANEL ADMIN)
   ========================================================================== */

/* Badge de Estado en la Barra Superior (Modo Icono Compacto) */
.license-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.license-status-badge i {
  width: 17px;
  height: 17px;
}

.license-status-badge.demo {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.license-status-badge.demo:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--danger-text);
  transform: translateY(-1px);
}

.license-status-badge.unlocked {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-border);
  color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.license-status-badge.unlocked:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

/* Candado en la lista lateral */
.topic-tree-item.locked {
  opacity: 0.75;
}

.topic-lock-icon {
  width: 13px;
  height: 13px;
  color: var(--danger-text);
  flex-shrink: 0;
  margin-left: 4px;
}

/* TARJETA DE PAYWALL (BLOQUEO DE CONTENIDO) */
.paywall-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 44px) clamp(16px, 4vw, 32px);
  max-width: min(680px, 92%);
  margin: 24px auto;
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fadeInPaywall 0.3s ease-out;
}

.paywall-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-primary), #fbbf24, var(--gold-primary));
}

@keyframes fadeInPaywall {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.paywall-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--gold-primary);
}

.paywall-icon-wrap i {
  width: 26px;
  height: 26px;
}

.paywall-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 8px;
}

.paywall-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.paywall-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: var(--bg-surface-elevated);
  padding: 18px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  margin-bottom: 28px;
}

.paywall-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.paywall-feature-item i {
  color: var(--gold-primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Formulario de Activación de Código */
.paywall-activation-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.activation-input-row {
  display: flex;
  gap: 8px;
}

.activation-input-row input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.activation-input-row input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.btn-whatsapp-buy,
.btn-instagram-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: var(--transition-fast);
  width: 100%;
  box-shadow: 0 4px 15px rgba(220, 39, 67, 0.25);
}

.btn-whatsapp-buy:hover,
.btn-instagram-buy:hover {
  background: linear-gradient(45deg, #e08322 0%, #d5572b 25%, #cb1632 50%, #bb1255 75%, #ab0777 100%);
  transform: translateY(-1px);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(220, 39, 67, 0.4);
}

/* ==========================================================================
   PANEL DE ADMINISTRADOR (GENERADOR DE LICENCIAS)
   ========================================================================== */
.admin-codes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.85rem;
}

.admin-codes-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 2px solid var(--border-subtle);
  color: var(--gold-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.admin-codes-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.code-pill {
  font-family: var(--font-mono);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--gold-primary);
  font-weight: 600;
}

.btn-copy-code {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition-fast);
}

.btn-copy-code:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--gold-primary);
}

/* Estados de Códigos: Pendiente vs Entregado (Prompt 028) */
.code-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.code-status-badge:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.badge-pendiente {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-entregado {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.badge-neutral {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

/* Pestañas y Badges del Panel de Administrador (v7.67, PROMPT 056) */
.admin-nav-tab-btn {
  transition: all var(--transition-fast, 0.15s ease);
}
.admin-nav-tab-btn:hover:not(.active) {
  background: var(--bg-surface-hover) !important;
  color: var(--text-main) !important;
}
.admin-nav-tab-btn.active {
  border-color: var(--gold-primary) !important;
  background: rgba(217, 119, 6, 0.15) !important;
  color: var(--gold-primary) !important;
}
.account-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.account-badge-demo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   MODAL DE ACTIVACIÓN EN 2 PASOS (GOOGLE AUTH -> CONVALIDACIÓN DEMO)
   ========================================================================== */

.unlock-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.unlock-step-indicator .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.unlock-step-indicator .step-num.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #0f172a;
}

.unlock-step-indicator .step-num.completed {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.unlock-step-info-card {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.unlock-step-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.unlock-step-info-header i {
  width: 18px;
  height: 18px;
}

.unlock-step-info-text {
  font-size: 0.83rem;
  color: var(--text-main);
  line-height: 1.5;
  margin: 0;
}

.modal-google-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
  min-height: 44px;
}

/* Formulario de Registro / Login con Correo y Contraseña */
.auth-credentials-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 16px 0;
  text-align: left;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: var(--gold-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
  background: var(--bg-surface);
}

.password-policy-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  margin-top: 4px;
  color: var(--text-muted);
}

.policy-rule {
  transition: color 0.2s ease;
}

.policy-rule.valid {
  color: var(--success-text);
  font-weight: 600;
}

.password-match-hint {
  font-size: 0.74rem;
  margin-top: 4px;
}

.password-match-hint.valid {
  color: var(--success-text);
  font-weight: 600;
}

.password-match-hint.invalid {
  color: var(--danger-text);
  font-weight: 600;
}

/* Aviso de Expiración Automática en 48 Horas (Versión Demo) */
.demo-expiry-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(212, 160, 23, 0.08);
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: var(--radius-sm);
  color: var(--gold-light, #fbbf24);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.demo-expiry-notice i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--gold-primary, #d4a017);
}

.demo-expiry-notice strong {
  color: #fff;
}

.auth-error-alert {
  padding: 9px 12px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  color: var(--danger-text);
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.4;
  animation: fadeInPaywall 0.2s ease-out;
}

.auth-submit-btn {
  width: 100%;
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-toggle-row {
  text-align: center;
  margin-top: 4px;
}

.link-toggle-auth {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.link-toggle-auth:hover {
  color: #fbbf24;
}

.unlock-step-preview-disabled {
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  opacity: 0.65;
  margin-top: 16px;
}

.unlock-step-preview-disabled .preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.unlock-step-preview-disabled .preview-header i {
  width: 14px;
  height: 14px;
}

.unlock-step-preview-disabled .preview-text {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Tarjeta de Usuario Conectado (Identidad Gmail) */
.unlock-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.unlock-user-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.unlock-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  flex-shrink: 0;
}

.unlock-user-avatar-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(212, 160, 23, 0.15);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--gold-primary);
}

.unlock-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.unlock-user-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unlock-user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-demo-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.badge-demo-status i {
  width: 13px;
  height: 13px;
}

.badge-active-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--gold-glow);
}

.badge-active-status i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   RESPONSIVO MÓVIL Y ACCESIBILIDAD TÁCTIL (PAYWALL Y MODAL DE ACTIVACIÓN)
   ========================================================================== */
@media (max-width: 768px) {
  .license-status-badge {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  #unlock-modal .modal-dialog {
    max-width: 100%;
    margin: 0;
  }

  #unlock-modal .modal-body {
    padding: 16px 14px !important;
  }

  .unlock-step-info-card {
    padding: 12px 14px;
  }

  .unlock-user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .auth-input {
    font-size: 16px; /* Previene auto-zoom molesto en iOS Safari */
    height: 44px;
  }

  .link-toggle-auth {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
  }

  .auth-submit-btn {
    min-height: 46px;
    height: 46px;
    font-size: 0.95rem;
  }
}

