:root {
  --brand-blue: #2563eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #16a34a;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* Auth shell (login/register pages) */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 24rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.auth-card h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.auth-card p { margin: 0 0 1.25rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-card label { display: block; font-weight: 500; }
.auth-card label.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}
.auth-card label.consent input[type="checkbox"] {
  width: auto;
  margin: 0.15rem 0 0 0;
  flex: 0 0 auto;
}
.auth-card label.consent span { line-height: 1.4; }
.auth-card input {
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  margin-top: 0.25rem;
  box-sizing: border-box;
}
.auth-card input:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
}
.auth-card button.primary {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-card button.primary:hover { filter: brightness(1.05); }
.auth-card .links {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.auth-card .alert {
  background: #fef2f2;
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.auth-card .field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted, #64748b);
}
.auth-card .field-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--danger);
}
/* Show invalid-state border only after the field has been touched (blurred
   with content, or the form has been submitted once). Prevents the jarring
   red halo on a field the user hasn't interacted with yet. */
.auth-card form.submitted input:not(:placeholder-shown):invalid,
.auth-card input.touched:not(:placeholder-shown):invalid {
  border-color: var(--danger);
}
.auth-card .pw-wrap {
  position: relative;
}
.auth-card .pw-wrap input {
  padding-right: 3rem;
}
.auth-card .pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted, #64748b);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}
.auth-card .pw-toggle:hover { color: var(--brand-blue); }
.auth-card .pw-meter {
  display: block;
  margin-top: 0.35rem;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
}
.auth-card .pw-meter > span {
  display: block;
  height: 100%;
  width: 0;
  transition: width 120ms linear, background-color 120ms linear;
}
.auth-card .demo-hint {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e40af;
}
.auth-card .demo-hint strong { font-weight: 600; }
.auth-card .demo-hint code {
  background: #dbeafe;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.auth-card .demo-hint small {
  display: block;
  margin-top: 0.35rem;
  color: #3b82f6;
  font-size: 0.75rem;
}
.auth-card .ok {
  background: #f0fdf4;
  color: var(--success);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 640px) {
  .auth-card { padding: 1.25rem; }
}

/* RadzenHeader: brand-coloured bar so the "Sensrik" wordmark + user email
   (which use rz-color-base-50 = white text) are actually readable. The
   default Radzen "default" theme renders the header white-on-white. */
.rz-header {
  background: var(--brand-blue) !important;
  color: #fff !important;
}
.rz-header a, .rz-header .rz-link, .rz-header .rz-text { color: #fff !important; }
.rz-header .rz-button { color: #fff !important; }
.rz-header .rz-sidebar-toggle,
.rz-header .rz-sidebar-toggle .rzi,
.rz-header .rz-sidebar-toggle .notranslate {
  color: #fff !important;
  background: transparent !important;
  border: none !important;
}
.rz-header .rz-sidebar-toggle:hover { background: rgba(255,255,255,0.12) !important; }
