/* Custom overrides on top of Tailwind */
html { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

textarea { font-family: inherit; }

.preview-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

/* Subtle focus ring */
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; transition: background-color 0.15s, opacity 0.15s; cursor: pointer; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover:not(:disabled):not(.is-disabled) { background: #1d4ed8; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-secondary:hover:not(:disabled):not(.is-disabled) { background: #cbd5e1; }
.btn-ghost { background: transparent; color: #475569; }
.btn-ghost:hover:not(:disabled):not(.is-disabled) { background: #f1f5f9; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover:not(:disabled):not(.is-disabled) { background: #fecaca; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover:not(:disabled):not(.is-disabled) { background: #059669; }

/* Estado disabled — força visual mesmo com classes de cor sobrepondo */
.btn:disabled, .btn.is-disabled,
button:disabled, button.is-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.3);
}

/* ========== LOADER BONITO (HoskenEdu) ========== */
.hk-loader-popup {
  background: linear-gradient(135deg, #1e293b 0%, #312e81 50%, #1e293b 100%) !important;
  border-radius: 1.5rem !important;
  padding: 3rem 3rem 2.5rem !important;
  box-shadow: 0 25px 80px -20px rgba(99, 102, 241, 0.5) !important;
  overflow: hidden;
  position: relative;
}
.hk-loader-popup::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.3), transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.25), transparent 50%);
  pointer-events: none;
}
.hk-loader { position: relative; z-index: 1; text-align: center; }

/* Órbitas girando ao redor do ícone */
.hk-loader-orbit {
  position: relative;
  width: 140px; height: 140px;
  margin: 0 auto 1.75rem;
}
.hk-loader-orbit::before,
.hk-loader-orbit::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #818cf8;
  border-right-color: rgba(129, 140, 248, 0.4);
  animation: hk-orbit 1.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}
.hk-loader-orbit::after {
  inset: 16px;
  border-top-color: transparent;
  border-bottom-color: #c084fc;
  border-left-color: rgba(192, 132, 252, 0.4);
  animation-direction: reverse;
  animation-duration: 1.4s;
}
@keyframes hk-orbit { to { transform: rotate(360deg); } }

/* Disco central com ícone */
.hk-loader-disc {
  position: absolute; inset: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 10px 40px -10px rgba(139, 92, 246, 0.7),
              inset 0 -3px 12px rgba(0, 0, 0, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  animation: hk-pulse 2s ease-in-out infinite;
}
@keyframes hk-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); box-shadow: 0 15px 60px -10px rgba(139, 92, 246, 0.9), inset 0 -3px 12px rgba(0, 0, 0, 0.2); }
}

/* Textos */
.hk-loader-titulo {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}
.hk-loader-sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 1.25rem 0;
}

/* 3 dots pulsando */
.hk-loader-dots {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.hk-loader-dots span {
  width: 8px; height: 8px;
  background: #a78bfa;
  border-radius: 50%;
  animation: hk-bounce 1.4s ease-in-out infinite both;
}
.hk-loader-dots span:nth-child(2) { animation-delay: 0.18s; background: #c4b5fd; }
.hk-loader-dots span:nth-child(3) { animation-delay: 0.36s; background: #ddd6fe; }
@keyframes hk-bounce {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

.chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; background: #e0e7ff; color: #3730a3; }
.chip-remove { cursor: pointer; opacity: 0.6; }
.chip-remove:hover { opacity: 1; }

/* Cards */
.card { background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; }
.card-hover:hover { border-color: #93c5fd; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* Hide print-only by default */
@media screen { .print-only { display: none; } }

/* ========== TOUR GUIADO (spotlight + tooltip) ========== */
/* Overlay clicável capturando interação fora do tooltip. Não escurece sozinho —
   o escurecimento vem do box-shadow gigante do .tour-spotlight. */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: transparent;
  pointer-events: auto;
}

/* Spotlight = retângulo claro com sombra ENORME ao redor.
   Truque clássico: box-shadow com spread de 9999px pinta tudo ao redor de escuro,
   deixando só o retângulo do spotlight visível. pointer-events: none pra o clique
   atravessar pro elemento real embaixo. */
.tour-spotlight {
  position: fixed;
  z-index: 9991;
  border-radius: 0.5rem;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.7);
  pointer-events: none;
  transition: top 0.25s, left 0.25s, width 0.25s, height 0.25s;
  display: none;
}

/* Tooltip flutuante com texto + botões */
.tour-tooltip {
  position: fixed;
  z-index: 9992;
  width: min(380px, calc(100vw - 32px));
  background: white;
  border-radius: 0.875rem;
  padding: 1rem 1.25rem 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35),
              0 0 0 1px rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: #1e293b;
  line-height: 1.55;
}

.tour-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.tour-tip-counter {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6366f1;
  background: #eef2ff;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}
.tour-tip-close {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.35rem;
  border-radius: 0.35rem;
  transition: background 0.15s, color 0.15s;
}
.tour-tip-close:hover { background: #f1f5f9; color: #475569; }

.tour-tip-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
}
.tour-tip-body {
  color: #475569;
  margin-bottom: 1rem;
}
.tour-tip-body b { color: #1e293b; }
.tour-tip-body i { color: #64748b; font-size: 0.85rem; }

.tour-tip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  flex-wrap: wrap;
}
.tour-tip-foot-right {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* Botões do tour — visualmente parecidos com .btn mas escopo local pra não conflitar */
.tour-tip-skip {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: 0.4rem;
  transition: background 0.15s, color 0.15s;
}
.tour-tip-skip:hover { background: #f1f5f9; color: #475569; }

.tour-tip-prev,
.tour-tip-next {
  background: #2563eb;
  color: white;
  border: 0;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.tour-tip-prev {
  background: #e2e8f0;
  color: #475569;
}
.tour-tip-prev:hover { background: #cbd5e1; }
.tour-tip-next:hover { background: #1d4ed8; }

/* Banner de primeira-vez (no dashboard) */
.tour-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.tour-banner-emoji { font-size: 1.6rem; }
.tour-banner-txt { flex: 1; min-width: 200px; }
.tour-banner-titulo {
  font-weight: 600;
  color: #312e81;
  font-size: 0.95rem;
}
.tour-banner-sub {
  font-size: 0.8rem;
  color: #4338ca;
  margin-top: 0.15rem;
}
.tour-banner-acoes { display: flex; gap: 0.4rem; }
