/* =============================================================
   SYNCCION — login / criar conta
   Cartão deslizante: entrar à esquerda, criar conta à direita,
   um painel colorido desliza por cima ao trocar de modo.
   Mesmo mundo da página principal: navy chapado, círculos azul
   e ciano, nada de brilho ou desfoque.
   ============================================================= */

:root {
  --navy: #0A2A4D;
  --blue: #1C5FCC;
  --blue-bright: #3B82F6;
  --blue-tint: #EAF2FF;
  --blue-line: #C7DBFA;
  --cyan: #7FE0EF;
  --ink: #0B1F33;
  --muted: #4B6682;
  --white: #FFFFFF;
  --danger: #D93636;   /* vermelho de texto: passa de 4,5:1 sobre branco */

  --font-body: 'IBM Plex Sans', system-ui, sans-serif;

  /* mesma escala de raios da página principal */
  --r-sm: 10px;
  --r-md: 18px;
  --r-xl: 36px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.65, 0, 0.35, 1);          /* painéis que deslizam */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* chegadas */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--navy);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }

::selection { background: var(--cyan); color: var(--navy); }
input { caret-color: var(--blue); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

/* Menos movimento, não zero: os painéis deixam de deslizar,
   cor e foco continuam respondendo. */
@media (prefers-reduced-motion: reduce) {
  .form-container, .overlay-container, .overlay, .overlay-panel { transition-duration: 0.01ms !important; }
  .btn-spinner { animation-duration: 1.8s; }
}

/* =============================================================
   FUNDO — navy chapado com os círculos da marca (os mesmos da
   cortina de entrada do site)
   ============================================================= */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}
body::before { width: 520px; height: 520px; background: var(--blue); left: -200px; bottom: -250px; }
body::after { width: 340px; height: 340px; background: var(--cyan); right: -110px; top: -150px; }

/* =============================================================
   VOLTAR
   ============================================================= */
.back-link {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #D6E6FF;
  font-size: 0.92rem;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.06);
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.back-link svg { transition: transform 0.2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .back-link:hover { color: var(--white); border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.12); }
  .back-link:hover svg { transform: translateX(-3px); }
}

/* =============================================================
   CARTÃO
   ============================================================= */
.auth-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 96px 20px 40px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 1040px;
  height: min(700px, 88vh);
  height: min(700px, 88dvh);
  background: var(--white);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 48px 90px -48px rgba(3, 12, 26, 0.75);
}

/* alerta de erro, flutua sobre o painel ativo */
.alert-box {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  white-space: nowrap;
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.alert-box[hidden] { display: none; }
.alert-box svg { flex-shrink: 0; }

/* =============================================================
   FORMULÁRIOS — posicionados lado a lado, trocam de lugar
   ============================================================= */
.form-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.7s var(--ease), opacity 0.65s var(--ease);
}
.form-container::-webkit-scrollbar { width: 6px; }
.form-container::-webkit-scrollbar-thumb { background: var(--blue-line); border-radius: 3px; }

.form-container form {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 46px;
}

.sign-in-container { z-index: 3; }

.sign-up-container {
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.auth-card.right-active .sign-in-container {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.auth-card.right-active .sign-up-container {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
  transition: transform 0.7s var(--ease), opacity 0.9s var(--ease);
}

.form-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 22px;
}
.form-logo svg { color: var(--blue); flex-shrink: 0; }

.form-container h1 { font-size: 2rem; line-height: 1.06; font-weight: 700; color: var(--navy); margin-bottom: 8px; letter-spacing: -0.03em; }
.form-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 22px; }

.mobile-switch { display: none; margin-top: 18px; text-align: center; font-size: 0.9rem; color: var(--muted); }

/* =============================================================
   PAINEL QUE DESLIZA (overlay)
   ============================================================= */
.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 20;
  transition: transform 0.7s var(--ease);
}
.auth-card.right-active .overlay-container { transform: translateX(-100%); }

.overlay {
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.7s var(--ease);
  color: var(--white);
  background: var(--navy);
}

/* formas chapadas da marca: zigue-zague azul e círculo ciano */
.overlay::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  background: var(--blue);
  clip-path: polygon(0% 38%, 8% 55%, 16% 30%, 24% 58%, 32% 25%, 40% 55%, 48% 20%, 56% 58%, 64% 22%, 72% 55%, 80% 28%, 88% 58%, 96% 25%, 100% 45%, 100% 100%, 0% 100%);
}
.overlay::after {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--cyan);
  top: -70px; right: 8%;
}
.overlay-dot {
  position: absolute;
  z-index: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-bright);
  bottom: 48px;
  left: 36px;
}
.auth-card.right-active .overlay { transform: translateX(50%); }

.overlay-panel {
  position: absolute;
  z-index: 2;
  top: 0;
  height: 100%;
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 42px;
  transition: transform 0.7s var(--ease);
}

.overlay-left { left: 0; transform: translateX(-18%); }
.auth-card.right-active .overlay-left { transform: translateX(0); }

.overlay-right { right: 0; transform: translateX(0); }
.auth-card.right-active .overlay-right { transform: translateX(18%); }

.overlay-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy);
}

.overlay-panel h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.overlay-panel p { font-size: 0.98rem; color: rgba(255,255,255,0.88); max-width: 30ch; margin-bottom: 26px; }

.btn-overlay {
  padding: 13px 32px;
  border-radius: var(--r-pill);
  border: 2px solid var(--cyan);
  background: transparent;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn-overlay:hover { background: var(--cyan); color: var(--navy); }
}
.btn-overlay:active { transform: scale(0.97); }

/* =============================================================
   CAMPOS — label flutuante
   ============================================================= */
.field { position: relative; margin-bottom: 15px; }

