/* ============================================================
   Force One System — Pixel Demo Bot Styles  v2
   File: pixel-chat.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700;800&display=swap');

:root {
  --f1s-primary:  #0052FF;
  --f1s-dark:     #0039B3;
  --f1s-accent:   #e94560;
  --f1s-green:    #22c55e;
  --f1s-surface:  #ffffff;
  --f1s-surf2:    #f7f8fc;
  --f1s-border:   #e2e6f3;
  --f1s-text:     #1a1a2e;
  --f1s-muted:    #9ba3bf;
  --f1s-r:        14px;
  --f1s-rxl:      24px;
  --f1s-shadow:   0 32px 80px rgba(0,39,179,0.22);
  --f1s-font:     'Raleway', 'Montserrat', sans-serif;
}

/* ── Trigger flotante ─────────────────────────────────── */
#f1s-trigger {
  position: fixed; bottom: 30px; right: 30px;
  width: 70px; height: 70px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--f1s-primary);
  box-shadow: 0 8px 28px rgba(0,82,255,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  animation: f1s-pulse 3s ease-in-out infinite;
}
#f1s-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(0,82,255,0.5), 0 0 0 14px rgba(0,82,255,0.1);
}
#f1s-trigger.f1s-hidden { transform: scale(0); opacity: 0; pointer-events: none; }

.f1s-trigger-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  overflow: hidden; border: 2.5px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.f1s-trigger-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.f1s-trigger-tooltip {
  position: absolute; right: calc(100% + 14px); top: 50%;
  transform: translateY(-50%);
  background: var(--f1s-primary); color: #fff;
  font-family: var(--f1s-font); font-size: 0.83rem; font-weight: 700;
  white-space: nowrap; padding: 9px 16px; border-radius: 12px;
  pointer-events: none; opacity: 0; transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(0,82,255,0.25);
}
.f1s-trigger-tooltip::after {
  content: ''; position: absolute; left: 100%; top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent; border-left-color: var(--f1s-primary);
}
#f1s-trigger:hover .f1s-trigger-tooltip {
  opacity: 1; transform: translateY(-50%) translateX(-5px);
}

/* ── Overlay contenedor ───────────────────────────────── */
#f1s-container {
  position: fixed; bottom: 114px; right: 30px;
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#f1s-container.f1s-visible { opacity: 1; pointer-events: all; }

/* ── Ventana del chat ─────────────────────────────────── */
#f1s-window {
  width: 760px; max-width: calc(100vw - 40px);
  height: 500px; max-height: calc(100vh - 130px);
  background: var(--f1s-surface); border-radius: var(--f1s-rxl);
  box-shadow: var(--f1s-shadow);
  display: flex; flex-direction: row; overflow: hidden;
  transform: scale(0.88) translateY(24px); transform-origin: bottom right;
  transition: all 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
#f1s-container.f1s-visible #f1s-window { transform: scale(1) translateY(0); }

/* ── Panel mascota ────────────────────────────────────── */
#f1s-mascot {
  width: 220px; min-width: 220px;
  background: linear-gradient(160deg, #0039B3 0%, #0052FF 60%, #1a6aff 100%);
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding: 18px 0 18px 0;
  position: relative; overflow: hidden;
}
#f1s-mascot::before {
  content: ''; position: absolute; top: -60px; left: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.f1s-mascot-company {
  width: 88px; margin-bottom: 14px; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
}
.f1s-mascot-company img {
  width: 100%; height: auto; object-fit: contain;
}
.f1s-mascot-img {
  position: relative; z-index: 2; width: 170px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 28px;
}
.f1s-mascot-img img {
  width: 95%; max-width: 170px; height: auto;
  object-fit: contain; object-position: center;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.3));
  animation: f1s-float 4s ease-in-out infinite;
}
.f1s-mascot-name {
  font-family: var(--f1s-font); font-size: 1.1rem; font-weight: 800;
  color: #fff; position: relative; z-index: 2; margin-top: auto;
}
.f1s-mascot-status {
  font-family: var(--f1s-font); font-size: 0.76rem; color: rgba(255,255,255,0.75);
  position: relative; z-index: 2; margin-top: 4px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.f1s-status-dot {
  width: 7px; height: 7px; background: #4ade80; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74,222,128,0.3); animation: f1s-blink 2s infinite;
}

/* ── Área de chat ─────────────────────────────────────── */
#f1s-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Header ───────────────────────────────────────────── */
.f1s-header {
  background: var(--f1s-surface); border-bottom: 1.5px solid var(--f1s-border);
  padding: 16px 22px; display: flex; align-items: center; justify-content: space-between;
}
.f1s-header-info h2 {
  font-family: var(--f1s-font); font-size: 0.97rem; font-weight: 700;
  color: var(--f1s-text); margin-bottom: 2px;
}
.f1s-header-info p { font-family: var(--f1s-font); font-size: 0.77rem; color: #5a607a; }
.f1s-header-actions { display: flex; gap: 8px; }
.f1s-header-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--f1s-border); background: var(--f1s-surf2);
  color: #5a607a; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all 0.2s; font-size: 0.95rem;
}
.f1s-header-btn:hover { background: #eef0f8; color: var(--f1s-text); transform: translateY(-1px); }

/* ── Mensajes ─────────────────────────────────────────── */
#f1s-messages {
  flex: 1; overflow-y: auto; padding: 20px 20px 12px;
  display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
}
#f1s-messages::-webkit-scrollbar { width: 4px; }
#f1s-messages::-webkit-scrollbar-thumb { background: var(--f1s-border); border-radius: 99px; }

