/* contato-widget.css — widget flutuante de contato (Manual Popup de Contato, seção 12) · MG Digital, 2026-11
 * Celular (< 640px): gaveta que sobe de baixo, largura toda, 85svh, área segura do iPhone.
 * Computador: cartão de até 360px colado no canto direito.
 * Campos com 16px no celular (evita o zoom automático do iOS). Hover só com sombra. */

.gstw { --gstw-gold: var(--color-primary, #C08D48); --gstw-gold-dark: var(--color-primary-dark, #9D733B); --gstw-ink: var(--color-secondary, #2B2B29);
	--gstw-text: var(--color-text, #1A1A1A); --gstw-muted: var(--color-text-muted, #57534E); --gstw-line: var(--color-border, #E5E1DA);
	--gstw-soft: var(--color-bg-alt, #F6F4F1); --gstw-ease: cubic-bezier(0.22, 1, 0.36, 1);
	font-family: var(--font-body, Inter, sans-serif); color: var(--gstw-text); line-height: 1.45; }
.gstw [hidden] { display: none !important; }
.gstw *, .gstw *::before, .gstw *::after { box-sizing: border-box; }
html.gstw-locked { overflow: hidden; scroll-behavior: auto; }

/* Botão flutuante */
.gstw-fab { position: fixed; right: 24px; bottom: 24px; z-index: 10002; width: 56px; height: 56px; border: 0; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--gstw-gold); color: var(--gstw-ink);
	box-shadow: 0 8px 22px rgba(0, 0, 0, .25); transition: box-shadow .3s var(--gstw-ease); }
.gstw-fab:hover { box-shadow: 0 14px 30px rgba(192, 141, 72, .55); }
.gstw-fab svg { width: 28px; height: 28px; }
.gstw.is-open .gstw-fab { visibility: hidden; }
.gstw-fab:focus-visible, .gstw-x:focus-visible, .gstw-send:focus-visible, .gstw-planb:focus-visible, .gstw-teaser__open:focus-visible {
	outline: 3px solid var(--gstw-gold); outline-offset: 3px; }

/* Avatar com bolinha de "online" */
.gstw-avatar { position: relative; flex: none; width: 40px; height: 40px; }
.gstw-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--gstw-gold); display: block; }
.gstw-avatar i { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.gstw-avatar--sm { width: 36px; height: 36px; }

/* Teaser (balão proativo) */
.gstw-teaser { position: fixed; right: 24px; bottom: 96px; z-index: 10001; width: min(84vw, 300px); background: #fff; border-radius: 16px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .22); padding: 12px 12px 10px; animation: gstw-fade-in .4s var(--gstw-ease) both; }
.gstw-teaser__top { display: flex; align-items: center; gap: 10px; }
.gstw-teaser__who { flex: 1; display: grid; line-height: 1.2; }
.gstw-teaser__who strong { font: 700 .95rem var(--font-heading, Montserrat, sans-serif); color: var(--gstw-ink); }
.gstw-teaser__who small { font-size: .75rem; color: var(--gstw-muted); }
.gstw-teaser__open { display: block; width: 100%; margin-top: 8px; text-align: left; border: 0; cursor: pointer; background: var(--gstw-soft);
	border-radius: 14px 14px 14px 4px; padding: 10px 12px; font: inherit; font-size: .9rem; color: var(--gstw-text); min-height: 42px; }
.gstw-teaser .gstw-typing { display: none; }
.gstw-teaser.is-typing .gstw-typing { display: inline-flex; }
.gstw-typing { gap: 4px; align-items: center; height: 20px; }
.gstw-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gstw-muted); animation: gstw-typing 1.2s ease-in-out infinite; }
.gstw-typing i:nth-child(2) { animation-delay: .2s; }
.gstw-typing i:nth-child(3) { animation-delay: .4s; }

/* Botões de fechar */
.gstw-x { flex: none; width: 36px; height: 36px; border: 0; background: none; cursor: pointer; font-size: 1.6rem; line-height: 1; color: inherit; border-radius: 50%; }
.gstw-teaser__x { color: var(--gstw-muted); }

