/* =====================================================================
   HDB · Shell de autenticação (login, registro, recuperação, reset)
   Autor: HDB Suite · 2026-11-06
   Carregado DEPOIS de style.css e auth_i18n.css (tem precedência).
   ===================================================================== */

:root {
  --a-bg: #050f0a;
  --a-panel: #0a1a12;
  --a-panel-2: #0d2218;
  --a-line: #1c3a2b;
  --a-line-strong: #2a5540;
  --a-text: #e8f5ec;
  --a-muted: #8ba99a;
  --a-muted-2: #6b8a79;
  --a-green: #3fb950;
  --a-green-2: #56d364;
  --a-green-ink: #04160b;
  --a-danger: #ff7b72;
  --a-warn: #e3b341;
  --a-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ----------------------------- página ----------------------------- */
body.login-body.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: block;
  background:
    radial-gradient(900px 520px at 12% -5%, rgba(63, 185, 80, .13), transparent 62%),
    radial-gradient(820px 460px at 100% 0%, rgba(47, 129, 247, .08), transparent 58%),
    var(--a-bg);
  color: var(--a-text);
  font-family: var(--a-font);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: stretch;
}

/* --------------------------- painel marca --------------------------- */
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 40px clamp(28px, 4.4vw, 64px) 32px;
  background:
    radial-gradient(560px 420px at 18% 8%, rgba(63, 185, 80, .18), transparent 68%),
    radial-gradient(620px 460px at 88% 92%, rgba(47, 129, 247, .12), transparent 66%),
    linear-gradient(160deg, #071710 0%, #04100b 52%, #030c08 100%);
  border-right: 1px solid var(--a-line);
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(63, 185, 80, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 185, 80, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 22%, #000 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle at 30% 22%, #000 0%, transparent 76%);
  opacity: .75;
}

.auth-aside > * { position: relative; z-index: 1; }

.auth-aside-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--a-text);
}

.auth-aside-brand img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 14px;
  filter: drop-shadow(0 0 16px rgba(63, 185, 80, .4));
}

.auth-aside-brand-txt { display: flex; flex-direction: column; line-height: 1.15; }

.auth-aside-brand-txt strong {
  font-size: .96rem;
  font-weight: 800;
  letter-spacing: .16em;
  white-space: nowrap;
}

.auth-aside-brand-txt em {
  margin-top: 4px;
  font-size: .68rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--a-green);
}

.auth-aside-copy { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }

.auth-aside-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.05rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -.015em;
}

.auth-aside-copy > p {
  margin: 0;
  font-size: .96rem;
  line-height: 1.7;
  color: var(--a-muted);
}

.auth-bullets {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-bullets li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.auth-tick {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--a-green-ink);
  background: linear-gradient(180deg, var(--a-green-2), var(--a-green));
  box-shadow: 0 0 0 1px rgba(63, 185, 80, .35), 0 6px 16px rgba(63, 185, 80, .18);
}

.auth-bullets b {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: var(--a-text);
}

.auth-bullets i {
  display: block;
  margin-top: 3px;
  font-size: .84rem;
  font-style: normal;
  line-height: 1.55;
  color: var(--a-muted);
}

.auth-aside-foot {
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(28, 58, 43, .85);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--a-muted-2);
}

/* ----------------------------- coluna form ----------------------------- */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 22px clamp(18px, 3.4vw, 48px) 26px;
}

.auth-topbar {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--a-text);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.auth-topbar-brand img { width: 30px; height: 30px; border-radius: 8px; }

.auth-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.auth-link-quiet {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--a-muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.auth-link-quiet:hover {
  color: var(--a-text);
  border-color: var(--a-line);
  background: rgba(255, 255, 255, .03);
}

/* seletor de idioma dentro do topo (o auth_i18n.css fixa-o no canto) */
#hdbLang.lang-picker {
  position: relative;
  top: auto;
  right: auto;
  z-index: 60;
  font-family: var(--a-font);
}

#hdbLang .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--a-line);
  background: rgba(10, 26, 18, .9);
  color: #d7efe0;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

#hdbLang .lang-toggle:hover { border-color: var(--a-green); background: rgba(16, 38, 26, .96); }

