:root {
  --ivory: #f7f0e8;
  --ivory-deep: #eee3d8;
  --surface: rgba(255, 252, 248, .78);
  --surface-solid: #fffdf9;
  --copper: #a55b35;
  --copper-light: #d29368;
  --copper-dark: #714024;
  --headline-copper: #4a2c1f;
  --body-copper: #7b675a;
  --graphite: #4a2c1f;
  --muted: #7b675a;
  --border: rgba(126, 82, 56, .23);
  --danger: #a53333;
  --success: #3c795f;
  --shadow: 0 20px 50px rgba(80, 56, 38, .14);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ivory); }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--graphite);
  background:
    radial-gradient(circle at 88% 6%, rgba(210,147,104,.14), transparent 32%),
    radial-gradient(circle at 10% 88%, rgba(165,91,53,.10), transparent 28%),
    var(--ivory);
}
button, input { font: inherit; }
button { cursor: pointer; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .95fr) minmax(420px, 1.05fr); }
.brand-panel {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 48px;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(155deg, rgba(255,255,255,.85), rgba(244,233,222,.65)),
    var(--ivory-deep);
}
.brand-panel::before, .brand-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(165,91,53,.22);
  border-radius: 50%;
  pointer-events: none;
}
.brand-panel::before { width: 620px; height: 620px; bottom: -360px; left: -210px; }
.brand-panel::after { width: 460px; height: 460px; top: -300px; right: -210px; }
.brand-panel__inner { position: relative; z-index: 1; max-width: 540px; text-align: center; }
.brand-logo { width: min(100%, 410px); max-height: 430px; object-fit: contain; filter: drop-shadow(0 20px 22px rgba(91,58,38,.16)); }
.brand-copy { margin: 10px auto 0; max-width: 400px; }
.eyebrow { margin: 0 0 10px; color: var(--copper-dark); font-size: .76rem; font-weight: 760; letter-spacing: .14em; text-transform: uppercase; }
.brand-copy h1 {
  margin: 0;
  color: var(--headline-copper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -.018em;
  text-shadow: 0 1px 0 rgba(255,255,255,.56);
}
.brand-copy p:last-child { color: var(--body-copper); margin: 14px 0 0; line-height: 1.6; }

.form-panel { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 7vw, 104px) 22px; }
.form-card { width: min(100%, 470px); margin: auto; }
.mobile-brand { display: none; }
.form-card__header { margin-bottom: 34px; }
.form-card__header h2 { color: var(--headline-copper); font-family: Georgia, "Times New Roman", serif; margin: 0; font-size: 2.55rem; font-weight: 500; letter-spacing: -.025em; }
.form-card__header p:last-child { margin: 10px 0 0; color: var(--body-copper); line-height: 1.5; }

.field-group { margin-top: 20px; }
.field-group label, .modal-card label { display: block; margin: 0 0 8px; color: #5b4030; font-size: .92rem; font-weight: 650; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input, .modal-card input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 15px;
  outline: 0;
  padding: 0 52px 0 48px;
  color: var(--graphite);
  background: var(--surface);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.65);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.modal-card input { padding: 0 16px; margin-bottom: 20px; }
.input-wrap input::placeholder, .modal-card input::placeholder { color: #a89a8e; }
.input-wrap input:focus, .modal-card input:focus { border-color: var(--copper); background: var(--surface-solid); box-shadow: 0 0 0 4px rgba(165,91,53,.12); }
.input-icon { position: absolute; left: 17px; width: 21px; height: 21px; stroke: var(--copper); stroke-width: 1.6; fill: none; pointer-events: none; }
.icon-button { position: absolute; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; color: var(--copper-dark); background: transparent; }
.icon-button:hover { background: rgba(165,91,53,.1); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.field-error { min-height: 18px; margin: 5px 0 0; color: var(--danger); font-size: .78rem; }
.has-error input { border-color: var(--danger); }

/* Formulário de criação de senha: campos alinhados ao botão e com espaçamento uniforme. */
#setPasswordForm { max-width: 470px; }
#setPasswordForm .field-group { margin-top: 22px; }
#setPasswordForm input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  outline: 0;
  color: var(--graphite);
  background: var(--surface);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.65);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
#setPasswordForm input:focus { border-color: var(--copper); background: var(--surface-solid); box-shadow: 0 0 0 4px rgba(165,91,53,.12); }
#setPasswordForm .primary-button { margin-top: 26px; }
.set-password-form { width: 100%; max-width: 470px; }
.set-password-form .field-group { margin-top: 22px; }
.password-field { position: relative; }
.password-field input { padding-right: 52px !important; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--copper-dark); background: transparent; cursor: pointer; font-size: 18px; }
.password-toggle:hover { background: rgba(165,91,53,.1); }
.set-password-form .primary-button { width: 100%; margin-top: 30px; }

