/* ==========================================================================
   Turbina Social — telas de acesso (login, cadastro, recuperar senha, ativação)
   Mobile-first: no celular é um cartão de formulário sobre fundo suave; a partir de
   960px ganha o painel de marca ao lado. Depende de ts-ui.css.
   ========================================================================== */

.ts-auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--soft); }

/* ---------- painel de marca (só desktop) ---------- */
.ts-auth__brand { display: none; }

/* ---------- coluna do formulário ---------- */
.ts-auth__main { display: flex; flex-direction: column; align-items: center; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); }
.ts-auth__top { width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 4px 20px; }
.ts-auth__logo-d img { height: 34px; width: auto; }
.ts-auth__back { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--body); padding: 8px 4px; }
.ts-auth__back:hover { color: var(--brand); }
.ts-flip { transform: scaleX(-1); }

.ts-auth__card {
  width: 100%; max-width: 480px; background: #fff; border: 1px solid var(--line); border-radius: 26px;
  padding: 26px 20px 22px; box-shadow: 0 30px 60px -38px rgba(76, 29, 149, .55);
}
.ts-auth__card h1 { font-size: clamp(1.55rem, 6vw, 1.95rem); margin-bottom: 6px; }
.ts-auth__sub { color: var(--muted); font-size: .96rem; margin-bottom: 22px; line-height: 1.55; }