.f1s-msg { display: flex; align-items: flex-end; gap: 8px; animation: f1s-in 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.f1s-msg-user { flex-direction: row-reverse; }

.f1s-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--f1s-border);
  flex-shrink: 0; background: var(--f1s-surf2);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.f1s-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.f1s-bubble {
  font-family: var(--f1s-font); font-size: 0.88rem; line-height: 1.55;
  padding: 11px 15px; border-radius: 18px; max-width: 76%; word-break: break-word;
}
.f1s-bubble-bot {
  background: var(--f1s-surf2); color: var(--f1s-text);
  border: 1.5px solid var(--f1s-border); border-bottom-left-radius: 5px;
}
.f1s-bubble-user { background: var(--f1s-primary); color: #fff; border-bottom-right-radius: 5px; }

/* ── Typing ───────────────────────────────────────────── */
.f1s-typing {
  background: var(--f1s-surf2); border: 1.5px solid var(--f1s-border);
  padding: 13px 16px; border-radius: 18px; border-bottom-left-radius: 5px;
  display: inline-flex; gap: 5px; align-items: center;
}
.f1s-dot {
  width: 7px; height: 7px; background: var(--f1s-muted); border-radius: 50%;
  animation: f1s-typing 1.4s infinite;
}
.f1s-dot:nth-child(2) { animation-delay: 0.2s; }
.f1s-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Formulario de captura ────────────────────────────── */
.f1s-form-wrap {
  background: var(--f1s-surf2); border: 1.5px solid var(--f1s-border);
  border-radius: var(--f1s-r); padding: 14px 16px; margin: 2px 0;
  max-width: 92%; animation: f1s-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.f1s-field {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--f1s-border); border-radius: 10px;
  font-family: var(--f1s-font); font-size: 0.87rem;
  color: var(--f1s-text); background: var(--f1s-surface);
  outline: none; margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
}
.f1s-field:focus {
  border-color: var(--f1s-primary);
  box-shadow: 0 0 0 3px rgba(0,82,255,0.12);
}
.f1s-field.f1s-error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

/* ── Calendario ───────────────────────────────────────── */
.f1s-date-label {
  font-family: var(--f1s-font); font-size: 0.8rem; font-weight: 700;
  color: var(--f1s-text); margin-bottom: 10px;
  display: block; opacity: 0.8;
}

.f1s-date-input {
  cursor: pointer; font-size: 0.9rem; font-weight: 600;
  color: var(--f1s-primary); padding: 12px 14px;
  background: #f0f4ff;
  border-color: var(--f1s-primary);
}
.f1s-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer; filter: invert(25%) sepia(100%) saturate(3000%) hue-rotate(215deg);
  transform: scale(1.2);
}

.f1s-btn-fecha { background: var(--f1s-dark) !important; }
.f1s-btn-fecha:hover { background: var(--f1s-primary) !important; }

.f1s-submit-btn {
  width: 100%; padding: 11px;
  background: var(--f1s-primary); color: #fff;
  border: none; border-radius: 10px;
  font-family: var(--f1s-font); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.22s; letter-spacing: 0.02em;
}
.f1s-submit-btn:hover {
  background: var(--f1s-dark); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,82,255,0.3);
}

/* ── Input bar ────────────────────────────────────────── */
.f1s-input-bar {
  padding: 12px 20px 16px; background: var(--f1s-surface);
  border-top: 1.5px solid var(--f1s-border);
  display: flex; gap: 8px; align-items: center;
}
#f1s-input {
  flex: 1; padding: 10px 16px;
  border: 1.5px solid var(--f1s-border); border-radius: 99px;
  font-family: var(--f1s-font); font-size: 0.88rem;
  color: var(--f1s-text); background: var(--f1s-surf2);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
