/* Signarama portal shell.
   Brand tokens below are PLACEHOLDERS pending Ethan's brand assets (see STATUS.md open items).
   Contrast is measured, not eyeballed: --brand vs white text = 8.0:1 (AAA);
   --text vs --surface = 16.1:1; --text-muted vs white = 7.1:1; dark-mode muted = 8.1:1. */

/* Inter, self-hosted from the shared dir. No external font request, so nothing renders
   late or leaks a referrer. font-display:swap so text is readable before the file lands. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/_shared/fonts/inter/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/_shared/fonts/inter/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/_shared/fonts/inter/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/_shared/fonts/inter/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/_shared/fonts/inter/inter-800.woff2') format('woff2');
}

:root {
  --brand: #0B4F9E;
  --brand-hover: #093F7E;
  --accent: #D22630;          /* 5.2:1 on white, badges and destructive actions only */

  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-2: #EEF4FB;
  --text: #0F172A;
  --text-muted: #4A5A6E;
  --border: #D3DEEA;
  --header-bg: var(--brand);
  --header-text: #FFFFFF;

  --table-header-bg: var(--brand);
  --table-row-even: #EEF4FB;
  --table-row-hover: #DCE9F7;

  --ok: #0F6B3F;              /* 6.6:1 on white */
  --ok-ink: #FFFFFF;          /* the check glyph, on --ok */

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0F1720;
  --surface: #16202C;
  --surface-2: #1C2836;
  --text: #E8EDF3;
  --text-muted: #9FB0C4;
  --border: #2A3949;
  --header-bg: #0B4F9E;
  --header-text: #FFFFFF;

  --table-header-bg: #0B4F9E;
  --table-row-even: #1C2836;
  --table-row-hover: #24344A;

  --ok: #34D399;              /* 9.4:1 on the dark page */
  --ok-ink: #0F1720;          /* dark check on the bright fill, 9.4:1 */

  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
[data-theme="dark"] a { color: #7FB3EE; }

/* --- app frame: the page never scrolls, panels do --- */

.app-layout {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-header {
  flex-shrink: 0;
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 64px;
}

.app-header .wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-right: 4px;
}

.app-header .client-name {
  font-size: 15px;
  opacity: .92;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, .3);
}

.app-header .spacer { flex: 1; }

.app-header .who {
  font-size: 15px;
  text-align: right;
  line-height: 1.25;
}

.app-header .who .role {
  display: block;
  font-size: 13px;
  opacity: .85;
  text-transform: capitalize;
}

.theme-toggle,
.header-btn {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #FFFFFF;
  border-radius: 8px;
  height: 38px;
  min-width: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.header-btn:hover { background: rgba(255, 255, 255, .26); }

.main-content {
  flex: 1;
  overflow: auto;
  padding: 28px 24px 40px;
}

.content-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.page-header { flex-shrink: 0; margin-bottom: 22px; }

.page-header h1 {
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -.02em;
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* --- location switcher --- */

.loc-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.loc-chip {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.loc-chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
  font-weight: 600;
}

/* --- tool tiles --- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-card h2 {
  font-size: 18px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-card p {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.tool-card .icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .tool-card .icon { color: #7FB3EE; }

/* Whole tile is the click target. The overlay sits above the card's own content,
   which is why nothing inside the card may be raised above z-index 1. */
.tool-card a.tile-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius);
  text-indent: -9999px;
  overflow: hidden;
}

.tool-card a.tile-link:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.tool-card:hover:not(.soon) { border-color: var(--brand); }

.tool-card.soon { opacity: .72; }

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.badge.live { background: #0F6B3F; color: #FFFFFF; }
.badge.soon { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* --- forms and buttons --- */

.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #FFFFFF;
  cursor: pointer;
}

.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled { opacity: .6; cursor: default; }

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 79, 158, .18);
}

.alert {
  font-size: 15px;
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid;
}

.alert.error {
  background: #FDECEE;
  border-color: #F0B4B9;
  color: #8A1A22;   /* 7.6:1 on its own tint */
}

[data-theme="dark"] .alert.error {
  background: #33161A;
  border-color: #6B2A31;
  color: #FFC2C7;
}

/* --- login --- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.login-card h1 {
  font-size: 23px;
  margin: 0 0 6px;
}

.login-card .sub {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 15px;
}

.login-card .btn { width: 100%; }

.muted { color: var(--text-muted); font-size: 15px; }

@media (max-width: 640px) {
  .app-header { padding: 0 14px; gap: 10px; }
  .app-header .client-name { display: none; }
  .main-content { padding: 20px 14px 32px; }
}