#hdbLang .lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--a-line-strong);
  background: #08170f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
  display: none;
}

#hdbLang.is-open .lang-menu { display: block; }

#hdbLang .lang-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7efe0;
  font-family: var(--a-font);
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}

#hdbLang .lang-menu button:hover { background: rgba(63, 185, 80, .14); }
#hdbLang .lang-menu button.is-active { background: rgba(63, 185, 80, .22); font-weight: 700; }
#hdbLang .flag { font-size: .95rem; line-height: 1; }

/* ------------------------------ cartão ------------------------------ */
.login-card.auth-card {
  width: min(520px, 100%);
  margin: 0;
  padding: clamp(20px, 2.4vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 18px;
  border: 1px solid var(--a-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 42%),
    linear-gradient(170deg, #0b1d14 0%, #08160f 100%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.auth-card-head { display: flex; flex-direction: column; gap: 6px; }

.auth-eyebrow {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(63, 185, 80, .34);
  background: rgba(63, 185, 80, .1);
  color: var(--a-green-2);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-card-head h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.62rem);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--a-text);
}

.auth-card-head p {
  margin: 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--a-muted);
}

/* ------------------------------ campos ------------------------------ */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }

.field > label {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #c6ddcf;
}

.field .control { position: relative; display: block; }

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="date"] {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid #234233;
  background: #061410;
  color: var(--a-text);
  font-family: var(--a-font);
  font-size: .9rem;
  line-height: 44px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.auth-card input::placeholder { color: #5f7c6d; }

.auth-card input:hover { border-color: #2c5340; }

.auth-card input:focus {
  border-color: var(--a-green);
  background: #071812;
  box-shadow: 0 0 0 3px rgba(63, 185, 80, .18);
}

.auth-card input[type="date"] { color-scheme: dark; padding-right: 10px; }

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--a-text);
  box-shadow: inset 0 0 0 1000px #0a2216;
  caret-color: var(--a-text);
  border-color: #2c5340;
}

.field .control input { padding-right: 46px; }

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--a-muted);
  cursor: pointer;
  font-size: .74rem;
  font-weight: 700;
  transition: color .15s ease, background .15s ease;
}

.pw-toggle:hover { color: var(--a-green-2); background: rgba(63, 185, 80, .12); }
.pw-toggle svg { width: 17px; height: 17px; display: block; }
.pw-toggle .ico-eye-off { display: none; }
.pw-toggle.is-shown .ico-eye { display: none; }
.pw-toggle.is-shown .ico-eye-off { display: block; }

.field.invalid input { border-color: var(--a-danger); box-shadow: 0 0 0 3px rgba(255, 123, 114, .14); }

.field-err {
  font-size: .74rem;
  line-height: 1.4;
  color: var(--a-danger);
}

.field-err[hidden] { display: none; }

/* medidor de força da senha */
.pw-meter { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }

.pw-meter-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }

.pw-meter-bars span {
  height: 4px;
  border-radius: 3px;
  background: #16352a;
  transition: background .2s ease;
}

.pw-meter[data-score="1"] .pw-meter-bars span:nth-child(-n+1) { background: #ff7b72; }
.pw-meter[data-score="2"] .pw-meter-bars span:nth-child(-n+2) { background: var(--a-warn); }
.pw-meter[data-score="3"] .pw-meter-bars span:nth-child(-n+3) { background: #56d364; }
.pw-meter[data-score="4"] .pw-meter-bars span { background: var(--a-green); }

.pw-meter-label {
  font-size: .72rem;
  line-height: 1.35;
  color: var(--a-muted);
  min-height: 14px;
}

/* checkbox de termos */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #1e3d2d;
  background: rgba(63, 185, 80, .05);
  font-size: .78rem;
  line-height: 1.55;
  color: #b7d2c1;
}

.check-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--a-green);
  cursor: pointer;
}

.check-row a { color: var(--a-green-2); font-weight: 600; text-decoration: none; }
.check-row a:hover { text-decoration: underline; }
.check-row.invalid { border-color: var(--a-danger); background: rgba(255, 123, 114, .07); }

