:root {
  --color-bg: #f6f4ef;
  --color-shell: #1b2430;
  --color-accent: #e8a23d;
  --color-accent-dark: #c98a2c;
  --color-success: #2e7d5b;
  --color-danger: #c0432f;
  --color-warning: #b9791f;
  --color-card: #ffffff;
  --color-text: #1b2430;
  --color-text-muted: #6b7280;
  --radius: 3px;

  --font-display: "Oswald", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-data: "JetBrains Mono", monospace;
}

/* The `hidden` attribute must always win over any component's own `display`
   rule (flex/grid/inline-block/etc.) -- without `!important` here, any class
   that sets `display` on a hideable element silently defeats `el.hidden = true`
   since both rules have equal specificity and the class rule loads later. */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--color-shell);
  border-bottom: 3px solid var(--color-accent);
  padding: 1.1rem 2rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.topbar .subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Stacked-logo topbar variant (login/onboarding-style pages) -- centers the
   data-brand="stacked" lockup above the subtitle instead of the default
   side-by-side row. */
.topbar-brand-header {
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.5rem 2rem 1.25rem;
}

.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.35rem;
}

.login-card p.lead {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1.75rem;
}

.internal-access-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent-dark);
  margin: 0 0 0.6rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid #d8d5cc;
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
}

.field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(232, 162, 61, 0.2);
}

.btn-login {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-shell);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-login:hover:not(:disabled) {
  background: var(--color-accent-dark);
}

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-message {
  display: none;
  margin-top: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(192, 67, 47, 0.08);
  border: 1px solid rgba(192, 67, 47, 0.25);
  color: var(--color-danger);
  font-size: 0.85rem;
}

.error-message.visible {
  display: block;
}

/* ---------- Brand logo (static/js/brand.js is the single source of truth
   for the SVG markup -- LOGOMARK/LOGO_HORIZONTAL/LOGO_STACKED are each
   self-colored for one fixed context, so unlike the old route-mark icon
   there's no currentColor/light-vs-dark swap needed here. This file only
   constrains the *container* pixel size; the SVG's own viewBox handles its
   internal layout and aspect ratio. ---------- */

/* data-brand="LOGOMARK"/"LOGOMARK_SQUARE" -- compact icon, sized
   per-container (internal-page sidebars use inline HTML + .slt-* classes
   instead of this, per app.css -- these two stay available for any other
   compact-icon placement). */
[data-brand="LOGOMARK"] svg,
[data-brand="LOGOMARK_SQUARE"] svg {
  display: block;
  width: 40px;
  height: 40px;
}

/* data-brand="LOGO_HORIZONTAL" -- topbar lockup, dark navy backgrounds only.
   Fixed height so it never overflows the topbar; width follows the SVG's
   own 380:48 aspect ratio. (max-height alone doesn't give a replaced
   element like <svg> a definite size to resolve width:auto against --
   it needs an explicit height.) */
[data-brand="LOGO_HORIZONTAL"] svg {
  display: block;
  height: 36px;
  width: auto;
}

/* data-brand="LOGO_STACKED"/"LOGO_STACKED_DARK" -- login/onboarding
   lockup. LOGO_STACKED is for genuinely light backgrounds (e.g. the
   index.html login card); LOGO_STACKED_DARK is for the dark .topbar header
   every standalone/login page actually uses. */
[data-brand="LOGO_STACKED"] svg,
[data-brand="LOGO_STACKED_DARK"] svg {
  display: block;
  width: 220px;
  height: auto;
  max-width: 100%;
}