#f1s-input:focus {
  border-color: var(--f1s-primary); background: var(--f1s-surface);
  box-shadow: 0 0 0 3px rgba(0,82,255,0.1);
}
#f1s-input::placeholder { color: var(--f1s-muted); }

.f1s-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--f1s-primary); color: #fff;
  font-size: 1rem; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.f1s-send-btn:hover { background: var(--f1s-accent); transform: scale(1.1); }

/* ═══════════════════════════════════════════
   OVERLAY DE ÉXITO
════════════════════════════════════════════ */
#f1s-success-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: f1s-fade-overlay 0.4s ease;
  padding: 20px;
}

.f1s-scard {
  background: #fff; border-radius: 28px;
  padding: 3rem 3.5rem; max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: 0 40px 100px rgba(0,39,179,0.28);
  animation: f1s-card-pop 0.5s cubic-bezier(0.34,1.56,0.64,1);
  position: relative; overflow: hidden;
}
.f1s-scard::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--f1s-primary), #4d94ff, var(--f1s-green));
}

.f1s-scard-icon {
  font-size: 3.5rem; margin-bottom: 1rem;
  animation: f1s-bounce-icon 0.6s 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.f1s-scard-title {
  font-family: var(--f1s-font); font-size: 1.9rem; font-weight: 800;
  color: var(--f1s-text); margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.f1s-scard-body {
  font-family: var(--f1s-font); font-size: 1.05rem; line-height: 1.7;
  color: #5a607a; margin-bottom: 1.5rem; font-weight: 500;
}

.f1s-scard-info {
  background: #f0f4ff; border-radius: 16px;
  padding: 1.2rem 1.5rem; margin-bottom: 2rem; text-align: left;
  border: 1.5px solid #d0deff;
}
.f1s-scard-row {
  font-family: var(--f1s-font); font-size: 0.9rem; font-weight: 600;
  color: var(--f1s-text); padding: 0.4rem 0;
  display: flex; align-items: center; gap: 10px;
}
.f1s-scard-row:not(:last-child) { border-bottom: 1px solid #dde5ff; }
.f1s-scard-row span { font-size: 1.1rem; width: 22px; text-align: center; }

.f1s-scard-btn {
  background: var(--f1s-primary); color: #fff;
  border: none; border-radius: 50px; cursor: pointer;
  font-family: var(--f1s-font); font-size: 1rem; font-weight: 700;
  padding: 14px 40px; transition: all 0.25s;
  box-shadow: 0 8px 24px rgba(0,82,255,0.3);
}
.f1s-scard-btn:hover {
  background: var(--f1s-dark); transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,82,255,0.4);
}

/* ═══════════════════════════════════════════
   ANIMACIONES
════════════════════════════════════════════ */
@keyframes f1s-pulse {
  0%,100% { box-shadow: 0 8px 28px rgba(0,82,255,0.4), 0 0 0 0 rgba(0,82,255,0); }
  50%      { box-shadow: 0 8px 28px rgba(0,82,255,0.4), 0 0 0 12px rgba(0,82,255,0.12); }
}
@keyframes f1s-blink {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.7; transform:scale(0.85); }
}
@keyframes f1s-typing {
  0%,60%,100% { transform:translateY(0); opacity:.5; }
  30%          { transform:translateY(-5px); opacity:1; }
}
@keyframes f1s-in {
  from { opacity:0; transform:translateY(10px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes f1s-float {
  0%,100% { transform:translateY(0); }
  50%      { transform:translateY(-10px); }
}
@keyframes f1s-shake {
  0%,100% { transform:translateX(0); }
  25%      { transform:translateX(-7px); }
  75%      { transform:translateX(7px); }
}
.f1s-shake { animation: f1s-shake 0.4s ease; }

@keyframes f1s-fade-overlay {
  from { opacity:0; } to { opacity:1; }
}
@keyframes f1s-card-pop {
  from { opacity:0; transform:scale(0.85) translateY(30px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
@keyframes f1s-bounce-icon {
  from { opacity:0; transform:scale(0) rotate(-20deg); }
  to   { opacity:1; transform:scale(1) rotate(0); }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  #f1s-container { bottom: 96px; right: 12px; left: 12px; }
  #f1s-trigger   { bottom: 18px; right: 14px; width: 60px; height: 60px; }
  .f1s-trigger-avatar { width: 44px; height: 44px; }
  .f1s-trigger-tooltip { display: none; }
  #f1s-mascot    { display: none; }
  #f1s-window    { width: auto; max-width: none; height: 78vh; border-radius: 20px; }
  .f1s-scard     { padding: 2rem 1.5rem; }
  .f1s-scard-title { font-size: 1.5rem; }
}
