/* Identidade ILUMAC. Tokens globais (tema claro/escuro para as telas internas) e tokens --login-* (login sempre claro). */
:root {
  --brand: #B01E26;
  --brand-hover: #961920;
  --brand-dark: #7D1016;

  --login-bg: #FFFFFF;
  --login-text: #1C1C1C;
  --login-muted: #5F5F5F;
  --login-border: #D4D4D4;
  --login-input-bg: #FAFAFA;
  --login-error-bg: #FDECEC;
  --login-error-text: #9B1C22;

  --bg: #f4f4f5; --surface: #ffffff; --surface-2: #f3f3f4; --border: #e2e2e4;
  --text: #2f2e2e; --muted: #605e5e;
}
:root:not([data-theme="light"]) { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141313; --surface: #1f1e1e; --surface-2: #2a2929; --border: #3a3838; --text: #f1f0f0; --muted: #b3b0b0;
  }
}
:root[data-theme="dark"] {
  --bg: #141313; --surface: #1f1e1e; --surface-2: #2a2929; --border: #3a3838; --text: #f1f0f0; --muted: #b3b0b0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Montserrat, "Segoe UI", system-ui, sans-serif; }

/* ===== Login (sempre claro) ===== */
body.page-login { background: var(--login-bg); color: var(--login-text); color-scheme: light; overflow-x: hidden; }
.login { display: flex; min-height: 100vh; background: var(--login-bg); font-family: Montserrat, "Segoe UI", system-ui, sans-serif; }
.login__form-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 40px 80px; }
.login__logo { height: 64px; width: 100%; max-width: 320px; align-self: center; object-fit: contain; object-position: left center; }
.login__form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 20px; margin: 0 auto; }
.login__form h1 { margin: 0; font-size: 30px; font-weight: 700; color: var(--login-text); line-height: 1.2; }
.login__subtitle { margin: -8px 0 0; font-size: 15px; color: var(--login-muted); }
.login__head .login__subtitle { margin: 6px 0 0; }
.login__alert { background: var(--login-error-bg); color: var(--login-error-text); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.login__alert[hidden] { display: none; }
.login__alert--ok { background: #e8f5ee; color: #16623f; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field__row label { font-size: 14px; font-weight: 600; color: #333; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] {
  width: 100%; height: 48px; padding: 0 16px; font: inherit; font-size: 15px; color: var(--login-text);
  background: var(--login-input-bg); border: 1px solid var(--login-border); border-radius: 10px;
}
.field input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(176, 30, 38, .15); }
.field__password { position: relative; }
.field__password input { padding-right: 48px; }
.btn-eye { position: absolute; right: 0; top: 0; width: 44px; height: 48px; display: grid; place-items: center; background: none; border: 0; padding: 0; color: #767676; cursor: pointer; }
.btn-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 10px; }
.btn-eye svg { width: 20px; height: 20px; }
.link-forgot { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.link-forgot:hover { color: var(--brand-dark); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--login-text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }

.login__alt { margin: 0; text-align: center; font-size: 14px; color: var(--login-muted); }
.login__alt .link-forgot { font-size: 14px; }
/* Cadastro em etapas */
.steps { display: flex; flex-direction: column; gap: 8px; }
.steps__label { font-size: 12px; font-weight: 600; color: var(--login-muted); letter-spacing: .3px; text-transform: uppercase; }
.steps__bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps__bar i { height: 4px; border-radius: 4px; background: var(--login-border); }
.steps__bar i.is-on { background: var(--brand); }
.step { display: flex; flex-direction: column; gap: 20px; }
.step[hidden] { display: none; }
.opcional { font-weight: 400; color: var(--login-muted); }
.opcional[hidden] { display: none; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn-primary { flex: 1; width: auto; }
.btn-secondary { height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid var(--login-border); background: #fff; color: var(--login-text); font: 600 15px Montserrat, "Segoe UI", sans-serif; cursor: pointer; }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-secondary[hidden], .login__alt[hidden] { display: none; }
.btn-secondary.btn-link { display: inline-grid; place-items: center; text-decoration: none; }
/* Botões do cadastro: mais discretos que o "Entrar" do login */
.btn-row { align-items: center; }
.btn-row .btn-primary, .btn-row .btn-secondary, .login__sucesso .btn-link { height: 40px; font-size: 14px; border-radius: 8px; }
.btn-row .btn-secondary { padding: 0 18px; }
.btn-row .btn-primary { flex: 1; }
.login__sucesso .btn-link { width: 100%; }
.field input[readonly] { color: var(--login-muted); background: #f1f1f1; }
.field__hint { font-size: 12px; color: var(--login-muted); }
.check--top { align-items: flex-start; font-size: 13px; line-height: 1.4; }
.check--top input { margin-top: 1px; flex-shrink: 0; }
.login__form[hidden], .login__sucesso[hidden] { display: none; }  /* display:flex do formulário vence o atributo hidden */
.btn-link { display: grid; place-items: center; text-decoration: none; }
.btn-link[hidden] { display: none; }
.btn-primary { width: 100%; height: 48px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: 600 16px Montserrat, "Segoe UI", sans-serif; cursor: pointer; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:focus-visible { outline: 3px solid rgba(176, 30, 38, .35); outline-offset: 2px; }
.btn-primary:disabled { opacity: .6; cursor: default; }

.login__footer { width: 100%; max-width: 320px; align-self: center; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #767676; }
/* Selo de versão: parece texto, mas continua clicável (abre o changelog). */
.badge-versao { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.badge-versao:hover { color: var(--brand); text-decoration: underline; }
.badge-versao:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.login__brand { position: relative; overflow: hidden; width: 520px; flex-shrink: 0; margin: 16px; border-radius: 20px; background: var(--brand-dark); display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; gap: 14px; }
/* Marca d'água do escudo (decorativa), cortada pelo canto superior direito do painel. */
.login__brand::before { content: ""; position: absolute; top: -40px; right: -70px; width: 330px; height: 412px; background: url(/assets/marca-dagua.svg) no-repeat center / contain; pointer-events: none; }
.login__brand > * { position: relative; }
.login__features { list-style: none; margin: 0 0 auto; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 14px; color: #F3D0D0; }
.login__features li { display: flex; align-items: center; gap: 12px; }
.login__features li::before { content: "\2713"; color: #fff; font-weight: 700; font-size: 15px; }
.login__brand h2 { margin: 0; font-size: 34px; font-weight: 700; color: #fff; line-height: 1.2; }
.login__brand p { margin: 0; font-size: 16px; line-height: 1.6; color: #F3D0D0; }

dialog.versao { background: #fff; color: var(--login-text); border: 1px solid var(--login-border); border-radius: 14px; max-width: 420px; padding: 20px 24px; }
dialog.versao::backdrop { background: rgba(0, 0, 0, .5); }
dialog.versao ul { padding-left: 18px; margin: 6px 0 16px; }

/* Telas baixas (notebooks pequenos / janela reduzida): compacta para não rolar. */
@media (max-height: 680px) {
  .login__form-col { padding-top: 24px; padding-bottom: 24px; gap: 8px; }
  .login__form, .step { gap: 14px; }
  .login__form h1 { font-size: 26px; }
  .login__subtitle { margin-top: -6px; }
  .field { gap: 6px; }
  .field input[type="email"], .field input[type="password"], .field input[type="text"], .btn-primary, .btn-secondary, .btn-eye { height: 44px; }
}

@media (max-width: 1023px) {
  .login__brand { display: none; }
  .login__form-col { padding: 32px 24px; gap: 28px; }
  .login__form { margin: 0 auto; }
  .login__logo { object-position: center; max-width: none; }
  .login__footer { justify-content: center; }
}
@media (max-width: 479px) {
  .login__form { max-width: none; }
}