.field input {
  width: 100%;
  padding: 23px 16px 8px;
  border: 1.5px solid var(--blue-line);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 1rem; /* 16px: o iOS não dá zoom ao focar */
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .field input:hover { border-color: #9FBEEA; }
}
.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(28, 95, 204, 0.14);
}

.field label {
  position: absolute;
  left: 17px;
  top: 28px; /* meio do campo (55px), não da caixa inteira: a mensagem de erro não empurra o rótulo */
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.98rem;
  pointer-events: none;
  transition: top 0.2s var(--ease-out), transform 0.2s var(--ease-out), font-size 0.2s var(--ease-out), color 0.2s ease;
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
  top: 8px;
  transform: none;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--blue);
}

.field input[type="password"],
.field input[type="text"] { padding-right: 46px; }

.toggle-password {
  position: absolute;
  right: 6px;
  top: 7px;
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease;
}
@media (hover: hover) and (pointer: fine) {
  .toggle-password:hover { color: var(--blue); background: var(--blue-tint); }
}
.toggle-password .eye-slash { opacity: 0; transition: opacity 0.2s ease; }
.toggle-password[aria-pressed="true"] .eye-slash { opacity: 1; }

.error-msg {
  display: block;
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 5px;
  min-height: 0;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  overflow: hidden;
}
.field.has-error input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(217, 54, 54, 0.12); }
.field.has-error label { color: var(--danger); }
.field.has-error .error-msg { max-height: 40px; opacity: 1; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* =============================================================
   OPÇÕES / CHECKBOX
   ============================================================= */
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 20px;
  font-size: 0.88rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--blue-line);
  border-radius: 5px;
  background: var(--white);
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.check-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s var(--ease-out);
}
.check input:checked ~ .check-box { background: var(--blue); border-color: var(--blue); }
.check input:checked ~ .check-box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible ~ .check-box { outline: 2px solid var(--blue); outline-offset: 2px; }

.forgot-link { color: var(--blue); font-weight: 500; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .forgot-link:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* =============================================================
   BOTÃO PRINCIPAL
   ============================================================= */
.btn-submit {
  position: relative;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--r-pill);
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn-submit:hover { background: var(--navy); }
}
.btn-submit:active { transform: scale(0.98); }

.btn-spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  display: none;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-submit.is-loading { pointer-events: none; background: var(--navy); }
.btn-submit.is-loading .btn-spinner { display: block; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* =============================================================
   FORÇA DA SENHA
   ============================================================= */
.strength { margin: -5px 0 14px; }
.strength-bars { display: flex; gap: 6px; margin-bottom: 6px; }
.strength-bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--blue-line); transition: background-color 0.3s ease; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: #F59E0B; }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--blue-bright); }
.strength[data-score="4"] i:nth-child(-n+4) { background: #22C55E; }
.strength-label { font-size: 0.78rem; color: var(--muted); }

/* =============================================================
   PLANO — pills compactas
   ============================================================= */
.plan-pick { border: none; margin: 2px 0 16px; }
.plan-pick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.plan-pick legend { font-size: 0.88rem; font-weight: 600; color: var(--navy); }

.cycle-pick {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--blue-line);
  border-radius: var(--r-pill);
  background: var(--white);
}
.cycle-btn {
  border: none;
  background: none;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cycle-btn.is-active { background: var(--blue); color: var(--white); }

.plan-pills { display: flex; gap: 8px; }
.plan-pill { flex: 1; cursor: pointer; min-width: 0; }
.plan-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.plan-pill-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  border: 1.5px solid var(--blue-line);
  border-radius: var(--r-sm);
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.plan-pill input:checked ~ .plan-pill-box {
  border-color: var(--blue);
  background: var(--blue-tint);
}
.plan-pill input:focus-visible ~ .plan-pill-box { outline: 2px solid var(--blue); outline-offset: 2px; }
.plan-pill-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.plan-pill-name em {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--blue);
}
.plan-pill-price { font-size: 0.74rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* aceite */
.check.consent { align-items: flex-start; margin-bottom: 4px; font-size: 0.82rem; line-height: 1.4; }
.check.consent .check-box { margin-top: 2px; }
.check.consent a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.consent-error { margin: 0 0 10px; }
.consent-error.is-on { max-height: 40px; opacity: 1; }
.check.consent.has-error .check-box { border-color: var(--danger); }

/* =============================================================
   RODAPÉ
   ============================================================= */
.login-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 24px;
  font-size: 0.82rem;
  color: #D6E6FF;
}

/* =============================================================
   RESPONSIVO — abaixo de 860px o slide vira troca simples
   ============================================================= */
@media (max-width: 860px) {
  .auth-card { height: auto; min-height: 0; max-width: 480px; overflow: visible; }

  .overlay-container { display: none; }

  .form-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    transition: none;
  }
  .form-container form { padding: 40px 28px 32px; }

  .sign-up-container { display: none; opacity: 1; pointer-events: auto; }
  .auth-card.right-active .sign-in-container { display: none; transform: none; opacity: 1; }
  .auth-card.right-active .sign-up-container { display: block; transform: none; }

  .mobile-switch { display: block; }
  .alert-box { position: relative; top: auto; left: auto; transform: none; margin: 20px 28px 0; border-radius: var(--r-sm); white-space: normal; }

  body::before { width: 380px; height: 380px; left: -170px; bottom: -190px; }
  body::after { width: 240px; height: 240px; right: -90px; top: -110px; }
}

@media (max-width: 480px) {
  .auth-wrap { padding: 84px 14px 28px; }
  .form-container form { padding: 34px 20px 26px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .options-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .plan-pick-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .back-link { top: 16px; left: 16px; }
}