.form-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 5px 0 26px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; cursor: pointer; }
.check-label input { appearance: none; display: grid; place-items: center; width: 17px; height: 17px; margin: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-solid); }
.check-label input:checked { border-color: var(--copper); background: var(--copper); }
.check-label input:checked::after { content: "✓"; color: white; font-size: 12px; font-weight: 800; }
.text-button { padding: 2px 0; border: 0; border-bottom: 1px solid rgba(165,91,53,.45); color: var(--copper-dark); background: transparent; font-size: .86rem; }
.text-button:hover { color: var(--copper); }

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid #773a1d;
  border-radius: 15px;
  color: #fffaf6;
  background: linear-gradient(110deg, #82421f, #bb7348 52%, #8a4522);
  box-shadow: 0 13px 24px rgba(116,59,31,.25), inset 0 1px 1px rgba(255,255,255,.3);
  font-weight: 750;
  font-size: 1rem;
  letter-spacing: .01em;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 16px 27px rgba(116,59,31,.3), inset 0 1px 1px rgba(255,255,255,.3); filter: saturate(1.08); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.spinner { display: none; width: 18px; height: 18px; margin-left: 10px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 18px; color: #9d8d80; font-size: .84rem; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.biometric-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; border: 1px solid var(--border); border-radius: 14px; color: var(--copper-dark); background: rgba(255,255,255,.4); font-weight: 670; }
.biometric-button:hover { background: rgba(255,255,255,.75); border-color: rgba(165,91,53,.45); }
.biometric-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.status-message { min-height: 22px; margin: 18px 0 0; text-align: center; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.status-message.is-error { color: var(--danger); }
.status-message.is-success { color: var(--success); }
.page-footer { margin-top: 13px; transform: translateY(-1cm); text-align: center; color: var(--copper-dark); font-size: .82rem; font-weight: 650; letter-spacing: .06em; }

.modal { width: min(calc(100% - 32px), 440px); padding: 0; border: 1px solid var(--border); border-radius: 22px; color: var(--graphite); background: transparent; box-shadow: 0 25px 90px rgba(41,29,20,.3); }
.modal::backdrop { background: rgba(48,32,21,.36); backdrop-filter: blur(4px); }
.modal-card { position: relative; padding: 34px; background: var(--surface-solid); }
.modal-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 2rem; }
.modal-card p:not(.eyebrow):not(.status-message) { color: var(--muted); line-height: 1.5; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--copper-dark); background: rgba(165,91,53,.1); font-size: 1.6rem; line-height: 1; }

@media (max-width: 840px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 28px 20px 18px; }
  .form-card { margin: 0 auto; }
  .mobile-brand { display: grid; place-items: center; margin-bottom: 22px; text-align: center; }
  .mobile-brand img { width: min(230px, 56vw); max-height: 200px; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(91,58,38,.15)); }
  .mobile-brand p { margin: 4px 0 0; color: var(--copper); font-size: .85rem; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
  .form-card__header { margin-bottom: 22px; text-align: center; }
  .form-card__header h2 { font-size: 2.2rem; }
}
@media (max-width: 400px) {
  .form-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .modal-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Logo isolado: o PNG possui canal alfa; nenhum painel ou cor de fundo é aplicado à imagem. */
.brand-logo { display: block; background: transparent; }

/* v0.1.2 — Tipografia institucional: cobre profundo, sem preto puro. */
.brand-copy .eyebrow { color: var(--copper); }
.brand-copy h1, .form-card__header h2, .modal-card h2 { color: var(--headline-copper); }
.brand-copy p:last-child, .form-card__header p:last-child { color: var(--body-copper); }
