/*
 * platform/css/app.css
 *
 * FirstCome customer-platform stylesheet.
 *
 * Hand-written design-system implementation that mirrors the marketing
 * landing page (firstcome.co.uk). Per Founder Decision D-CP1 and D17.3,
 * this is the single bind-mounted asset Nginx serves at /static/platform/
 * css/app.css. No Node/Tailwind build step is invoked at runtime.
 *
 * The class vocabulary is the `.fc-*` namespace. Tailwind arbitrary-value
 * classes (used by Phase 8A.1) are NOT relied upon; this file replaces the
 * earlier compiled Tailwind output (commit 30fd6f9) outright.
 *
 * IP-boundary note: this file is excluded from the Phase 5 sentinel scan
 * (tests/ip_boundary/test_phase5_sentinel_scan.py EXCLUDED_PATHS).
 * Class names below deliberately avoid the sentinel vocabulary so rendered
 * HTML continues to pass the Phase 6 scan.
 */

/* ===== Design tokens (lifted verbatim from firstcome.co.uk) ===== */
:root {
  --bg: #0d1724;
  --panel: #111f31;
  --panel-soft: #15263b;
  --text: #f5f7fb;
  --muted: #b7c1d1;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #4fb3ff;
  --accent-2: #8be0c8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --pill-mint: #baf4e6;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 179, 255, 0.22), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(139, 224, 200, 0.18), transparent 34rem),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.025em;
}

p {
  margin: 0;
}

/* ===== Shell ===== */
.fc-shell {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.fc-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 60%),
    var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.fc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 6px;
}

.fc-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #08111c;
  font-weight: 900;
  box-shadow: 0 12px 34px rgba(79, 179, 255, 0.25);
  flex-shrink: 0;
}

.fc-strap {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0 0 32px;
}

.fc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.fc-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.fc-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.fc-nav-link.is-active {
  background: rgba(79, 179, 255, 0.1);
  color: var(--text);
  border-color: rgba(79, 179, 255, 0.25);
}

/* ===== Main ===== */
.fc-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.fc-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  background: rgba(13, 23, 36, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.fc-content {
  padding: 32px;
  max-width: 1280px;
  width: 100%;
}

/* ===== Page heading ===== */
.fc-page-heading {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 6px;
}

.fc-page-sub {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 28px;
  max-width: 60ch;
}

/* ===== Card ===== */
.fc-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* ===== Opportunity grid ===== */
.fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

/* ===== Opportunity card composition ===== */
.fc-opp-title {
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  color: var(--text);
}

.fc-opp-addr {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.fc-rows {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.fc-row {
  padding: 12px 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.fc-row-label {
  color: var(--muted);
}

.fc-row-value {
  color: var(--text);
  font-weight: 650;
}

.fc-rating-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding-top: 22px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.fc-rating-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent-2) 0 var(--ring-pct, 60%),
    rgba(255, 255, 255, 0.08) var(--ring-pct, 60%) 100%
  );
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.fc-rating-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 850;
  color: var(--text);
}

.fc-rating-inner.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.fc-rating-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fc-rating-label {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== Pills ===== */
.fc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(139, 224, 200, 0.12);
  color: var(--pill-mint);
  border: 1px solid rgba(139, 224, 200, 0.26);
  font-size: 0.78rem;
  font-weight: 600;
}

.fc-pill-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-color: var(--line);
}

/* ===== Buttons ===== */
.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}

.fc-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.fc-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111c;
  box-shadow: 0 14px 35px rgba(79, 179, 255, 0.25);
}

.fc-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(79, 179, 255, 0.32);
}

.fc-btn-secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.fc-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== Empty state ===== */
.fc-empty {
  text-align: center;
  padding: 56px 24px;
}

.fc-empty-heading {
  font-size: 1.25rem;
  font-weight: 750;
  margin: 0 0 8px;
}

.fc-empty-body {
  color: var(--muted);
  max-width: 48ch;
  margin: 0 auto;
}

/* ===== Investigation stub ===== */
.fc-stub {
  max-width: 640px;
}

.fc-stub-body {
  color: var(--text);
  font-size: 1rem;
  margin: 0 0 12px;
}

.fc-stub-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.fc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
}

.fc-back-link:hover {
  text-decoration: underline;
}

/* ===== Cockpit-extras leakage (DEMO badge) ===== */
/* `formatted_address` from cockpit_extras may emit <span class="c-demo-badge">
   on demo records. Style it dark-themed so it doesn't render unstyled. */
