/* Conta WavUps: o mesmo padrão das telas de acesso do CRM, do Mail e do Finance (formulário à esquerda, painel de
   marca à direita), com a identidade do design system (tokens/brand.json do wavups-design-system). A conta é de
   todos os produtos: o painel fala da WavUps inteira e o botão principal usa a onda nas cores do logo. */
:root {
  --ink: #0b1026;
  --ink-soft: #3a4163;
  --ink-muted: #565e80;
  --canvas: #fafafb;
  --foam: #f3f2fc;
  --line: rgba(11, 16, 38, 0.1);
  --field-line: rgba(11, 16, 38, 0.14);
  --white: #ffffff;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --wave: linear-gradient(135deg, #ff6b35 0%, #fd00e0 28%, #8b5cf6 55%, #3b82f6 78%, #06b6d4 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-swell: cubic-bezier(0.3, 0.7, 0.2, 1);
  /* Sem produto: preto com a onda inteira do logo. Vindo de um produto: a cor dele (abaixo). */
  --primary: var(--ink);
  --primary-fill: linear-gradient(100deg, #ff6b35 0%, #fd00e0 28%, #8b5cf6 55%, #3b82f6 78%, #06b6d4 100%);
  --accent: #8b5cf6;
  --accent-ring: rgba(139, 92, 246, 0.18);
  --link-hover: #7c3aed;
}

/* A cor de cada produto (brand.json: ink no botão, a onda líquida do produto no hover) */
body[data-product="crm"] { --primary: #6d28d9; --primary-fill: linear-gradient(100deg, #5b21b6, #4c1d95); --accent: #8b5cf6; --accent-ring: rgba(139, 92, 246, 0.2); --link-hover: #6d28d9; }
body[data-product="mail"] { --primary: #1d4ed8; --primary-fill: linear-gradient(100deg, #1e40af, #312e81); --accent: #3b82f6; --accent-ring: rgba(59, 130, 246, 0.2); --link-hover: #1d4ed8; }
body[data-product="finance"] { --primary: #0e7490; --primary-fill: linear-gradient(100deg, #155e75, #164e63); --accent: #06b6d4; --accent-ring: rgba(6, 182, 212, 0.2); --link-hover: #0e7490; }
body[data-product="marketing"] { --primary: #b3008f; --primary-fill: linear-gradient(100deg, #8f0072, #6b0055); --accent: #fd00e0; --accent-ring: rgba(253, 0, 224, 0.18); --link-hover: #b3008f; }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ───── Casca: formulário | painel de marca (o painel só a partir de 1024px) ───── */

.shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.side-form { display: flex; flex-direction: column; min-height: 100dvh; padding: 24px 16px; }
@media (min-width: 640px) { .side-form { padding: 24px 40px; } }

.brand { display: inline-flex; margin-left: -8px; }
.brand img { height: 40px; width: auto; }

.form-area { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.form-box { width: 100%; max-width: 384px; animation: rise 420ms var(--ease) both; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.footer { font-size: 13px; color: var(--ink-muted); }

.brand-panel {
  display: none;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--canvas);
  border-left: 1px solid var(--line);
}
@media (min-width: 1024px) { .brand-panel { display: flex; } }
@media (min-width: 1280px) { .brand-panel { padding: 48px 64px; } }

.glow {
  position: absolute;
  top: -128px;
  right: -128px;
  width: 520px;
  height: 520px;
  border-radius: 9999px;
  background: var(--wave);
  opacity: 0.16;
  filter: blur(100px);
  pointer-events: none;
}

.pitch { position: relative; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 448px; }
.pitch-title { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.pitch-text { margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink-muted); text-wrap: pretty; }

.wave-products { list-style: none; margin: 20px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.wave-products li { display: flex; align-items: center; gap: 12px; }
.wave-products img { width: 28px; height: 28px; flex-shrink: 0; }
.wave-products span { display: flex; flex-direction: column; font-size: 14px; color: var(--ink-muted); }
.wave-products strong { font-weight: 500; color: var(--ink); }

/* ───── Formulário ───── */

h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; font-weight: 600; color: var(--ink); }
@media (min-width: 640px) { h1 { font-size: 30px; } }

.lead { margin: 0 0 28px; font-size: 14px; line-height: 1.6; color: var(--ink-muted); }
.lead strong { color: var(--ink); font-weight: 500; }

form { display: flex; flex-direction: column; gap: 20px; margin: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.label-row a { font-weight: 500; font-size: 13px; }

input[type="email"], input[type="password"], input[type="text"], input[type="tel"] {
  font: inherit;
  font-size: 14px;
  height: 42px;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  box-shadow: inset 0 0 0 1px var(--field-line);
  outline: none;
}
input::placeholder { color: #9aa0b8; }
input:focus-visible, select:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-ring); }

select {
  font: inherit;
  font-size: 14px;
  height: 42px;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  box-shadow: inset 0 0 0 1px var(--field-line);
  outline: none;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 14px; font-weight: 500; color: var(--ink); }
.hint { font-size: 13px; font-weight: 400; color: var(--ink-muted); }

/* Celular: um campo só, como no CRM (bandeira e DDI dentro, o seletor nativo invisível por cima da bandeira) */
.phone-field {
  display: flex;
  align-items: center;
  height: 42px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--field-line);
}
.phone-field:focus-within { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-ring); }
.phone-field .country {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px 0 14px;
  color: var(--ink-muted);
  border-right: 1px solid var(--line);
}
.phone-field .country:hover { background: var(--foam); border-radius: 8px 0 0 8px; }
.phone-field .flag { width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(11, 16, 38, 0.08); }
.phone-field select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 14px;
}
.phone-field .ddi { padding: 0 0 0 12px; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.phone-field input[type="tel"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px 0 6px;
  box-shadow: none;
  background: transparent;
}
.phone-field input[type="tel"]:focus-visible { box-shadow: none; }

/* Aceite dos termos: a caixa do Kumo (quadrado arredondado, a cor do produto quando marcada), alinhada ao texto */
label.check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 400; color: var(--ink-soft); line-height: 1.5; cursor: pointer; }
label.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border-radius: 5px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--field-line);
  cursor: pointer;
  display: grid;
  place-content: center;
}
label.check input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--white);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2 4 7.6 8.5 2.6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2 4 7.6 8.5 2.6' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0);
  transition: transform 160ms var(--ease);
}
label.check input[type="checkbox"]:checked { background: var(--primary); box-shadow: none; }
label.check input[type="checkbox"]:checked::after { transform: scale(1); }
label.check input[type="checkbox"]:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-ring); }
label.check .check-text { flex: 1; }

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

