/* TBS GROUP · Playbook — tela de login
   Tokens do site tbsgroup.marketing (Astro), mesma família visual. */
:root {
  --graphite: #17191c;
  --graphite-2: #1e2125;
  --graphite-3: #272b30;
  --chalk: #ecebe6;
  --chalk-2: rgba(236, 235, 230, .74);
  --chalk-3: rgba(236, 235, 230, .56);
  --line-sheet: rgba(236, 235, 230, .14);
  --line-sheet-2: rgba(236, 235, 230, .3);
  --coral: #ff5b31;
  --coral-hover: #ff734d;
  --coral-press: #e84a22;
  --error-on-dark: #ff8a80;
  --ff: "Poppins", Arial, sans-serif;
  --ff-tech: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --r-control: 4px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-state: .15s;
  --t-move: .24s;
  --margin: clamp(20px, 4vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--graphite); color: var(--chalk);
  font: 400 1rem/1.6 var(--ff); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--coral); color: var(--graphite); }
a { color: var(--chalk); text-underline-offset: 3px; text-decoration-color: var(--line-sheet-2); transition: text-decoration-color var(--t-state) var(--ease-out); }
a:hover { text-decoration-color: var(--coral); }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 2px; }

/* ---------- composição ---------- */
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: 1fr auto;
  padding: max(var(--margin), env(safe-area-inset-top)) var(--margin) max(24px, env(safe-area-inset-bottom));
  /* grade fina do site: duas réguas verticais que enquadram o formulário */
  background:
    linear-gradient(var(--line-sheet), var(--line-sheet)) calc(50% - 232px) 0 / 1px 100% no-repeat,
    linear-gradient(var(--line-sheet), var(--line-sheet)) calc(50% + 232px) 0 / 1px 100% no-repeat,
    var(--graphite);
}
.gate__inner {
  align-self: center; justify-self: center;
  width: 100%; max-width: 400px;
  animation: enter .6s var(--ease-out) both;
}
.gate__brand { display: inline-flex; border-radius: var(--r-control); margin-bottom: 40px; }
.gate__brand img { display: block; width: 56px; height: 56px; }

.gate__title {
  margin: 0 0 12px;
  font: 600 clamp(2rem, 1.5rem + 2.1vw, 2.75rem)/1.08 var(--ff);
  letter-spacing: -.02em; text-wrap: balance;
}
.gate__lead { margin: 0 0 36px; color: var(--chalk-2); font-size: .9375rem; text-wrap: pretty; max-width: 34ch; }

/* ---------- campo ---------- */
.field { display: grid; gap: 8px; }
.field label { font: 500 .875rem/1.3 var(--ff); color: var(--chalk); }
.field__control { position: relative; }
.field input {
  width: 100%; height: 52px; padding: 0 52px 0 16px;
  font: 400 16px var(--ff); letter-spacing: .02em; color: var(--chalk);
  background: var(--graphite-2); border: 1px solid var(--line-sheet-2); border-radius: var(--r-control);
  caret-color: var(--coral); outline: none;
  transition: border-color var(--t-state) var(--ease-out), box-shadow var(--t-state) var(--ease-out), background-color var(--t-state) var(--ease-out);
}
.field input:hover { border-color: rgba(236, 235, 230, .5); }
.field input:focus { border-color: var(--coral); background: var(--graphite-3); box-shadow: 0 0 0 4px rgba(255, 91, 49, .22); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--chalk); -webkit-box-shadow: 0 0 0 1000px var(--graphite-3) inset; caret-color: var(--coral); }

.field__toggle {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--chalk-3); cursor: pointer;
  transition: color var(--t-state) var(--ease-out), background-color var(--t-state) var(--ease-out);
}
.field__toggle:hover { color: var(--chalk); background: var(--graphite-3); }
.field__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.field__toggle .i-hide { display: none; }
.field__toggle[aria-pressed="true"] .i-show { display: none; }
.field__toggle[aria-pressed="true"] .i-hide { display: block; }

.field__error {
  min-height: 1.4em; margin: 2px 0 0;
  font: 500 .875rem/1.4 var(--ff); color: var(--error-on-dark);
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--t-move) var(--ease-out), transform var(--t-move) var(--ease-out);
}
.has-error .field__error { opacity: 1; transform: none; }
.has-error .field input { border-color: var(--error-on-dark); }
.has-error .field input:focus { box-shadow: 0 0 0 4px rgba(255, 138, 128, .2); }
.has-error .field__control { animation: nudge .32s var(--ease-out); }

/* ---------- botão (mesmo .btn do site) ---------- */
.btn {
  --h: 52px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--h); margin-top: 16px; padding: 0 24px;
  border: 1px solid transparent; border-radius: var(--r-control);
  font: 600 1rem/1.25 var(--ff); cursor: pointer; white-space: nowrap;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
  transition: background-color var(--t-state) var(--ease-out), color var(--t-state) var(--ease-out), transform var(--t-state) var(--ease-out);
}
.btn-primary { background: var(--coral); color: var(--graphite); }
@media (hover: hover) { .btn-primary:hover { background: var(--coral-hover); } }
.btn-primary:active { background: var(--coral-press); transform: translateY(1px); }
.btn:disabled { cursor: progress; }
.btn__busy {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(23, 25, 28, .3); border-top-color: var(--graphite);
  animation: spin .7s linear infinite;
}
.btn.is-busy .btn__busy { display: inline-block; }

.gate__help { margin: 28px 0 0; font-size: .875rem; color: var(--chalk-3); }

/* ---------- rodapé técnico ---------- */
.gate__foot span { white-space: nowrap; }
.gate__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding-top: 24px; border-top: 1px solid var(--line-sheet);
  font: 500 .8125rem/1 var(--ff-tech); letter-spacing: .14em; text-transform: uppercase; color: var(--chalk-3);
}

/* ---------- movimento ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 60% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .gate__inner, .has-error .field__control { animation: none; }
  .field__error { transition: opacity var(--t-state) linear; transform: none; }
  .btn__busy { animation-duration: 1.6s; }
}

/* ---------- celular ---------- */
@media (max-width: 560px) {
  .gate { background: var(--graphite); }
  .gate__brand { margin-bottom: 32px; }
  .gate__lead { margin-bottom: 28px; }
}
