/*
  Real Brownclaw Asset Management brand — ink & gold.

  Colors below were sampled directly from the live brownclawam.ca site
  (dark ink hero, gold CTA, warm neutrals — never cold gray). This file is
  intentionally duplicated per app (each app's own web/styles/brand.css)
  rather than shared, since each app's web/ is deployed as its own independent
  Static Web App with no build step / module system to import a shared CSS
  file from — see docs/ARCHITECTURE.md, "Why brand tokens aren't unified".
  Keep these values in sync across every app's copy, and with
  packages/bearclaw_common/bearclaw_common/brand.py (used by backends, e.g.
  for Excel report headers).

  Functional colors (success/error/warning/info) were NOT visible in the
  reference screenshot (no example swatches were shown for them) and are
  best-effort warm-toned choices consistent with the ink/gold palette —
  swap them for the real values from the brand guide's "Functional Colors"
  section once you have exact hex codes for healthy/critical/info/warning.
*/
:root {
  /* Ink / neutral scale — warm, never cold gray */
  --bc-ink-900: #1a1a1a;   /* page background; also the text color ON gold surfaces */
  --bc-ink-800: #2b2722;   /* card / panel background */
  --bc-ink-700: #3a352c;   /* borders, dividers on dark surfaces */
  --bc-ink-600: #55503f;   /* disabled fills, subtler borders */
  --bc-cream: #faf8f3;     /* headline / primary text on dark */
  --bc-muted: #8b8a87;     /* secondary / muted text on dark (nav links, hints) */

  /* Gold scale */
  --bc-gold-700: #b8790a;  /* deep gold — readable text/link gold on LIGHT surfaces */
  --bc-gold-500: #fdb913;  /* primary gold — button fills */
  --bc-gold-400: #ffc940;  /* bright accent — eyebrow labels, stat numbers, links on dark */

  /* Functional colors — placeholders, see note above */
  --bc-success: #3fae74;
  --bc-success-text: #7fd9a4;
  --bc-error: #d64545;
  --bc-error-text: #ef8f8f;
  --bc-warning: var(--bc-gold-400);
  --bc-info: #7a93a8;
  --bc-info-text: #a9bdcc;

  --bc-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bc-ink-900);
  color: var(--bc-cream);
}

header.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 28px;
  background: var(--bc-ink-900);
  color: var(--bc-cream);
  border-bottom: 1px solid var(--bc-ink-700);
}

/*
  Brownclaw lockup (gold paw mark + wordmark) on its own ink background, which
  is the same colour as the header, so it sits in the header without a visible
  box. The image is trimmed to the artwork; it is not recoloured.
*/
header.app-header .brand-logo {
  display: block;
  height: 72px;
  width: auto;
}

header.app-header .header-divider {
  width: 1px;
  height: 44px;
  background: var(--bc-ink-700);
}

header.app-header .titles h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bc-cream);
}

header.app-header .titles p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--bc-gold-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

header.app-header .user-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

header.app-header .user-bar[hidden] { display: none; }

header.app-header .user-name {
  font-size: 0.85rem;
  color: var(--bc-muted);
}

button.secondary.small {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.auth-gate[hidden], #app-content[hidden], #cancel-btn[hidden] { display: none; }

.auth-gate p {
  margin: 0 0 16px;
  color: var(--bc-cream);
  line-height: 1.5;
}

main {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

.card {
  background: var(--bc-ink-800);
  border: 1px solid var(--bc-ink-700);
  border-radius: 10px;
  box-shadow: var(--bc-shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--bc-gold-400);
  border-bottom: 1px solid var(--bc-ink-700);
  padding-bottom: 10px;
}

.dropzone {
  border: 2px dashed var(--bc-gold-700);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--bc-muted);
  background: var(--bc-ink-900);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dropzone.dragover {
  background: var(--bc-ink-700);
  border-color: var(--bc-gold-400);
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--bc-gold-500);
  color: var(--bc-cream);
  font-weight: 600;
}

.field {
  margin-top: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bc-gold-400);
  margin-bottom: 6px;
}

.field input[type="text"], .field input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--bc-ink-700);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bc-ink-900);
  color: var(--bc-cream);
}

.field input[type="text"]::placeholder { color: var(--bc-muted); }

.field input[type="text"]:focus, .field input[type="file"]:focus {
  outline: none;
  border-color: var(--bc-gold-500);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

button.primary {
  background: var(--bc-gold-500);
  color: var(--bc-ink-900);
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

button.primary:hover:not(:disabled) { background: var(--bc-gold-400); }
button.primary:disabled { background: var(--bc-ink-600); color: var(--bc-muted); cursor: not-allowed; }

button.secondary {
  background: transparent;
  color: var(--bc-gold-400);
  border: 1px solid var(--bc-gold-700);
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

button.secondary:hover { background: var(--bc-ink-700); border-color: var(--bc-gold-400); }

.hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--bc-muted);
  font-style: italic;
}

.hint.hidden { display: none; }

.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  font-size: 0.88rem;
  display: none;
}

.status.visible { display: block; }
.status.info { background: rgba(122, 147, 168, 0.12); color: var(--bc-info-text); border-left-color: var(--bc-info); }
.status.success { background: rgba(63, 174, 116, 0.12); color: var(--bc-success-text); border-left-color: var(--bc-success); }
.status.error { background: rgba(214, 69, 69, 0.12); color: var(--bc-error-text); border-left-color: var(--bc-error); }

.status a { color: var(--bc-gold-400); font-weight: 600; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--bc-ink-700);
  border-top-color: var(--bc-gold-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.summary-tile {
  background: var(--bc-ink-900);
  border: 1px solid var(--bc-ink-700);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

.summary-tile .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bc-gold-400);
}

.summary-tile .label {
  font-size: 0.72rem;
  color: var(--bc-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

footer.app-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--bc-muted);
  padding: 20px;
}
