:root {
  color-scheme: light dark;
  --surface: #ffffff;
  --surface-muted: #f4f6fb;
  --text: #15182a;
  --muted: #555d73;
  --border: #d7dce7;
  --brand: #d60062;
  --brand-secondary: #a90075;
  --on-brand: #ffffff;
  --focus: #6d28d9;
  --danger: #b42318;
  --danger-surface: #fff2f0;
  --report-primary: #087a5b;
  --radius: 0.85rem;
  --shadow: 0 1rem 3rem rgb(28 39 60 / 0.12);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --surface: #151a28;
  --surface-muted: #0f1320;
  --text: #f7f8fc;
  --muted: #b8c0d3;
  --border: #3d465d;
  --brand: #ff4d98;
  --brand-secondary: #c62be8;
  --on-brand: #21000e;
  --focus: #d7b7ff;
  --danger: #ff9e94;
  --danger-surface: #351c22;
  --shadow: 0 1rem 3rem rgb(0 0 0 / 0.32);
}

* { box-sizing: border-box; }
html { min-width: 0; color: var(--text); background: var(--surface-muted); }
body { display: grid; min-width: 0; min-height: 100dvh; grid-template-rows: auto 1fr auto; margin: 0; font-size: 1rem; line-height: 1.55; background: var(--surface-muted); }
button, input, select { font: inherit; }
a { color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; inset: 0.75rem auto auto 0.75rem; padding: 0.75rem 1rem; color: var(--on-brand); background: var(--brand); border-radius: 0.5rem; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.auth-header { display: flex; min-height: 4.75rem; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.75rem clamp(1rem, 4vw, 3rem); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; gap: 0.7rem; align-items: center; font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.framework-logo { display: block; flex: none; object-fit: contain; }
.brand .framework-logo { width: 2.75rem; height: 2.75rem; }
.environment-badge { margin-inline-end: auto; padding: 0.35rem 0.7rem; color: var(--brand); border: 1px solid currentColor; border-radius: 0.4rem; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; }
.header-controls { display: flex; gap: 0.75rem; }
.header-controls select { min-height: 2.75rem; padding: 0.55rem 2.3rem 0.55rem 0.8rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 0.55rem; }

.auth-main { display: grid; place-items: center; padding: clamp(2rem, 6vw, 4rem) 1rem; }
.auth-card { width: min(100%, 37rem); padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-symbol, .report-icon { display: grid; width: 5.5rem; height: 5.5rem; margin-inline: auto; place-items: center; object-fit: contain; font-size: 2rem; }
.auth-card h1 { margin: 1.25rem 0 0.5rem; text-align: center; font-size: clamp(1.8rem, 5vw, 2.35rem); line-height: 1.15; }
.auth-description { max-width: 44ch; margin: 0 auto 1.6rem; color: var(--muted); text-align: center; }
.auth-card form { display: grid; gap: 0.7rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.auth-card label { font-weight: 700; }
.password-control { position: relative; min-width: 0; }
.password-control input { width: 100%; min-width: 0; min-height: 3.5rem; padding: 0.8rem 4rem 0.8rem 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 0.6rem; }
.password-toggle {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0.375rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0.45rem;
  cursor: pointer;
  transform: translateY(-50%);
}
.password-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.password-toggle:active { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.password-toggle svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.password-toggle-slash { opacity: 0; }
.password-toggle[aria-pressed="true"] .password-toggle-slash { opacity: 1; }
.primary-button { display: flex; min-height: 3.5rem; justify-content: center; gap: 0.75rem; align-items: center; margin-top: 0.6rem; padding: 0.8rem 1rem; color: var(--on-brand); background: linear-gradient(135deg, var(--brand), var(--brand-secondary)); border: 0; border-radius: 0.6rem; font-weight: 750; cursor: pointer; }
.auth-error { margin: 0 0 1rem; padding: 0.8rem 1rem; color: var(--danger); background: var(--danger-surface); border: 1px solid var(--danger); border-radius: 0.55rem; }
.field-help { margin: 0.15rem 0 0; color: var(--muted); }
.auth-footer { display: flex; min-height: 4.5rem; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.75rem clamp(1rem, 4vw, 3rem); color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); }
.auth-footer nav { display: flex; gap: 1.25rem; }
.auth-footer a { color: inherit; text-underline-offset: 0.2em; }

.report-card { text-align: left; }
.report-card .auth-description { margin-bottom: 0.75rem; }
.protected-label { display: flex; justify-content: center; gap: 0.5rem; align-items: center; margin: 0 0 1.5rem; color: var(--report-primary); font-weight: 750; }
.report-card form { text-align: left; }
.report-button { color: #ffffff; background: var(--report-primary); }
.back-link { display: block; min-height: 2.75rem; margin-top: 1.25rem; padding: 0.65rem; color: var(--report-primary); border-top: 1px solid var(--border); text-align: center; text-underline-offset: 0.2em; }

@media (max-width: 34rem) {
  .auth-header { align-items: stretch; flex-direction: column; }
  .header-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .header-controls select { width: 100%; min-width: 0; }
  .auth-main { padding: 1rem; }
  .auth-card { padding: 1.35rem 1rem; }
  .environment-badge { order: 3; }
  .auth-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 20rem) {
  .header-controls { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
