/* ==========================================================================
   AGUS – Modal de lead e formulários (arquivo único para todas as páginas)
   A marcação do modal é injetada por assets/js/agus-lead.js
   ========================================================================== */

/* Modal Overlay */
.agus-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(1, 18, 41, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.agus-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Container */
.agus-modal-container {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: linear-gradient(145deg, #021a3a 0%, #011229 100%);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(8, 102, 229, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  text-align: left;
}
.agus-modal-overlay.active .agus-modal-container {
  transform: translateY(0) scale(1);
}

/* Close button */
.agus-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.agus-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Modal Header */
.agus-modal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.agus-modal-heading {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  line-height: 1.3;
}
.agus-modal-subheading {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* Modal Form */
.agus-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agus-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .agus-form-row {
    grid-template-columns: 1fr;
  }
}
.agus-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.agus-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}
.agus-form-input,
.agus-form-select,
.agus-form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.agus-form-select option {
  background: #011229;
  color: #ffffff;
}
.agus-form-input:focus,
.agus-form-select:focus,
.agus-form-textarea:focus {
  border-color: #0866e5;
  box-shadow: 0 0 0 3px rgba(8, 102, 229, 0.25);
  background: rgba(255, 255, 255, 0.08);
}
.agus-modal-submit-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agus-modal-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(37, 211, 102, 0.45);
}

/* Estado de envio (todos os formulários) */
form[data-agus-form] button[type="submit"][disabled] {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

/* Campo anti-spam (honeypot) */
.agus-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mensagem de erro de envio */
.agus-form-error {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid #ef4444;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}
.agus-form-error[hidden] { display: none; }
.agus-form-error strong { display: block; margin-bottom: 4px; }
.agus-modal-form .agus-form-error {
  margin-top: 0;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}
.agus-form-error-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #25d366;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
}
.agus-form-error-wa:hover { background: #1ebe5b; }

/* ==========================================================================
   Banner de consentimento (LGPD) – injetado por agus-lead.js em todas as páginas
   ========================================================================== */
.lgpd-banner {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(1120px, calc(100% - 32px));
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-50%, 28px, 0) scale(0.98);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  text-align: left;
}
.lgpd-banner.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0) scale(1);
}
.lgpd-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  color: #ffffff;
  background: rgba(1, 18, 41, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 12, 34, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.lgpd-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.22);
}
.lgpd-copy strong { display: block; margin-bottom: 3px; font-size: 0.98rem; color: #ffffff; }
.lgpd-copy p { margin: 0; color: rgba(255, 255, 255, 0.76); font-size: 0.82rem; line-height: 1.5; }
.lgpd-copy a { color: #00e5ff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lgpd-actions { display: flex; align-items: center; gap: 10px; }
.lgpd-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.lgpd-btn:hover { transform: translateY(-2px); }
.lgpd-btn-secondary { border: 1px solid rgba(255, 255, 255, 0.25); }
.lgpd-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.5); }
.lgpd-btn-primary { background: #0866e5; box-shadow: 0 8px 22px rgba(8, 102, 229, 0.32); }
.lgpd-btn-primary:hover { background: #238aff; }
body.lgpd-visible .whatsapp-float-btn { bottom: calc(126px + env(safe-area-inset-bottom)); }
body.lgpd-visible .mobile-sticky-bar { display: none; }

@media (max-width: 760px) {
  .lgpd-banner { width: calc(100% - 24px); bottom: calc(12px + env(safe-area-inset-bottom)); }
  .lgpd-card { grid-template-columns: 1fr; gap: 12px; padding: 17px; }
  .lgpd-icon { display: none; }
  .lgpd-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .lgpd-btn { width: 100%; white-space: normal; }
  body.lgpd-visible .whatsapp-float-btn { bottom: calc(248px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .lgpd-copy p { font-size: 0.77rem; }
  .lgpd-actions { grid-template-columns: 1fr; }
  body.lgpd-visible .whatsapp-float-btn { bottom: calc(304px + env(safe-area-inset-bottom)); }
}

/* Imagens com width/height no HTML: mantém a proporção sem mudar o tamanho
   definido pelo CSS de cada página (:where tem especificidade zero). */
:where(img[width][height]) { height: auto; }

/* <picture> com WebP: não altera o layout (a <img> continua sendo o item de layout) */
picture.agus-pic { display: contents; }

/* ==========================================================================
   Perguntas de qualificação (ERP em botões, release, prioridade, cargo)
   ========================================================================== */
.agus-choice {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agus-choice[hidden] { display: none; }
.agus-choice legend { padding: 0; margin-bottom: 8px; }
.agus-choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.agus-chip { position: relative; cursor: pointer; }
.agus-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.agus-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--chip-border, rgba(255, 255, 255, 0.2));
  background: var(--chip-bg, rgba(255, 255, 255, 0.05));
  color: var(--chip-color, #ffffff);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.agus-chip:hover span { border-color: #0866e5; }
.agus-chip input:checked + span {
  background: #0866e5;
  border-color: #0866e5;
  color: #ffffff;
}
.agus-chip input:focus-visible + span {
  outline: 3px solid rgba(0, 229, 255, 0.6);
  outline-offset: 2px;
}

/* Versão clara (formulário da página de contato) */
.contact-form-card .agus-qualifier {
  --chip-border: #cbd5e1;
  --chip-bg: #f8fafc;
  --chip-color: #021a3a;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}
.contact-form-card .agus-qualifier .agus-form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #021a3a;
}
.contact-form-card .agus-qualifier .agus-form-group { gap: 8px; }
.contact-form-card .agus-qualifier .agus-form-input,
.contact-form-card .agus-qualifier .agus-form-select {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.95rem;
}
.contact-form-card .agus-qualifier .agus-form-input:focus,
.contact-form-card .agus-qualifier .agus-form-select:focus {
  border-color: #064bc4;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(6, 75, 196, 0.12);
}
.contact-form-card .agus-qualifier .agus-form-select option { background: #ffffff; color: #0f172a; }

/* Mesma versão clara no formulário da lp.html */
.hero-form-card .agus-qualifier {
  --chip-border: #cbd5e1;
  --chip-bg: #f8fafc;
  --chip-color: #021a3a;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}
.hero-form-card .agus-qualifier .agus-form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #021a3a;
}
.hero-form-card .agus-qualifier .agus-form-group { gap: 8px; }
.hero-form-card .agus-qualifier .agus-form-input,
.hero-form-card .agus-qualifier .agus-form-select {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.95rem;
}
.hero-form-card .agus-qualifier .agus-form-input:focus,
.hero-form-card .agus-qualifier .agus-form-select:focus {
  border-color: #064bc4;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(6, 75, 196, 0.12);
}
.hero-form-card .agus-qualifier .agus-form-select option { background: #ffffff; color: #0f172a; }