/* Popup */
.gstw-overlay { position: fixed; inset: 0; z-index: 10003; background: rgba(0, 0, 0, .25); }
.gstw-dialog { position: fixed; z-index: 10004; inset: auto 0 0 0; width: 100%; max-height: 85svh; display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
	animation: gstw-fade-in .35s var(--gstw-ease) both; }
.gstw-dialog:focus { outline: none; }
.gstw-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; background: var(--gstw-ink); color: #fff; }
.gstw-head__txt { flex: 1; min-width: 0; }
.gstw-title { margin: 0; font: 700 1rem var(--font-heading, Montserrat, sans-serif); display: flex; align-items: center; gap: 8px; color: #fff; }
.gstw-sub { margin: 2px 0 0; font-size: .8rem; color: rgba(255, 255, 255, .72); }
.gstw-ping { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.gstw-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; opacity: .3; animation: gstw-ping 2.8s ease-out infinite; }
.gstw-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px; }
.gstw-bubble { margin: 0 0 14px; background: var(--gstw-soft); border-radius: 4px 16px 16px 16px; padding: 10px 13px; font-size: .92rem; color: var(--gstw-text); }

/* Formulário */
.gstw-form { margin: 0; display: grid; gap: 10px; }
.gstw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.gstw-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: start; }
.gstw-field input, .gstw-field select { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1.5px solid var(--gstw-line);
	border-radius: var(--radius, 8px); background: var(--gstw-soft); color: var(--gstw-text); margin: 0; height: 46px; }
.gstw-field select { appearance: auto; }
.gstw-field input:focus, .gstw-field select:focus { outline: none; border-color: var(--gstw-gold); box-shadow: 0 0 0 3px rgba(192, 141, 72, .25); background: #fff; }
.gstw-field [aria-invalid="true"], .gstw-field [aria-invalid="true"]:focus { border-color: #dc2626; }
.gstw-field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
.gstw-err { margin: 4px 0 0; font-size: .75rem; color: #b91c1c; }
.gstw-err:empty { display: none; }
.gstw-send { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--gstw-gold); color: var(--gstw-ink); font: 700 1rem var(--font-heading, Montserrat, sans-serif); transition: box-shadow .3s var(--gstw-ease); }
.gstw-send:hover { box-shadow: 0 10px 24px rgba(192, 141, 72, .45); }
.gstw-send:disabled { opacity: .65; cursor: wait; }
.gstw-send svg { width: 20px; height: 20px; }
.gstw-alert { margin: 0; font-size: .85rem; color: #b91c1c; font-weight: 600; }
.gstw-alert:empty { display: none; }
.gstw-consent { margin: 0; font-size: .72rem; color: var(--gstw-muted); line-height: 1.4; }
.gstw-consent a { color: var(--gstw-gold-dark); }

/* Sucesso + plano B */
.gstw-success { background: #ecfdf3; color: #14532d; border-radius: 12px; padding: 14px; font-size: .92rem; }
.gstw-success p { margin: 0 0 8px; }
.gstw-success__ok { font-weight: 700; }
.gstw-success strong { white-space: nowrap; }
.gstw-planb { display: inline-block; font: inherit; font-weight: 700; color: #14532d; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }

/* Computador: cartão de 360px no canto */
@media (min-width: 640px) {
	.gstw-dialog { inset: auto 24px 96px auto; width: min(92vw, 360px); max-height: min(600px, calc(100dvh - 7rem)); border-radius: 18px; padding-bottom: 0;
		box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
	.gstw-overlay { background: rgba(0, 0, 0, .12); }
	.gstw-field input, .gstw-field select { font-size: 14px; height: 42px; }
	.gstw.is-open .gstw-fab { visibility: visible; z-index: 10005; }
}
@media (max-width: 380px) {
	.gstw-row { grid-template-columns: 1fr; }
}

@keyframes gstw-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes gstw-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes gstw-ping { 0% { transform: scale(1); opacity: .3; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	.gstw *, .gstw *::before, .gstw *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
