/* ===========================================================
 *  Auth pages — full-bleed split layout
 *  Uses tokens.css variables (no surface-* aliases).
 * =========================================================== */

body.auth {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(255, 90, 54, .18) 0%, transparent 60%),
    radial-gradient(1000px 600px at 110% 110%, rgba(124, 92, 255, .18) 0%, transparent 60%),
    var(--bg-0);
  color: var(--text-1);
}

.auth-theme-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.auth__shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 980px) {
  .auth__shell { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
}

.auth__brand {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(800px 400px at 30% 20%, rgba(255, 45, 177, .18) 0%, transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
  border-right: 1px solid var(--line-1);
}

.auth__pitch h1 {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 24px 0 16px;
  color: var(--text-0);
}
.auth__pitch h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth__pitch p { color: var(--text-2); max-width: 520px; }

.auth__bullets {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
  color: var(--text-1);
}
.auth__bullets li {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  padding: 10px 14px;
  border-radius: var(--r-2);
  font-size: var(--fs-md);
}
.auth__bullets i { color: var(--brand-3); }

.auth__legal { color: var(--text-3); font-size: 12px; }

.auth__panel {
  position: relative;
  box-sizing: border-box;
  min-height: 100vh;
  align-self: stretch;
  padding: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  /* Imagem à esquerda, altura total; largura em excesso corta à direita (resoluções mais estreitas) */
  background-color: var(--bg-0);
  background-image: url('../img/bg_login.jpg');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: auto 100%;
}

.auth__card {
  width: 100%;
  max-width: 460px;
  padding: 32px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-3);
}

.auth__heading h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text-0);
}
.auth__heading p { color: var(--text-2); margin: 4px 0 24px; }

/* Hubit identity components compatibility — these classes come from
   the HubitIdentity Razor components and need our token bindings.
   Exclui o label do switch "Lembrar-me" (hubit-login-remember__label), que
   tem de permanecer inline-flex + linha, não em bloco. */
.auth__card label:not(.hubit-login-remember__label),
.auth__card .form-label {
  display: block;
  color: var(--text-1);
  font-weight: 500;
  margin: 12px 0 6px;
  font-size: var(--fs-sm);
}
.auth__card .form-control,
.auth__card input[type="text"],
.auth__card input[type="email"],
.auth__card input[type="password"] {
  width: 100%;
  background: var(--bg-2);
  color: var(--text-0);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.auth__card .form-control:focus,
.auth__card input:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, .18);
}

.auth__card .btn,
.auth__card button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  color: white;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  font-size: var(--fs-md);
  font-family: inherit;
}
.auth__card .btn:hover,
.auth__card button[type="submit"]:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.auth__card .btn-secondary,
.auth__card .btn-outline-secondary {
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--line-2);
}

.auth__card a { color: var(--brand-3); text-decoration: none; font-weight: 500; }
.auth__card a:hover { text-decoration: underline; }

