/**
 * Petri OS · Demo Feedback widget
 * Solo visible en demo.petrios.app (controlado por JS según es_demo).
 * 49cb.141 #271
 */

/* ── Botón flotante ────────────────────────────────────────── */
.dfb-floating {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 9998;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font: 600 14px system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35), 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.dfb-floating:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45), 0 3px 8px rgba(0,0,0,0.12);
}
.dfb-floating:active { transform: translateY(0); }
.dfb-floating::before { content: '💬'; font-size: 16px; }

/* Esconde botón cuando modal abierto */
.dfb-floating.hidden { display: none !important; }

/* ── Modal backdrop ────────────────────────────────────────── */
.dfb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: dfb-fade-in 0.18s ease;
}
@keyframes dfb-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal box ─────────────────────────────────────────────── */
.dfb-modal {
  background: #fff;
  color: #1F2937;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
  animation: dfb-pop-in 0.22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes dfb-pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.dfb-modal h2 {
  margin: 0;
  padding: 20px 24px 8px;
  font: 700 20px system-ui, -apple-system, sans-serif;
  color: #1F2937;
}
.dfb-modal .dfb-sub {
  padding: 0 24px 16px;
  font: 400 14px system-ui;
  color: #6B7280;
  line-height: 1.45;
}
.dfb-form { padding: 8px 24px 20px; }

.dfb-field { margin-bottom: 18px; }
.dfb-field label {
  display: block;
  font: 600 13px system-ui;
  color: #374151;
  margin-bottom: 8px;
}

/* ── Estrellas ─────────────────────────────────────────────── */
.dfb-stars {
  display: flex;
  gap: 6px;
  font-size: 32px;
  user-select: none;
  cursor: pointer;
}
.dfb-stars span {
  color: #D1D5DB;
  transition: color 0.1s, transform 0.1s;
  line-height: 1;
}
.dfb-stars span:hover,
.dfb-stars span.active,
.dfb-stars span.hover {
  color: #F59E0B;
  transform: scale(1.08);
}
.dfb-stars-label {
  font: 500 13px system-ui;
  color: #6B7280;
  margin-top: 6px;
  min-height: 18px;
}

/* ── Chips módulos ─────────────────────────────────────────── */
.dfb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dfb-chip {
  background: #F3F4F6;
  color: #374151;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font: 500 13px system-ui;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.dfb-chip:hover { background: #E5E7EB; }
.dfb-chip.active {
  background: #EEF2FF;
  border-color: #6366F1;
  color: #4338CA;
}

/* ── Textarea ──────────────────────────────────────────────── */
.dfb-textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  font: 400 14px system-ui;
  color: #1F2937;
  resize: vertical;
  transition: border-color 0.12s, box-shadow 0.12s;
  box-sizing: border-box;
}
.dfb-textarea:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.dfb-charcount {
  font: 400 11px system-ui;
  color: #9CA3AF;
  text-align: right;
  margin-top: 4px;
}

/* ── Email + consent ───────────────────────────────────────── */
.dfb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  font: 400 14px system-ui;
  color: #1F2937;
  box-sizing: border-box;
}
.dfb-input:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.dfb-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font: 400 12px system-ui;
  color: #6B7280;
  margin-top: 8px;
  cursor: pointer;
  line-height: 1.4;
}
.dfb-consent input[type=checkbox] { margin-top: 2px; flex-shrink: 0; }

/* ── Actions ───────────────────────────────────────────────── */
.dfb-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #F3F4F6;
}
.dfb-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font: 600 14px system-ui;
  cursor: pointer;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.dfb-btn-secondary {
  background: transparent;
  color: #6B7280;
}
.dfb-btn-secondary:hover { background: #F3F4F6; }
.dfb-btn-primary {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
}
.dfb-btn-primary:hover { box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.dfb-btn-primary:disabled {
  background: #D1D5DB;
  color: #fff;
  cursor: not-allowed;
}

/* ── Honeypot oculto ───────────────────────────────────────── */
.dfb-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ── Success state ─────────────────────────────────────────── */
.dfb-success {
  text-align: center;
  padding: 32px 24px;
}
.dfb-success-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}
.dfb-success h3 {
  margin: 0 0 8px;
  font: 700 18px system-ui;
  color: #1F2937;
}
.dfb-success p {
  margin: 0;
  font: 400 14px system-ui;
  color: #6B7280;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .dfb-floating { right: 14px; bottom: 14px; padding: 9px 14px; font-size: 13px; }
  .dfb-modal { max-height: 96vh; border-radius: 14px; }
  .dfb-modal h2 { font-size: 18px; padding: 18px 18px 6px; }
  .dfb-sub, .dfb-form { padding-left: 18px; padding-right: 18px; }
  .dfb-stars { font-size: 36px; gap: 10px; justify-content: space-around; }
}