/*
 * Botão líquido (o mesmo da landing wavups.com): no hover ou no foco a água sobe, com a borda em onda fluindo.
 * Principal: preto (ink) e a água no degradê do logo, a onda inteira, porque a conta é de todos os produtos.
 */
.liquid {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 10'%3E%3Cpath d='M0 10V5Q20 0 40 5T80 5V10Z'/%3E%3C/svg%3E");
}
.liquid::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 165%;
  z-index: -1;
  background: var(--liquid-fill);
  transform: translateY(104%);
  transition: transform 0.65s var(--ease-swell);
  -webkit-mask: var(--wave-mask) 0 0 / 80px 10px repeat-x, linear-gradient(#000 0 0) 0 9px / 100% 100% no-repeat;
  mask: var(--wave-mask) 0 0 / 80px 10px repeat-x, linear-gradient(#000 0 0) 0 9px / 100% 100% no-repeat;
  animation: liquid-flow 1.4s linear infinite;
  animation-play-state: paused;
}
.liquid:hover::before,
.liquid:focus-visible::before {
  transform: translateY(-14%);
  animation-play-state: running;
}
@keyframes liquid-flow {
  to { -webkit-mask-position: 80px 0, 0 9px; mask-position: 80px 0, 0 9px; }
}

.btn-primary {
  color: var(--white);
  background: var(--primary);
  --liquid-fill: var(--primary-fill);
}
.btn-primary:hover { color: var(--white); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-secondary {
  color: var(--ink);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--field-line);
  --liquid-fill: #e9e6fb;
}
.btn-secondary:hover { color: var(--ink); }

/* Loading: ao enviar, o botão clicado ganha um indicador girando e para de reagir a novos cliques */
.btn.is-loading { cursor: progress; pointer-events: none; }
.btn.is-loading:not(.btn-ghost)::before { transform: translateY(-14%); animation-play-state: running; }
.spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.9;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost { color: var(--ink-soft); background: transparent; }
.btn-ghost:hover { background: var(--foam); color: var(--ink); }

.prompt { margin: 28px 0 0; text-align: center; font-size: 14px; color: var(--ink-muted); }
.prompt a { font-weight: 500; }

.alert { border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.alert-error { color: var(--danger); background: var(--danger-bg); }
.alert-notice { color: var(--success); background: var(--success-bg); }

.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 20px; }
.person img, .avatar { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; flex-shrink: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; color: var(--white); font-weight: 600; background: var(--wave); }
.person .who { display: flex; flex-direction: column; min-width: 0; }
.person .who strong { color: var(--ink); font-weight: 500; }
.person .who span { font-size: 14px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stack { display: flex; flex-direction: column; gap: 10px; }

.products { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.products a { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); }
.products a:hover { background: var(--foam); }

.signouts { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .form-box { animation: none; }
  .spinner { animation-duration: 1.6s; }
  .liquid::before { transition: none; animation: none; }
}
