/* Reporte de errores — minimalista */

.header-report-btn {
  position: relative;
  z-index: 33;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft, #94a3b8);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: var(--surface, rgba(255, 255, 255, 0.04));
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-report-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.header-report-btn:hover,
.header-report-btn[aria-expanded="true"] {
  color: var(--text, #f1f5f9);
  border-color: var(--border-strong, rgba(255, 255, 255, 0.14));
  background: var(--surface-hover, rgba(255, 255, 255, 0.07));
}

.footer-report-link {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.footer-report-link:hover {
  color: var(--accent, #22d3ee);
}

.report-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8498;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.report-chat-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.report-chat-shell {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 8499;
  width: min(420px, calc(100vw - 24px));
  max-height: min(92dvh, 680px);
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.report-chat-shell.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.report-chat-panel {
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 680px);
  border-radius: 16px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: var(--bg-elevated, #111827);
  box-shadow: var(--shadow, 0 8px 32px rgba(0, 0, 0, 0.35));
  overflow: hidden;
}

.report-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.report-chat-head-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.report-chat-head-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.report-chat-head-icon svg {
  width: 17px;
  height: 17px;
}

.report-chat-head-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #f1f5f9);
}

.report-chat-head-sub {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--text-soft, #94a3b8);
}

.report-chat-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft, #94a3b8);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.report-chat-close:hover {
  color: var(--text, #f1f5f9);
  border-color: var(--border-strong, rgba(255, 255, 255, 0.14));
}

.report-chat-messages {
  flex: 0 1 auto;
  max-height: 120px;
  overflow-y: auto;
  padding: 12px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-chat-bubble {
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  word-break: break-word;
}

.report-chat-bubble--bot {
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text-soft, #94a3b8);
}

.report-chat-bubble--user {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #e0e7ff;
}

.report-chat-bubble--ok {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
}

.report-chat-bubble--err {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #fecaca;
}

.report-chat-form {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.report-chat-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.report-chat-field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft, #94a3b8);
}

.report-chat-field-label .is-required {
  color: #fca5a5;
}

.report-chat-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: rgba(0, 0, 0, 0.22);
  color: var(--text, #f1f5f9);
  font: inherit;
  font-size: 0.86rem;
  min-height: 96px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.report-chat-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.report-chat-screenshot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-chat-screenshot-drop {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong, rgba(255, 255, 255, 0.14));
  background: rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.report-chat-screenshot-drop.is-dragover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.06);
}

.report-chat-screenshot-drop.is-missing {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.05);
}

.report-chat-screenshot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-chat-screenshot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: var(--surface, rgba(255, 255, 255, 0.04));
  color: var(--text, #f1f5f9);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.report-chat-screenshot-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.report-chat-screenshot-btn:hover:not(:disabled) {
  border-color: var(--border-strong, rgba(255, 255, 255, 0.14));
  background: var(--surface-hover, rgba(255, 255, 255, 0.07));
}

.report-chat-screenshot-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.report-chat-screenshot-hint {
  margin: 0;
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
}

.report-chat-screenshot-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-chat-screenshot-view {
  position: relative;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  cursor: default;
}

.report-chat-screenshot-preview.is-filled .report-chat-screenshot-view {
  cursor: zoom-in;
}

.report-chat-screenshot-view:disabled {
  cursor: default;
}

.report-chat-screenshot-view img {
  display: none;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: #0a0e17;
}

.report-chat-screenshot-preview.is-filled .report-chat-screenshot-view img {
  display: block;
}

.report-chat-screenshot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 16px;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
}

.report-chat-screenshot-preview.is-filled .report-chat-screenshot-empty {
  display: none;
}

.report-chat-screenshot-view-label {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.report-chat-screenshot-preview.is-filled .report-chat-screenshot-view-label {
  display: block;
}

.report-chat-screenshot-preview.is-filled .report-chat-screenshot-view:hover img {
  opacity: 0.92;
}

.report-chat-screenshot-remove {
  align-self: flex-end;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-chat-screenshot-remove:hover {
  color: #fecaca;
}

.report-chat-screenshot-remove[hidden] {
  display: none;
}

.report-chat-form-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-chat-meta {
  margin: 0;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.45;
}

.report-chat-send {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: #ef4444;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.report-chat-send:hover:not(:disabled) {
  background: #dc2626;
}

.report-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.report-chat-send.is-sending {
  position: relative;
  pointer-events: none;
  background: #b91c1c;
}

.report-chat-send.is-sending::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: report-send-spin 0.7s linear infinite;
}

.report-chat-form.is-sending {
  position: relative;
}

.report-chat-form.is-sending::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  animation: report-form-pulse 1.2s ease-in-out infinite;
}

@keyframes report-send-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes report-form-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.85;
  }
}