.check-row .check-text { flex: 1 1 auto; min-width: 0; }
.check-row .field-err { display: block; margin-top: 5px; }

/* botão principal */
.login-card button[type="submit"] {
  width: 100%;
  height: 46px;
  margin-top: 2px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--a-green-2), #34a847);
  color: var(--a-green-ink);
  font-family: var(--a-font);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(63, 185, 80, .22), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.login-card button[type="submit"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(63, 185, 80, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.login-card button[type="submit"]:active { transform: translateY(0); }
.login-card button[type="submit"]:disabled { opacity: .72; cursor: progress; transform: none; }

.login-card button[type="submit"]:focus-visible,
.auth-link-quiet:focus-visible,
.pw-toggle:focus-visible,
#hdbLang .lang-toggle:focus-visible {
  outline: 2px solid var(--a-green-2);
  outline-offset: 2px;
}

/* alertas */
.login-card .alert {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 123, 114, .38);
  background: rgba(255, 123, 114, .1);
  color: #ffc9c4;
  font-size: .82rem;
  line-height: 1.5;
}

.login-card .alert.ok {
  border-color: rgba(63, 185, 80, .38);
  background: rgba(63, 185, 80, .1);
  color: #b6f0c2;
}

.login-card .alert[hidden] { display: none; }

/* rodapé do cartão (links) */
.login-card .foot,
.auth-foot {
  margin: 0;
  font-size: .8rem;
  color: var(--a-muted);
  text-align: center;
  line-height: 1.6;
}

.login-card .foot a,
.auth-foot a { color: var(--a-green-2); font-weight: 600; text-decoration: none; }
.login-card .foot a:hover,
.auth-foot a:hover { text-decoration: underline; }

.login-card .hint {
  margin: 0;
  font-size: .8rem;
  line-height: 1.6;
  color: var(--a-muted);
}

.auth-switch {
  margin: 2px 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(28, 58, 43, .9);
  font-size: .82rem;
  color: var(--a-muted);
  text-align: center;
}

.auth-switch a { color: var(--a-green-2); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* links legais fora do cartão */
.auth-legal {
  width: min(520px, 100%);
  margin: 0;
  font-size: .72rem;
  line-height: 1.6;
  color: var(--a-muted-2);
  text-align: center;
}

.auth-legal a { color: var(--a-muted); text-decoration: none; }
.auth-legal a:hover { color: var(--a-green-2); text-decoration: underline; }

/* ------------------------ páginas antigas (forgot/reset) ------------------------ */
.login-card:not(.auth-card) {
  width: min(460px, calc(100% - 32px));
  margin: 9vh auto 0;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 18px;
  border: 1px solid var(--a-line);
  background: linear-gradient(170deg, #0b1d14 0%, #08160f 100%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55);
}

.login-card .brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--a-text);
}

.login-card .brand span { color: var(--a-green); }

.login-card .sub {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--a-muted);
}

.login-card label { display: flex; flex-direction: column; gap: 6px; }

.login-card label > span {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #c6ddcf;
}

.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid #234233;
  background: #061410;
  color: var(--a-text);
  font-family: var(--a-font);
  font-size: .9rem;
  outline: none;
}

.login-card input:focus {
  border-color: var(--a-green);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, .18);
}

/* ------------------------------ responsivo ------------------------------ */
@media (max-width: 1020px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-topbar-brand { display: inline-flex; }
  .auth-main { justify-content: flex-start; padding-top: 26px; gap: 16px; }
  .login-card:not(.auth-card) { margin-top: 4vh; }
}

@media (max-width: 560px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-main { padding: 18px 14px 30px; gap: 14px; }
  .login-card.auth-card { padding: 20px 16px; border-radius: 16px; gap: 14px; }
  .auth-topbar { gap: 8px; }
  .auth-topbar-brand span { display: none; }
  .auth-card-head h1 { font-size: 1.28rem; }
  .auth-card input[type="text"],
  .auth-card input[type="email"],
  .auth-card input[type="password"],
  .auth-card input[type="date"] { font-size: 1rem; }
}

@media (max-height: 760px) and (min-width: 1021px) {
  .auth-main { justify-content: flex-start; padding-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
