﻿/* Botón flotante "Registrar un caso" + modal + simulador de hora.
   Todas las clases llevan prefijo cw- para no chocar con Bootstrap de la página. */
.cw-root { --cw-blue: #0033A0; --cw-yellow: #FFD100; --cw-primary: #2D6DF6; font-family: Lato, sans-serif; }
.cw-root *, .cw-root *::before, .cw-root *::after { box-sizing: border-box; }
.cw-root [hidden] { display: none !important; }

/* ===== Botón flotante ===== */
/* Pila de botones flotantes (WhatsApp encima de "Registrar un caso") */
#cw-stack { position: fixed; right: 24px; bottom: 24px; z-index: 2000; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
#cw-stack > * { pointer-events: auto; }
#cw-wa { display: flex; align-items: center; gap: 10px; text-decoration: none; }
/* El botón de casos se pliega (sin ocupar espacio) fuera de horario, y WhatsApp baja a la esquina */
#cw-fabwrap { margin-top: 12px; max-height: 90px; transition: max-height .35s, margin-top .35s; }
#cw-fabwrap.cw-collapsed { max-height: 0; margin-top: 0; pointer-events: none; }
#cw-wa .cw-wa-ico { width: 56px; height: 56px; border-radius: 50%; background: #25D366; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .2s, background .2s; }
#cw-wa:hover .cw-wa-ico { background: #1ebe5b; transform: scale(1.06); }
#cw-wa .cw-wa-label { background: #fff; color: #1c2333; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.2); opacity: 0; transform: translateX(8px); transition: opacity .2s, transform .2s; white-space: nowrap; pointer-events: none; }
#cw-wa:hover .cw-wa-label, #cw-wa:focus-visible .cw-wa-label { opacity: 1; transform: none; }
#cw-fab {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: var(--cw-yellow); color: #1c2333; border: 0; cursor: pointer;
  padding: 14px 22px 14px 16px; border-radius: 999px; font: inherit; font-weight: 800; font-size: 15px; line-height: 1.25; text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  transition: opacity .35s, transform .35s, visibility .35s;
}
#cw-fab .cw-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--cw-blue); color: #fff; display: grid; place-items: center; font-size: 18px; line-height: 1; flex: none; }
#cw-fab::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(255,209,0,.7); animation: cw-pulse 2s infinite; }
#cw-fab:hover { background: #ffdf3d; }
#cw-fab.cw-hidden { opacity: 0; transform: translateY(20px) scale(.9); visibility: hidden; pointer-events: none; }
@keyframes cw-pulse { 70% { box-shadow: 0 0 0 16px rgba(255,209,0,0); } 100% { box-shadow: 0 0 0 0 rgba(255,209,0,0); } }
#cw-fab small { display: block; font-weight: 600; font-size: 11px; opacity: .7; }