/* Palomita pantalla completa — enviado */

.report-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 8700;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  cursor: pointer;
}

.report-success-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.report-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px;
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.report-success-overlay.is-visible .report-success-card {
  transform: scale(1);
  opacity: 1;
}

.report-success-check {
  width: 96px;
  height: 96px;
}

.report-success-check svg {
  width: 100%;
  height: 100%;
  display: block;
}

.report-success-check circle {
  fill: none;
  stroke: #22c55e;
  stroke-width: 3;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
}

.report-success-check path {
  fill: none;
  stroke: #22c55e;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.report-success-overlay.is-visible .report-success-check circle {
  animation: report-check-circle 0.55s ease forwards;
}

.report-success-overlay.is-visible .report-success-check path {
  animation: report-check-mark 0.4s 0.4s ease forwards;
}

.report-success-text {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #bbf7d0;
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
}

@keyframes report-check-circle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes report-check-mark {
  to {
    stroke-dashoffset: 0;
  }
}

/* Overlay — capturando pantalla */

.report-screenshot-capturing {
  position: fixed;
  inset: 0;
  z-index: 8650;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.report-screenshot-capturing.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.report-screenshot-capturing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(320px, 100%);
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: var(--bg-elevated, #111827);
  box-shadow: var(--shadow, 0 8px 32px rgba(0, 0, 0, 0.35));
  text-align: center;
}

.report-screenshot-capturing-spinner,
.report-capture-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent, #22d3ee);
  border-radius: 50%;
  animation: report-send-spin 0.7s linear infinite;
}

.report-capture-spinner {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.report-screenshot-capturing-text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #f1f5f9);
  line-height: 1.45;
}

.report-chat-screenshot-btn.is-capturing {
  pointer-events: none;
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent, #22d3ee);
}

.report-chat-screenshot-preview.is-capturing .report-chat-screenshot-view {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.06);
}

.report-chat-screenshot-preview.is-capturing .report-chat-screenshot-empty {
  color: var(--accent, #22d3ee);
}

/* Lightbox — ver captura a tamaño completo */

.report-screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 8600;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.report-screenshot-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.report-screenshot-lightbox img {
  max-width: min(960px, 100%);
  max-height: calc(100dvh - 80px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.report-screenshot-lightbox-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 880px) {
  .header-report-label {
    display: none;
  }

  .header-report-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .report-chat-shell {
    width: calc(100vw - 16px);
  }

  .report-chat-screenshot-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .report-chat-backdrop,
  .report-chat-shell,
  .report-screenshot-lightbox,
  .report-success-overlay,
  .report-success-card {
    transition: none;
  }

  .report-chat-send.is-sending::after,
  .report-chat-form.is-sending::before,
  .report-screenshot-capturing-spinner,
  .report-capture-spinner,
  .report-success-overlay.is-visible .report-success-check circle,
  .report-success-overlay.is-visible .report-success-check path {
    animation: none;
  }

  .report-success-overlay.is-visible .report-success-check circle,
  .report-success-overlay.is-visible .report-success-check path {
    stroke-dashoffset: 0;
  }
}