.ts-auth__perks--m { width: 100%; max-width: 480px; margin: 22px 0 0; display: grid; gap: 10px; padding: 0 6px; }
.ts-auth__perks--m li { display: flex; align-items: center; gap: 10px; font-size: .86rem; font-weight: 600; color: var(--body); }
.ts-auth__perks--m li span { width: 30px; height: 30px; border-radius: 10px; background: var(--soft-2); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ts-auth__legal { margin-top: 18px; font-size: .8rem; color: var(--muted); text-align: center; }
.ts-auth__legal a { color: var(--muted); }
.ts-auth__legal a:hover { color: var(--brand); }

/* ---------- formulário ---------- */
.ts-auth .ts-field { margin-bottom: 16px; }
.ts-auth .ts-field > label { display: block; margin: 0 0 6px; font-size: .84rem; font-weight: 700; color: var(--ink); }
.ts-auth .ts-field input[type=email], .ts-auth .ts-field input[type=password], .ts-auth .ts-field input[type=text], .ts-auth .ts-field select {
  width: 100%; height: 52px; padding: 0 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: var(--soft); color: var(--ink); font: 500 1rem var(--font); -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ts-auth .ts-field select {
  padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%237a7491' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; text-overflow: ellipsis;
}
.ts-auth .ts-field input:focus, .ts-auth .ts-field select:focus { outline: none; border-color: var(--brand); background-color: #fff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.ts-pass { position: relative; }
.ts-pass input { padding-right: 52px !important; }
.ts-pass__btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.ts-pass__btn:hover { color: var(--brand); }
.ts-pass__btn.is-on { color: var(--brand); }
.ts-auth .ts-row2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.ts-auth__hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

.ts-check { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; cursor: pointer; font-size: .9rem; line-height: 1.5; color: var(--body); }
.ts-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ts-check__box { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid #cfc6ea; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: transparent; margin-top: 1px; transition: background .15s, border-color .15s; }
.ts-check input:checked + .ts-check__box { background: var(--grad); border-color: transparent; color: #fff; }
.ts-check input:focus-visible + .ts-check__box { outline: 3px solid rgba(124, 58, 237, .45); outline-offset: 2px; }

.ts-auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; font-size: .9rem; }
.ts-auth__row .ts-check { margin: 0; }
.ts-auth__row > a { color: var(--brand); font-weight: 700; white-space: nowrap; }
.ts-auth .ts-btn--block { min-height: 54px; font-size: 1.02rem; }
.ts-auth__alt { text-align: center; margin-top: 18px; font-size: .93rem; color: var(--muted); }
.ts-auth__alt a { color: var(--brand); font-weight: 700; }
.ts-auth .g-recaptcha { margin-bottom: 16px; transform-origin: left top; }
@media (max-width: 380px) { .ts-auth .g-recaptcha { transform: scale(.88); } }

/* botão em carregamento (a classe é posta pelo general.js durante o envio) */
.ts .ts-btn.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.ts .ts-btn.btn-loading::after {
  content: ""; position: absolute; width: 22px; height: 22px; left: 50%; top: 50%; margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: ts-spin .7s linear infinite;
}
.ts .ts-btn--ghost.btn-loading::after { border-color: rgba(124, 58, 237, .25); border-top-color: var(--brand); }
@keyframes ts-spin { to { transform: rotate(360deg); } }

/* mensagens (process.js injeta .alert dentro de .alert-message-reponse) */
.ts-auth .alert-message-reponse:empty { display: none; }
.ts-auth .alert-message-reponse { margin-bottom: 16px; }
.ts-auth .alert-message-reponse .alert { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: .9rem; font-weight: 600; line-height: 1.45; border: 1px solid transparent; }
.ts-auth .alert-message-reponse .alert .icon-symbol { display: none; }
.ts-auth .alert-message-reponse .alert-warning { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.ts-auth .alert-message-reponse .alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.ts-auth .alert-message-reponse .d-none { display: none !important; }

/* login social */
.ts-social { margin-top: 18px; }
.ts-or { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.ts-or i { flex: 1; height: 1px; background: var(--line); }
.ts-btn--google { gap: 10px; }
.ts-btn--google img { width: 22px; height: 22px; }

/* sucesso (ativação de conta) */
.ts-auth__ok { text-align: center; padding: 8px 0 2px; }
.ts-auth__ok-ico { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.ts-auth__ok h1 { margin-bottom: 8px; }
.ts-auth__ok .ts-btn { margin-top: 20px; }

/* ---------- desktop: painel de marca ao lado ---------- */
@media (min-width: 520px) {
  .ts-auth .ts-row2 { grid-template-columns: 1fr 1fr; }
  .ts-auth__card { padding: 34px 32px 28px; }
}
@media (min-width: 960px) {
  .ts-auth { grid-template-columns: minmax(400px, 46%) 1fr; background: #fff; }
  .ts-auth__main { justify-content: center; padding: 28px 40px; background: var(--soft); position: relative; }
  .ts-auth__top { position: absolute; top: 0; left: 0; right: 0; max-width: none; padding: 26px 40px; justify-content: flex-end; }
  .ts-auth__logo-d { display: none; }
  .ts-auth__perks.ts-auth__perks--m { display: none; }
  .ts-auth__legal { margin-top: 22px; }

  .ts-auth__brand {
    position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
    padding: 36px 44px; color: #fff; overflow: hidden; isolation: isolate;
    background: linear-gradient(155deg, #1a0f3a 0%, #4c1d95 52%, #a21caf 125%);
  }
  .ts-auth__brand::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(160deg, #000, transparent 75%); mask-image: linear-gradient(160deg, #000, transparent 75%); }
  .ts-auth__brand::after { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; border-radius: 50%; background: #ec4899; opacity: .28; filter: blur(110px); right: -180px; bottom: -160px; }
  .ts-auth__logo img { height: 38px; width: auto; }
  .ts-auth__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); font-size: .8rem; font-weight: 700; color: #f3e8ff; margin-bottom: 20px; }
  .ts-auth__eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .25); }
  .ts-auth__pitch h2 { color: #fff; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.1; margin-bottom: 14px; max-width: 16ch; }
  .ts-auth__pitch p { color: rgba(255, 255, 255, .78); font-size: 1.05rem; max-width: 40ch; margin-bottom: 26px; line-height: 1.6; }
  .ts-auth__perks { display: grid; gap: 14px; }
  .ts-auth__perks li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: #fff; font-size: .98rem; }
  .ts-auth__perks li span { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .12); display: inline-flex; align-items: center; justify-content: center; color: #f0abfc; flex: none; }

  .ts-auth__art { position: relative; height: 150px; }
  .ts-auth__chip { position: absolute; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; background: #fff; color: var(--ink); border-radius: 16px; font-size: .84rem; font-weight: 800; box-shadow: 0 18px 34px -16px rgba(0, 0, 0, .55); white-space: nowrap; animation: ts-bob 5.5s ease-in-out infinite; }
  .ts-auth__chip small { display: block; font-weight: 600; color: var(--muted); font-size: .7rem; line-height: 1.1; }
  .ts-auth__chip .ts-kind { width: 34px; height: 34px; border-radius: 10px; }
  .ts-auth__chip--a { top: 0; left: 0; }
  .ts-auth__chip--b { top: 46px; left: 150px; animation-delay: -1.8s; }
  .ts-auth__chip--c { top: 92px; left: 14px; animation-delay: -3.4s; }
}
@keyframes ts-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (min-width: 960px) and (max-height: 700px) { .ts-auth__art { display: none; } }
