.portal-auth {
  --auth-bg: var(--background, #f1f5f9);
  --auth-surface: var(--surface, #ffffff);
  --auth-text: var(--foreground, #0f172a);
  --auth-muted: var(--foreground-muted, #475569);
  --auth-border: var(--border, #e2e8f0);
  --auth-error-border: #fecaca;
  --auth-error-text: #9f1239;
  --auth-gold: #edc361;
  --auth-link: #916323;
  box-sizing: border-box;
  color-scheme: light;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  overflow: hidden;
  background: var(--auth-bg);
  color: var(--auth-text);
  font: 14px/1.5 Inter, system-ui, sans-serif;
}
.dark .portal-auth {
  --auth-bg: var(--background, #111418);
  --auth-surface: var(--surface, #191e23);
  --auth-text: var(--foreground, #f8fafc);
  --auth-muted: var(--foreground-muted, #a1a1aa);
  --auth-border: var(--border, #2c343b);
  --auth-error-border: #7f1d1d;
  --auth-error-text: #fda4af;
  --auth-link: #edc361;
  color-scheme: dark;
}
.portal-auth *, .portal-auth *::before, .portal-auth *::after { box-sizing: border-box; }
.portal-auth-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  padding: 32px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: var(--auth-surface);
  box-shadow: 0 3px 12px rgb(47 43 61 / 14%);
}
.portal-auth button.portal-auth-theme { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 1px solid var(--auth-border); border-radius: 6px; background: var(--auth-surface); color: var(--auth-text); cursor: pointer; }
.portal-auth button.portal-auth-theme:hover:not(:disabled) { border-color: var(--auth-link); background: var(--auth-bg); }
.portal-auth-theme svg { width: 18px; height: 18px; }
.portal-auth-logo { display: block; width: 48px; height: 52px; margin: 0 auto 32px; }
.portal-auth h1 { margin: 0 0 8px; font-size: 23px; font-weight: 700; line-height: 1.3; letter-spacing: -.4px; color: var(--auth-text); }
.portal-auth-description { margin: 0 0 24px; color: var(--auth-muted); font-size: 13px; }
.portal-auth-audience { text-align: center; margin-bottom: 14px; }
.portal-auth-audience span { display: inline-block; padding: 4px 12px; border: 1px solid var(--auth-border); border-radius: 20px; background: var(--auth-surface); color: var(--auth-text); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.portal-auth-staff h1, .portal-auth-staff .portal-auth-description { text-align: center; }
.portal-auth-form { display: grid; gap: 16px; margin: 0; }
.portal-auth-label { display: block; margin: 0; color: var(--auth-text); font-size: 13px; font-weight: 500; }
.portal-auth .portal-auth-card input, .portal-auth .portal-auth-card select { display: block; width: 100%; min-width: 0; height: 40px; margin-top: 6px; padding: 8px 12px; border: 1px solid var(--auth-border); border-radius: 5px; background: var(--auth-surface); color: var(--auth-text); font: inherit; outline: none; }
.portal-auth input::placeholder { color: var(--auth-muted); font-weight: 400; }
.portal-auth input:focus, .portal-auth select:focus { border-color: var(--auth-link); box-shadow: 0 0 0 2px rgb(237 195 97 / 22%); }
.portal-auth-password { position: relative; display: block; }
.portal-auth .portal-auth-password input { padding-right: 44px; }
.portal-auth .portal-auth-eye { position: absolute; top: 0; right: 0; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; margin: 0; border: 0; border-radius: 4px; background: transparent; color: var(--auth-muted); cursor: pointer; }
.portal-auth-eye svg { width: 18px; height: 18px; }
.portal-auth a { color: var(--auth-link); text-decoration: none; }
.portal-auth a:hover { text-decoration: underline; }
.portal-auth a:focus-visible, .portal-auth button:focus-visible { outline: 2px solid var(--auth-link); outline-offset: 3px; }
.portal-auth-forgot { text-align: right; font-size: 13px; }
.portal-auth .portal-auth-primary, .portal-auth button.portal-auth-primary { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: center; padding: 9px 16px; border: 0; border-radius: 5px; background: var(--auth-gold); color: #302714; font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; box-shadow: none; }
.portal-auth .portal-auth-primary:hover, .portal-auth button.portal-auth-primary:hover:not(:disabled) { background: #e4b54f; }
.portal-auth button:disabled { opacity: .6; cursor: wait; }
.portal-auth fieldset { min-width: 0; display: grid; gap: 16px; margin: 0; padding: 0; border: 0; }
.portal-auth-footer { margin: 24px 0 0; color: var(--auth-muted); font-size: 13px; text-align: center; }
.portal-auth-footer a { font-weight: 500; }
.portal-auth-switch { font-size: 12px; }
.portal-auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--auth-muted); font-size: 12px; }
.portal-auth-divider::before, .portal-auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--auth-border); }
.portal-auth-google { display: flex; justify-content: center; min-height: 40px; }
.portal-auth-google[aria-disabled=true] { pointer-events: none; opacity: .6; }
.portal-auth-error { padding: 10px 12px; border: 1px solid var(--auth-error-border); border-radius: 5px; background: var(--auth-surface); color: var(--auth-error-text); font-size: 13px; }
.portal-auth-hint { display: block; margin-top: 5px; color: var(--auth-muted); font-size: 12px; font-weight: 400; }
.portal-auth-support { margin: 0 0 24px; color: var(--auth-muted); text-align: center; }
.portal-auth-support svg { margin: 0 auto 12px; color: var(--auth-link); }
.portal-auth-support p { margin: 0; }
@media (max-width: 540px) {
  .portal-auth { padding: 24px 16px; }
  .portal-auth-card { padding: 28px 24px; }
  .portal-auth h1 { font-size: 21px; }
}

.portal-auth .field-error { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--auth-error-text); }
.portal-auth input[aria-invalid="true"], .portal-auth select[aria-invalid="true"] { border-color: #d92d20; }
