/* =============================================
   FEEDBACK WIDGET — Servicio de Ayuda
   Solo logueados
   ============================================= */

.fbk-float {
  position: fixed;
  z-index: 900;
  right: 22px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 300px;
  padding: 12px 15px 12px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 22px 22px 6px 22px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31,107,92,.25);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  font-family: inherit;
  line-height: 1;
}
.fbk-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(31,107,92,.32);
}

/* Pulso de atención al aparecer */
.fbk-float {
  animation: fbkEntrada .4s ease both, fbkRebote 2.5s ease 4s 3;
}

@keyframes fbkEntrada {
  from { opacity: 0; transform: translateY(20px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fbkRebote {
  0%, 100% { transform: translateY(0); }
  15%  { transform: translateY(-8px); }
  30%  { transform: translateY(0); }
  42%  { transform: translateY(-5px); }
  55%  { transform: translateY(0); }
}

/* Brillo en el icono */
.fbk-float-icon {
  animation: fbkPulso 2.5s ease 4s 3;
}

@keyframes fbkPulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,107,92,0); }
  15%  { box-shadow: 0 0 0 8px rgba(31,107,92,.25); }
  55%  { box-shadow: 0 0 0 0 rgba(31,107,92,0); }
}

.fbk-float-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  background: #edf7f3;
  color: #1f6b5c;
}

.fbk-float strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: left;
  color: #1a1a1a;
}
.fbk-float-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: #71685e;
  text-align: left;
}

/* Panel */
.fbk-panel {
  position: fixed;
  z-index: 910;
  right: 22px;
  bottom: 80px;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 22px 22px 8px 22px;
  box-shadow: 0 18px 48px rgba(45,31,14,.16);
  display: none;
}
.fbk-panel.is-open {
  display: block;
  animation: fbkIn .22s ease both;
}
@keyframes fbkIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fbk-panel-inner { padding: 20px; }

.fbk-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.fbk-panel-title {
  margin: 0 0 5px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: #1a1a1a;
}
.fbk-panel-intro {
  margin: 0;
  color: #71685e;
  font-size: 12.5px;
  line-height: 1.45;
}

.fbk-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: none;
  border-radius: 50%;
  background: #f2eadf;
  color: #60564b;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  margin-top: 2px;
  transition: background .15s;
}
.fbk-close:hover { background: #e8ddd0; }

.fbk-block {
  padding: 14px 0;
  border-top: 1px solid rgba(0,0,0,.07);
}
.fbk-question {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #312c26;
  line-height: 1.35;
}

.fbk-score {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.fbk-score button {
  height: 36px;
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 10px;
  background: #fff;
  color: #39332c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.fbk-score-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #887e73;
}

.fbk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.fbk-chips button {
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: #39332c;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}

.fbk-score button:hover,
.fbk-score button.active,
.fbk-chips button:hover,
.fbk-chips button.active {
  border-color: rgba(31,107,92,.3);
  background: #f2faf6;
  color: #154b40;
  transform: translateY(-1px);
}

.fbk-textarea {
  width: 100%;
  min-height: 72px;
  resize: none;
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
  font: 500 13px/1.45 inherit;
  color: #1a1a1a;
  outline: none;
  margin-top: 2px;
}
.fbk-textarea:focus { border-color: rgba(0,0,0,.18); }

.fbk-note {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f7f0e7;
  color: #675f55;
  font-size: 11.5px;
  line-height: 1.45;
}

.fbk-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.fbk-btn-send,
.fbk-btn-skip {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.fbk-btn-send { background: #1f6b5c; color: #fff; }
.fbk-btn-skip { background: #f2eadf; color: #4c443b; }
.fbk-btn-send:disabled { opacity: .55; cursor: not-allowed; }

.fbk-thanks {
  display: none;
  padding: 30px 20px;
  text-align: center;
}
.fbk-thanks.visible { display: block; }
.fbk-thanks-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
  font-size: 20px;
  background: #edf7f3;
  color: #1f6b5c;
}
.fbk-thanks h3 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -.03em;
}
.fbk-thanks p {
  margin: 0;
  color: #71685e;
  font-size: 13px;
  line-height: 1.45;
}

.fbk-overlay {
  position: fixed;
  inset: 0;
  z-index: 905;
  background: rgba(0,0,0,.08);
  display: none;
}
.fbk-overlay.is-open { display: block; }

@media (max-width: 520px) {
  .fbk-float {
    right: 12px;
    bottom: 14px;
    max-width: calc(100vw - 24px);
    padding: 10px 13px 10px 10px;
    gap: 9px;
    border-radius: 18px 18px 5px 18px;
  }
  .fbk-float-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 15px;
  }
  .fbk-float strong { font-size: 12.5px; }
  .fbk-float-sub { font-size: 11px; }

  .fbk-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,.15);
  }
  .fbk-panel-inner { padding: 18px 16px; }
  .fbk-panel-title { font-size: 18px; }
  .fbk-panel-intro { font-size: 12px; }

  .fbk-question { font-size: 13px; }

  .fbk-score { gap: 5px; }
  .fbk-score button { height: 38px; font-size: 12px; border-radius: 10px; }

  .fbk-chips { gap: 6px; }
  .fbk-chips button { padding: 7px 10px; font-size: 11px; }

  .fbk-textarea {
    min-height: 60px;
    padding: 10px;
    font-size: 13px;
    border-radius: 12px;
  }

  .fbk-note { font-size: 11px; padding: 8px 10px; border-radius: 10px; }

  .fbk-actions { gap: 6px; margin-top: 12px; }
  .fbk-btn-send,
  .fbk-btn-skip { padding: 10px 14px; font-size: 11.5px; }

  .fbk-thanks { padding: 24px 16px; }
  .fbk-thanks-mark { width: 42px; height: 42px; font-size: 18px; }
  .fbk-thanks h3 { font-size: 20px; }
  .fbk-thanks p { font-size: 12px; }

  .fbk-overlay { background: rgba(0,0,0,.25); }
}

@media (max-width: 360px) {
  .fbk-score { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .fbk-score button { height: 36px; font-size: 11px; }
  .fbk-chips button { padding: 6px 8px; font-size: 10.5px; }
  .fbk-panel-inner { padding: 14px 12px; }
}