/* Login “Lembrar-me” — switch (HubitIdentity hubit-login-remember) */
.auth__card .hubit-login-remember {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 0;
  margin: 0 0 0.5rem 0;
}
.auth__card label.hubit-login-remember__label,
.auth__card .hubit-login-remember__label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 4px 0;
  color: var(--text-1);
  font-weight: 500;
  font-size: var(--fs-md);
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}
.auth__card .hubit-login-remember__text {
  flex: 1;
  min-width: 0;
}
.auth__card .hubit-login-remember__switch {
  --hi-remember-track-off: var(--line-2);
  flex-shrink: 0;
  border: 1px solid var(--line-1);
  background: var(--bg-3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.auth__card .hubit-login-remember__input:checked + .hubit-login-remember__label .hubit-login-remember__switch {
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  border-color: transparent;
  box-shadow: none;
}
.auth__card .hubit-login-remember__input:focus-visible + .hubit-login-remember__label {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
  border-radius: var(--r-2);
}
.auth__card .hubit-login-remember__input + .hubit-login-remember__label .hubit-login-remember__switch::after {
  background: var(--text-0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* SelectTenant — tiles (HubitIdentity) não herdam "label" em bloco */
.auth__card label.hi-tenant-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  max-width: 100%;
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.auth__card .hi-tenant-hero__title { color: var(--text-0); }
.auth__card .hi-tenant-hero__lead { color: var(--text-2); }
/* lista única: cores do DS dark STUDIO (HubitIdentity usa fallbacks claros) */
.auth__card .hi-tenant-pick--list {
  --hi-line: var(--line-1);
  --hi-surface-hover: color-mix(in srgb, var(--text-0) 10%, transparent);
  --hi-tint: color-mix(in srgb, var(--brand-1) 20%, transparent);
  --hi-accent: var(--brand-1);
  --hi-accent-ink: var(--brand-1);
  --hi-text: var(--text-0);
  --hi-muted: var(--text-3);
}

.auth__card .alert,
.alert {
  padding: 12px 14px;
  border-radius: var(--r-2);
  background: rgba(255, 90, 54, .10);
  border: 1px solid rgba(255, 90, 54, .32);
  color: var(--text-1);
  margin-bottom: 16px;
  font-size: var(--fs-sm);
}
.auth__card .text-danger,
.auth__card .field-validation-error {
  color: #ff8a82;
  font-size: 13px;
  display: block;
  margin-top: 6px;
}

/* -----------------------------------------------------------------
   Form floating (HubitIdentity LoginForm) — labels irmãs do input
   e botão "mostrar senha" no eixo do campo (não no meio do bloco
   com label quebrada por .auth__card .form-label em display block).
   ----------------------------------------------------------------- */
.auth__card .form-floating {
  position: relative;
  margin-bottom: 1rem;
}
.auth__card .form-floating > .form-control {
  min-height: 56px;
  height: 56px;
  padding: 18px 14px 4px;
  line-height: 1.2;
}
.auth__card .form-floating.hubit-pwd-toggle-wrap > .form-control.hubit-pwd-input {
  padding-right: 48px;
}
.auth__card .form-floating > .form-control::placeholder {
  color: transparent;
}
.auth__card .form-floating > .form-label,
.auth__card .form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  height: 100%;
  margin: 0;
  padding: 16px 14px;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.16s ease, color 0.16s ease, opacity 0.16s ease;
  color: var(--text-3);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 8px);
}
.auth__card .form-floating > .form-control:focus ~ .form-label,
.auth__card .form-floating > .form-control:focus ~ label,
.auth__card .form-floating > .form-control:not(:placeholder-shown) ~ .form-label,
.auth__card .form-floating > .form-control:not(:placeholder-shown) ~ label {
  transform: translateY(-9px) scale(0.78);
  color: var(--text-2);
  opacity: 0.95;
}
.auth__card .form-floating > .form-control:focus ~ .form-label,
.auth__card .form-floating > .form-control:focus ~ label {
  color: var(--brand-1);
}

.auth__card .hubit-pwd-toggle-wrap { position: relative; }
.auth__card .hubit-pwd-toggle-wrap .hubit-pwd-toggle-btn {
  position: absolute;
  /* 28px = metade da altura do .form-control (56px) — evita 50% incluir
     labels em fluxo errado ou spans de validação e puxar o olho p/ baixo */
  top: 28px;
  right: 8px;
  transform: translateY(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-2);
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
  box-shadow: none;
}
.auth__card .hubit-pwd-toggle-wrap .hubit-pwd-toggle-btn:hover {
  background: var(--bg-2);
  color: var(--text-1);
}
.auth__card .hubit-pwd-toggle-wrap .hubit-pwd-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--line-1), 0 0 0 4px rgba(255, 90, 54, 0.35);
}
.auth__card .hubit-pwd-toggle-wrap .hubit-pwd-toggle-icon {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

.auth__card hr {
  border: 0; border-top: 1px solid var(--line-1); margin: 18px 0;
}

.auth__card h3,
.auth__card h4 {
  font-size: 13px; color: var(--text-2);
  text-align: center; font-weight: 500;
  margin: 18px 0 10px;
}

.auth__card .muted { color: var(--text-3); font-size: var(--fs-sm); }

/* External provider buttons (HubitIdentity) */
.auth__card div:has(button[name="provider"]) {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.auth__card button[name="provider"] {
  flex: 1; padding: 10px 12px; font-size: 13px;
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  cursor: pointer;
  margin-top: 0;
  background-image: none;
}
.auth__card button[name="provider"]:hover {
  border-color: var(--brand-3);
  transform: none;
}

/* Brand mark (auth aside) — from MaestroImage shell.css */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-0);
  font-weight: 700;
  letter-spacing: .02em;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--gradient-hero);
  color: white;
  border-radius: 9px;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(255, 45, 177, .35);
}
.brand__text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
  font-size: var(--fs-lg);
}
.brand__text small {
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
}
