/* Sant'Anna Góes - Floating Widget (DEFINITIVO) */
:root{
  --sgw-z: 999999;
  --sgw-radius: 18px;
  --sgw-shadow: 0 10px 30px rgba(0,0,0,.25);
  --sgw-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#sgw-root{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--sgw-z);
  font-family: var(--sgw-font);
}

#sgw-fab{
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  background: #58c472;
  color: #fff;
  box-shadow: var(--sgw-shadow);
  position: relative;
  overflow: visible;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  will-change: transform, box-shadow;
}

#sgw-fab:focus{
  outline: 2px solid rgba(255,255,255,.6);
  outline-offset: 3px;
}

/* PULSO AUTOMÁTICO: fechado = pulsa sempre */
#sgw-root:not(.sgw-open) #sgw-fab{
  animation: sgwFabBeat 1.9s infinite ease-in-out;
}

#sgw-root:not(.sgw-open) #sgw-fab::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  pointer-events:none;
  animation: sgwFabRing 1.9s infinite ease-out;
}

/* Passou o mouse = para o pulso e cresce */
#sgw-root:not(.sgw-open):hover #sgw-fab,
#sgw-root:not(.sgw-open):hover #sgw-fab::after{
  animation: none;
}

#sgw-root:not(.sgw-open) #sgw-fab:hover{
  transform: scale(1.08);
  filter: brightness(1.05);
}

/* Submenu aberto = sem pulso */
#sgw-root.sgw-open #sgw-fab,
#sgw-root.sgw-open #sgw-fab::after{
  animation: none;
}

@keyframes sgwFabBeat {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
  }
  30% {
    transform: scale(1.045);
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
  }
  55% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
  }
}

@keyframes sgwFabRing {
  0% {
    box-shadow: 0 0 0 0 rgba(88,196,114,0.30);
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 12px rgba(88,196,114,0);
    opacity: 0.4;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(88,196,114,0);
    opacity: 0;
  }
}

#sgw-actions{
  position:absolute;
  right: 0;
  bottom: 70px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events:none;
  transition: .18s ease;
}

#sgw-root.sgw-open #sgw-actions{
  opacity: 1;
  transform: translateY(0);
  pointer-events:auto;
}

.sgw-action{
  display:flex;
  align-items:center;
  gap:10px;
  background: rgba(20,20,20,.92);
  color:#fff;
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: var(--sgw-shadow);
  cursor:pointer;
  border:0;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.sgw-action:hover{
  transform: scale(1.06);
  filter: brightness(1.08);
}

.sgw-pill{
  font-size: 13px;
  white-space:nowrap;
  opacity:.95;
}

.sgw-ico{
  width: 20px;
  height: 20px;
  display:inline-block;
}

.sgw-tooltip{
  position:absolute;
  right: 70px;
  bottom: 14px;
  background: rgba(20,20,20,.92);
  color:#fff;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: var(--sgw-shadow);
  opacity:0;
  transform: translateX(6px);
  pointer-events:none;
  transition:.18s ease;
}

#sgw-root:hover .sgw-tooltip{
  opacity:1;
  transform: translateX(0);
}

/* Modal */
#sgw-modal{
  position: fixed;
  inset:0;
  z-index: var(--sgw-z);
  display:none;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.45);
  padding: 18px;
}

#sgw-modal.sgw-show{ display:flex; }

#sgw-modal-card{
  width: min(520px, 100%);
  border-radius: 20px;
  background: #0f1115;
  color:#fff;
  box-shadow: var(--sgw-shadow);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.08);
}

#sgw-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  background:#141824;
}

#sgw-modal-title{
  font-weight: 650;
  font-size: 14px;
  letter-spacing:.2px;
}

#sgw-modal-close{
  background: transparent;
  border:0;
  color:#fff;
  font-size: 22px;
  cursor:pointer;
  opacity:.9;
}

#sgw-modal-body{ padding: 14px 16px 16px; }
.sgw-note{ font-size:12px; opacity:.85; line-height:1.35; margin: 0 0 12px; }
.sgw-row{ display:flex; gap:10px; }
.sgw-row > div{ flex:1; }
.sgw-label{ font-size:12px; opacity:.9; margin: 0 0 6px; }

.sgw-input, .sgw-textarea, .sgw-select{
  width:100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background:#0b0d12;
  color:#fff;
  padding: 10px 12px;
  font-size:14px;
}
.sgw-textarea{ min-height: 92px; resize: vertical; }

.sgw-actions2{ display:flex; gap:10px; margin-top: 12px; }

.sgw-btn{
  flex:1;
  border:0;
  border-radius: 14px;
  padding: 11px 12px;
  cursor:pointer;
  background: #2b7cff;
  color:#fff;
  font-weight: 650;
}

.sgw-btn.secondary{ background:#23283a; }
.sgw-btn:disabled{ opacity:.6; cursor:not-allowed; }
.sgw-status{ margin-top:10px; font-size: 13px; }
.sgw-ok{ color:#6fe28c; }
.sgw-err{ color:#ff6b6b; }

@media (max-width: 520px){
  #sgw-root{ right: 16px; bottom: 16px; }
  .sgw-row{ flex-direction:column; }
}

@media (prefers-reduced-motion: reduce){
  .sgw-action,
  #sgw-fab{
    transition: none;
  }
}
