/* Login: one page for every role. Same world as the site: ground, one green disc, white card, round buttons. */

body { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; overflow-x: clip; position: relative; }
.auth-disc { position: fixed; z-index: -1; width: min(118vmin, 1100px); aspect-ratio: 1; border-radius: 50%; background: var(--green);
  right: max(-34vmin, -320px); bottom: max(-46vmin, -440px); pointer-events: none; }

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-2);
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 16px; min-height: 72px; }
.auth-top .brand img { width: auto; height: 72px; }

.auth { display: grid; place-items: center; padding: var(--gap-3) var(--gutter) var(--gap-5); }
.auth-card { width: min(100%, 440px); background: var(--surface); border-radius: var(--r-card); padding: clamp(24px, 5vw, 44px); display: grid; gap: var(--gap-3); }
.auth-step { display: grid; gap: 18px; }
.auth-step[hidden] { display: none; }
.auth h1 { font-size: clamp(1.75rem, 1rem + 2.2vw, 2.75rem); line-height: 1.15; }
.auth-sub { color: var(--muted); margin-top: -8px; }

.field { display: grid; gap: 6px; }
.field label, .field-row label { font-weight: 600; font-size: var(--step-small); }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.field input { width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-field); background: var(--surface);
  font-size: max(16px, 1rem); color: var(--ink); transition: border-color var(--dur-ui) ease; }
.field input:focus { outline: 3px solid var(--mint); outline-offset: 0; border-color: var(--green); }
.field input[aria-invalid="true"] { border-color: var(--ink); border-width: 2px; }
.field input.code { font-size: 1.75rem; font-weight: 700; letter-spacing: 0.35em; text-align: center; padding-left: calc(14px + 0.35em); }

.pw { position: relative; }
.pw input { padding-right: 104px; }
.pw-toggle { position: absolute; top: 3px; right: 3px; bottom: 3px; min-width: 88px; padding: 0 12px; border: 0; border-radius: var(--r-field); background: var(--ground);
  font-weight: 600; font-size: var(--step-small); cursor: pointer; }

.check { display: flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); flex: none; }

.auth-submit { width: 100%; min-height: 54px; margin-top: 4px; }
.auth-submit[aria-busy="true"] { opacity: 0.75; pointer-events: none; }

.auth-link { background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--green); font-weight: 600; font-size: var(--step-small);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; cursor: pointer; text-align: left; }
.auth-alt { display: grid; justify-items: start; gap: 2px; }

body:not([data-step="password"]) .auth-note { display: none; }
.auth-note { border-top: 1px solid var(--line); padding-top: var(--gap-3); color: var(--muted); font-size: var(--step-small); }

/* Messages: ink plate for errors (no alarm red in this palette), mint for good news, soft mint for information */
.auth .form-msg:empty { display: none; }
.auth .form-msg { padding: 10px 14px; border-radius: var(--r-field); }
.auth .form-msg[data-state="err"] { background: var(--ink); color: #fff; }
.auth .form-msg[data-state="ok"] { background: var(--mint); color: var(--ink); }
.auth .form-msg[data-state="info"] { background: var(--mint-soft); color: var(--ink); }

.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; width: fit-content; max-width: calc(100% - 2 * var(--gutter));
  margin: 0 auto max(20px, env(safe-area-inset-bottom)); padding: 8px 18px; background: var(--surface); border-radius: var(--r-card);
  font-size: var(--step-small); color: var(--ink); }
.auth-foot a { color: var(--ink); overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .auth { place-items: start center; padding-top: var(--gap-2); }
  .auth-disc { width: 150vw; right: -75vw; bottom: -40vw; }
}

.pw-toggle, .auth-link { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) {
  .pw-toggle:hover { background: var(--mint-soft); }
  .auth-link:hover { color: var(--green-press); }
}