.c-demo-badge {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .fc-shell {
    flex-direction: column;
  }

  .fc-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 16px 22px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .fc-strap {
    display: none;
  }

  /* Phase 8B: keep navigation reachable on phones (account, subscription). */
  .fc-sidebar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .fc-nav {
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: 100%;
    flex-basis: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .fc-nav .fc-nav-link {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .fc-content {
    padding: 22px;
  }

  .fc-grid {
    grid-template-columns: 1fr;
  }

  .fc-page-heading {
    font-size: 1.6rem;
  }
}

/* ===== Auction Intelligence (Phase D4.9) ===== */
.fc-filters { margin-bottom: 1.5rem; }
.fc-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.9rem 1rem;
}
.fc-field { display: flex; flex-direction: column; gap: 0.35rem; }
.fc-field-label { font-size: 0.78rem; color: var(--muted); }
.fc-input {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  min-width: 0;
}
.fc-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fc-filter-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.fc-results-count { color: var(--muted); margin: 0 0 1rem; }
.fc-lot { display: flex; flex-direction: column; gap: 0.8rem; }
.fc-lot-top { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fc-pill-accent { background: rgba(139, 224, 200, 0.18); color: var(--pill-mint); }
.fc-lot-flags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.fc-flag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.fc-flag-ok { border-color: rgba(139, 224, 200, 0.5); color: var(--accent-2); }
.fc-flag-info { border-color: rgba(79, 179, 255, 0.5); color: var(--accent); }
.fc-muted { color: var(--muted); }
.fc-small { font-size: 0.8rem; }
.fc-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.fc-section-heading { font-size: 1.05rem; margin-bottom: 0.9rem; }
.fc-subheading { font-size: 0.9rem; margin: 1rem 0 0.4rem; color: var(--muted); }
.fc-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; font-size: 0.88rem; }
.fc-checklist .fc-flag { margin-right: 0.4rem; }
.fc-plain-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.fc-plain-list a { color: var(--accent); }
.fc-why { margin-top: 0.9rem; color: var(--muted); font-size: 0.88rem; }
.fc-callout {
  margin: 1rem 0 0.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}
.fc-callout-ok { border-color: rgba(139, 224, 200, 0.5); }
@media (max-width: 640px) {
  .fc-detail-grid { grid-template-columns: 1fr; }
  .fc-filter-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Phase 8B: customer accounts and billing ─────────────────────────── */
.fc-public { min-height: 100vh; background: var(--bg); color: var(--text); }
.fc-auth { max-width: 460px; margin: 0 auto; padding: 48px 16px 32px; }
.fc-auth-brand { display: inline-flex; margin-bottom: 20px; }
.fc-auth-card { padding: 28px; }
.fc-form p { margin: 0 0 14px; }
.fc-form label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
.fc-form input[type="email"], .fc-form input[type="password"], .fc-form input[type="text"],
.fc-content form input[type="email"], .fc-content form input[type="password"], .fc-content form input[type="text"] {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel-soft); color: var(--text); font: inherit;
}
.fc-form input[type="checkbox"] { margin-right: 8px; }
.fc-form .errorlist, .fc-form ul.errorlist { color: #ffb4a8; list-style: none; padding: 0; margin: 0 0 8px; font-size: 0.9rem; }
.fc-form .helptext { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.fc-form ul:not(.errorlist) { color: var(--muted); font-size: 0.82rem; margin: 6px 0 12px; padding-left: 18px; }
.fc-auth, .fc-auth * { box-sizing: border-box; }
.fc-auth-card h1 { overflow-wrap: anywhere; }
.fc-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.fc-messages { list-style: none; padding: 0; margin: 0 0 16px; }
.fc-message { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-bottom: 8px; }
.fc-message-error { border-color: rgba(255, 140, 120, 0.6); }
.fc-message-success { border-color: rgba(139, 224, 200, 0.5); }
.fc-legal-footer { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 20px 16px; font-size: 0.85rem; }
.fc-legal-footer a { color: var(--muted); }
.fc-user-menu { display: flex; align-items: center; gap: 12px; }
.fc-user-email { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.fc-inline-form { display: inline; margin: 0; }
.fc-btn-small { padding: 6px 12px; font-size: 0.85rem; }
.fc-billing-warning { color: #ffd58a; font-weight: 600; }
.fc-callout-warn { border-color: rgba(255, 213, 138, 0.6); }
.fc-button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.fc-section-gap { margin-top: 28px; }
.fc-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.fc-plan { display: flex; flex-direction: column; gap: 12px; }
.fc-plan.is-current { border-color: var(--accent); }
.fc-plan-name { margin: 0; font-size: 1.2rem; }
.fc-plan-price { font-size: 1.35rem; font-weight: 700; margin: 0; }
.fc-plan-features { list-style: none; padding: 0; margin: 0; flex: 1; }
.fc-plan-features li { padding: 4px 0; font-size: 0.92rem; }
.fc-plan-features .is-excluded { color: var(--muted); text-decoration: line-through; }
.fc-disclosure { margin-top: 16px; max-width: 72ch; }
@media (max-width: 640px) {
  .fc-auth { padding-top: 24px; }
  .fc-auth-card { padding: 20px; }
  .fc-user-email { display: none; }
  .fc-plan-grid { grid-template-columns: 1fr; }
}