/* ===== Modal ===== */
.cw-backdrop { position: fixed; inset: 0; background: rgba(29,33,42,.6); display: none; align-items: center; justify-content: center; z-index: 2100; padding: 16px; }
.cw-backdrop.cw-open { display: flex; }
.cw-modal { background: #fff; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; border-radius: 3px; padding: 28px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: cw-pop .2s ease; color: #555c63; font-size: 14px; }
@keyframes cw-pop { from { transform: translateY(14px); opacity: 0; } }
/* Modo en página (#cw-formulario-pagina): misma tarjeta, sin comportamiento de ventana */
.cw-modal.cw-inline { max-width: 640px; max-height: none; overflow: visible; margin: 0 auto; box-shadow: 0 6px 30px rgba(0,0,0,.10); animation: none; text-align: left; }
.cw-modal.cw-inline .cw-success { text-align: center; }
.cw-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.cw-modal h3 { font-size: 28px; font-weight: 300; color: #222; margin: 0; }
.cw-x { background: none; border: 0; font-size: 26px; cursor: pointer; color: #888; line-height: 1; }
.cw-hours { font-size: 12px; color: #777; margin: 2px 0 12px; }
.cw-modal label { display: block; font-size: 12px; font-weight: 700; margin: 10px 0 4px; color: #555c63; }
.cw-modal input, .cw-modal select, .cw-modal textarea { width: 100%; height: auto; padding: 8px 14px; border: 1px solid #c9d0d6; border-radius: 20px; font: inherit; font-size: 13px; color: #555c63; background: #fff; box-shadow: none; }
.cw-modal textarea { border-radius: 14px; resize: vertical; }
.cw-modal input:focus, .cw-modal select:focus, .cw-modal textarea:focus { outline: none; border-color: var(--cw-primary); }
.cw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cw-shot { border: 1.5px dashed #c9d0d6; border-radius: 14px; padding: 10px 12px; transition: border-color .2s, background .2s; }
.cw-shot.cw-drag { border-color: var(--cw-primary); background: #eef3ff; }
.cw-shot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-sbtn { flex: 1; min-width: 130px; height: 34px; border: 1px solid var(--cw-primary); border-radius: 30px; background: #fff; color: var(--cw-primary); font: inherit; font-size: 13px; cursor: pointer; transition: all .2s; }
.cw-sbtn:hover:not(:disabled) { background: var(--cw-primary); color: #fff; }
.cw-sbtn:disabled { opacity: .5; cursor: wait; }
.cw-preview { position: relative; margin-top: 10px; border-radius: 8px; overflow: hidden; border: 1px solid #e1e5ea; background: #f3f3f4; }
.cw-preview[hidden] { display: none; }
.cw-preview img { display: block; width: 100%; max-height: 200px; object-fit: contain; }
.cw-preview button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(29,33,42,.8); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.cw-hint { margin: 8px 0 0; font-size: 11px; color: #888; }
.cw-legal { margin: 14px 0 0; font-size: 11px; line-height: 1.45; color: #555c63; }
.cw-legal a { color: inherit; text-decoration: underline; }
.cw-legal a:hover { color: var(--cw-primary); }
.grecaptcha-badge { visibility: hidden; }   /* reCAPTCHA v3: el aviso legal va dentro del formulario */
.cw-btn { display: block; width: 100%; margin-top: 18px; height: 40px; border: 0; border-radius: 30px; background: var(--cw-primary); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; transition: background .2s; }
.cw-btn:hover { background: #2862DD; }
.cw-alert { margin-top: 12px; padding: 10px 12px; border-radius: 4px; font-size: 13px; display: none; }
.cw-alert.cw-err { display: block; background: #f2dede; color: #a94442; }
.cw-success { text-align: center; padding: 10px 0; display: none; }
.cw-check { width: 64px; height: 64px; border-radius: 50%; background: #dff0d8; color: #27ae60; display: grid; place-items: center; font-size: 34px; margin: 0 auto 12px; }
.cw-code { display: inline-block; background: #eef3ff; color: var(--cw-primary); font-weight: 900; padding: 6px 16px; border-radius: 20px; margin: 8px 0; letter-spacing: 1px; }

#cw-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(30px); background: #1d212a; color: #fff; padding: 12px 20px; border-radius: 4px; font-size: 14px; opacity: 0; transition: .3s; z-index: 2300; pointer-events: none; max-width: 90vw; text-align: center; }
#cw-toast.cw-show { opacity: 1; transform: translateX(-50%); }

/* ===== Simulador de hora ===== */
#cw-sim { position: fixed; left: 16px; bottom: 16px; z-index: 2200; background: #0d1b3e; color: #fff; border-radius: 14px; padding: 14px 16px; width: 300px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#cw-sim.cw-min { width: auto; padding: 10px 14px; cursor: pointer; }
#cw-sim.cw-min .cw-sim-body { display: none; }
#cw-sim h6 { margin: 0; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--cw-yellow); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
#cw-sim h6 button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 16px; }
.cw-clock { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 6px 0 0; }
.cw-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 8px; }
.cw-dot { width: 9px; height: 9px; border-radius: 50%; background: #666; }
.cw-status.cw-on .cw-dot { background: #3ddc84; }
.cw-status.cw-off .cw-dot { background: #ff6b6b; }
#cw-sim input[type=range] { width: 100%; accent-color: var(--cw-yellow); margin: 6px 0; padding: 0; border: 0; }
.cw-sim-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cw-sim-row button { flex: 1; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; padding: 6px 4px; font: inherit; font-size: 12px; cursor: pointer; }
.cw-sim-row button:hover { background: rgba(255,255,255,.22); }
.cw-sim-row button.cw-active { background: var(--cw-yellow); color: #1c2333; font-weight: 700; }
.cw-cases-link { margin-top: 10px; display: block; text-align: center; color: #9fb2e8 !important; cursor: pointer; text-decoration: underline; }

@media (max-width: 700px) {
  #cw-sim { width: calc(100% - 32px); bottom: 88px; }
  #cw-sim.cw-min { width: auto; bottom: 16px; }
}
