[hidden] { display: none !important; }

html[data-auth-state="anonymous"],
html[data-auth-state="anonymous"] body { min-height: 100%; }
html[data-auth-state="anonymous"] body { padding-bottom: 0; }

body.command-center #auth-root:not([hidden]) {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 10%, rgba(250, 199, 117, .16), transparent 25rem),
    linear-gradient(132deg, #031c34 0%, #06365f 48%, #eff2f3 48.1%, #f8f7f3 100%);
}

body.command-center main.auth-screen {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(360px, 520px);
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  align-items: center;
  gap: clamp(46px, 8vw, 116px);
  margin: 0 auto;
  padding: 56px 0;
  box-sizing: border-box;
}

.auth-brand-panel {
  display: grid;
  gap: 38px;
  color: #f7fbff;
}

.auth-mark {
  display: grid;
  width: 122px;
  height: 122px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(250, 199, 117, .5);
  background: rgba(2, 22, 40, .42);
  box-shadow: inset 0 0 0 8px rgba(250, 199, 117, .06);
  color: var(--gold);
}

.auth-mark strong { font: 800 48px/.8 var(--cc-display); letter-spacing: -.06em; }
.auth-mark span { margin-top: 8px; color: #fff; font: 700 14px/1 var(--cc-display); letter-spacing: .22em; text-transform: uppercase; }
.auth-brand-panel > div > span { color: var(--gold); font: 750 12px/1 var(--cc-display); letter-spacing: .18em; text-transform: uppercase; }
body.command-center .auth-brand-panel h1 { margin: 10px 0 9px; color: #fff; font-size: clamp(44px, 7vw, 78px); letter-spacing: -.06em; line-height: .95; }
.auth-brand-panel p { max-width: 480px; margin: 0; color: #c2d3e1; font-size: 17px; line-height: 1.65; }

.auth-card {
  position: relative;
  padding: clamp(30px, 5vw, 54px);
  border: 1px solid rgba(4, 44, 83, .14);
  border-top: 5px solid var(--gold2);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 80px rgba(3, 28, 51, .18);
}

.auth-card::before { position: absolute; top: 0; right: 0; width: 66px; height: 5px; background: var(--navy); content: ""; }
.auth-eyebrow { color: var(--gold2); font: 800 12px/1 var(--cc-display); letter-spacing: .16em; text-transform: uppercase; }
body.command-center .auth-card h2 { margin: 13px 0 9px; padding: 0; border: 0; color: var(--navy); font-size: clamp(27px, 4vw, 38px); letter-spacing: -.035em; line-height: 1.05; text-transform: none; }
.auth-card > p { margin: 0; color: var(--g-color-muted); line-height: 1.55; }
.auth-form { display: grid; gap: 18px; margin-top: 32px; }
.auth-field { display: grid; gap: 7px; }
.auth-field > span { color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-field input { width: 100%; min-height: 49px; box-sizing: border-box; padding: 11px 13px; border: 1px solid #bdc9d2; border-radius: 3px; background: #fbfcfc; color: var(--g-color-ink); font: inherit; }
.auth-field input:focus { border-color: var(--navy2); outline: 3px solid rgba(12, 68, 124, .13); }
.auth-submit { min-height: 49px; border: 1px solid var(--navy); border-radius: 3px; background: var(--navy); color: #fff; cursor: pointer; font: 800 13px/1 var(--cc-display); letter-spacing: .08em; text-transform: uppercase; }
.auth-submit:hover { background: var(--navy2); }
.auth-submit:disabled { cursor: wait; opacity: .66; }
.auth-link { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--navy2); cursor: pointer; font: 700 13px/1.3 var(--cc-body); }
.auth-rule { color: var(--g-color-muted); }
.auth-feedback { min-height: 20px; margin: -4px 0 0; color: var(--red); font-size: 13px; font-weight: 700; }
.auth-loading { display: flex; gap: 8px; margin-top: 32px; }
.auth-loading span { width: 9px; height: 9px; animation: auth-pulse 1s infinite alternate; border-radius: 50%; background: var(--gold2); }
.auth-loading span:nth-child(2) { animation-delay: .18s; }
.auth-loading span:nth-child(3) { animation-delay: .36s; }
@keyframes auth-pulse { to { opacity: .2; transform: translateY(-5px); } }

body.command-center .session-account {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, .2);
}
.session-account-identity { display: grid; min-width: 100px; }
.session-account-identity strong { max-width: 170px; overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.session-account-identity small { color: #b5d4f4; font-size: 12px; }
.session-account-alerts { padding: 4px 7px; border: 1px solid rgba(250, 199, 117, .6); color: var(--gold); font-size: 12px; font-weight: 800; }
.session-account-logout { min-height: 34px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff; cursor: pointer; font-weight: 750; }

@media (max-width: 780px) {
  body.command-center #auth-root:not([hidden]) { background: linear-gradient(180deg, #031c34 0, #06365f 34%, #f8f7f3 34.1%); }
  body.command-center main.auth-screen { grid-template-columns: 1fr; width: min(100% - 28px, 540px); gap: 28px; padding: 32px 0; }
  .auth-brand-panel { grid-template-columns: auto 1fr; align-items: center; gap: 18px; }
  .auth-mark { width: 76px; height: 76px; }
  .auth-mark strong { font-size: 32px; }
  body.command-center .auth-brand-panel h1 { margin: 5px 0 2px; font-size: 32px; }
  .auth-brand-panel p { font-size: 13px; line-height: 1.4; }
  .session-account-identity, .session-account-alerts { display: none; }
  body.command-center .session-account { padding-left: 6px; border: 0; }
}

/* Feedback não pode alargar a grade nem deslocar o formulário no login. */
.auth-card, .auth-brand-panel, .auth-form, .auth-field { min-width: 0; }
.auth-card { box-sizing: border-box; width: 100%; }
.auth-feedback {
  box-sizing: border-box; min-height: 60px; margin: 0;
  padding: 10px 12px; border-left: 3px solid transparent;
  border-radius: 3px; font: 600 13px/1.45 var(--cc-body);
  overflow-wrap: anywhere; white-space: normal;
}
.auth-feedback:not(:empty) {
  border-left-color: var(--red); background: #fff3f1; color: #8f2721;
}
@media (max-width: 780px) {
  body.command-center main.auth-screen { align-content: start; }
}
