/* ============================================================================
   Emergency Contacts Portal — visual system v2
   ----------------------------------------------------------------------------
   This is not a lifestyle app. It is read in one of two states: calm (almost
   never opened, everything fine) or a real emergency (someone is scared,
   has seconds, and needs a phone number — not a UI to admire). So this
   design borrows directly from things built for that exact situation:
   ICE wallet cards, Red Cross contact cards, NOAA/EAS alert bars, and
   gov.uk/ready.gov style public-safety sites. Bold red = alert. Blue = act
   (call, open). Green = calm / done. Squared corners, thick rules, one
   typeface (Public Sans — the US government's own accessible typeface),
   and every phone number on the site renders as a full-size tap-to-call
   button automatically. Updating information happens calmly in Admin,
   never here — this surface is read-only, fast, and nothing else.
   ============================================================================ */

:root {
  --white: #ffffff;
  --paper: #f4f5f7;
  --surface-2: #eceef1;
  --line: #d3d8de;
  --line-strong: #9aa3ad;
  --ink: #14181d;
  --ink-muted: #545e6b;

  /* Signal colors — meaning is fixed, never decorative */
  --red: #c8102e;        /* alert / critical / emergency active */
  --red-dark: #96081f;
  --blue: #1d4f91;        /* act: call, open, primary buttons */
  --blue-dark: #143a6c;
  --green: #1e7a34;       /* calm / all clear / complete */
  --green-dark: #145924;
  --amber: #a15c00;       /* caution / important, one notch under red */
  --amber-bg: #fdf0d9;

  --bg: var(--paper);
  --surface: var(--white);
  --border: var(--line);
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --accent: var(--blue);
  --accent-text: #ffffff;
  --danger: var(--red);
  --danger-text: #ffffff;

  --font: "Public Sans", "Segoe UI", Arial, system-ui, sans-serif;
  --font-display: var(--font);
  --font-mono: var(--font);

  --radius: 4px;
  --radius-sm: 3px;
}

[data-bs-theme="dark"] {
  --bg: #0f1216;
  --surface: #181c22;
  --surface-2: #22272e;
  --border: #333a44;
  --line-strong: #4a535f;
  --text: #eef1f4;
  --text-muted: #a7b0bc;
  --accent: #5b8fd6;
  --accent-text: #061323;
  --red: #ff5b5b;
  --danger: var(--red);
  --danger-text: #2b0503;
  --green: #4caf60;
  --amber: #e0a941;
  --amber-bg: #3a2c10;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

h1, h2, h3, h4, h5, h6 { font-family: var(--font); font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--blue); }
[data-bs-theme="dark"] a { color: var(--accent); }

.eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

/* ----------------------------------------------------------------------
   Signature: the alert bar. Calm = plain dark bar. Active = hazard
   stripes, the one deliberately loud element on the whole site.
   -------------------------------------------------------------------- */
.status-strip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1.25rem;
  background: var(--ink);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.status-strip .status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.status-strip.is-alert {
  color: #fff;
  background: repeating-linear-gradient(
    135deg,
    var(--red) 0px, var(--red) 22px,
    #1a1a1a 22px, #1a1a1a 44px
  );
  background-size: 200% 200%;
  animation: hazard-scroll 14s linear infinite;
}
.status-strip.is-alert .status-dot { background: #fff; }
.status-strip.is-alert .status-strip-inner {
  background: rgba(0,0,0,.55);
  padding: .3rem .75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: .55rem;
}
@keyframes hazard-scroll {
  0% { background-position: 0 0; }
  100% { background-position: 200px 0; }
}
.status-strip .status-strip-time {
  margin-left: auto;
  opacity: .8;
  text-transform: none;
  font-weight: 400;
  font-size: .75rem;
}

/* ----------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------- */
.app-navbar {
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  padding: .6rem 1.25rem;
}
.app-navbar .navbar-brand {
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.app-navbar .navbar-brand .brand-mark {
  width: 10px; height: 10px; background: var(--red); flex-shrink: 0;
}
.app-navbar .nav-link {
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 600;
  padding: .5rem .7rem !important;
  border-radius: var(--radius-sm);
}
.app-navbar .nav-link:hover { color: var(--ink); background: var(--surface-2); }
.app-navbar .nav-link.active-nav { color: var(--white); background: var(--blue); }
.app-navbar .navbar-text { color: var(--text-muted); font-size: .85rem; }

#themeToggle { border-color: var(--border); color: var(--text-muted); background: transparent; }
#themeToggle:hover { color: var(--text); border-color: var(--line-strong); }

/* ----------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------- */
.app-main { padding: 2rem 1.25rem 3rem; max-width: 1180px; margin: 0 auto; }
.app-footer { color: var(--text-muted); border-top: 1px solid var(--border); font-size: .8rem; }

/* ----------------------------------------------------------------------
   Cards — sharp corners, thick left rule, like a placard not an app tile
   -------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}
.card-header {
  background: var(--surface-2);
  border-bottom: 2px solid var(--ink);
  font-weight: 800;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .7rem 1.1rem;
}
.card-body { padding: 1.1rem; }

.summary-highlight {
  border: 2px solid var(--ink);
  border-left: 8px solid var(--blue);
  background: var(--surface);
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius);
}
.summary-highlight.is-alert {
  border-color: var(--red);
  border-left-color: var(--red);
  background: #fdecec;
}
[data-bs-theme="dark"] .summary-highlight.is-alert { background: #2c1414; }

/* ----------------------------------------------------------------------
   Buttons — big, bold, unmistakable
   -------------------------------------------------------------------- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .9rem;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.btn-lg { min-height: 52px; font-size: 1.05rem; }

.btn-brand { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-brand:hover, .btn-brand:focus { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }

.btn-outline-secondary { color: var(--ink); border: 2px solid var(--border); }
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }

.btn-outline-danger { color: var(--red); border: 2px solid var(--red); }
.btn-outline-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

.btn-outline-warning { color: var(--amber); border: 2px solid var(--amber); }
.btn-outline-warning:hover { background: var(--amber); border-color: var(--amber); color: #fff; }

/* ----------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------- */
.form-control, .form-select {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
  background: var(--surface);
  color: var(--text);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 79, 145, .18);
}
.form-control::placeholder { color: var(--text-muted); opacity: .7; }
.form-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: .3rem; }

/* ----------------------------------------------------------------------
   Landing / login hero — plain, direct, no ornament
   -------------------------------------------------------------------- */
.landing-hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}
.landing-hero .brand-mark-lg {
  width: 46px; height: 46px;
  background: var(--red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem;
  margin-bottom: 1.25rem;
}
.landing-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .01em; }
.landing-hero .lede { color: var(--text-muted); font-size: 1.02rem; max-width: 480px; margin: 0 auto; }

.notice-box {
  border: 2px solid var(--ink);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: left;
  max-width: 620px;
  margin: 2rem auto 0;
  line-height: 1.6;
}
.notice-box p { margin-bottom: .85rem; }
.notice-box p:last-child { margin-bottom: 0; }

.curiosity-notice {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: 1.1rem;
}

/* ----------------------------------------------------------------------
   Public emergency banner — shown pre-login on landing/login pages
   -------------------------------------------------------------------- */
.public-emergency-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  padding: .9rem 1.25rem;
  background: repeating-linear-gradient(135deg, var(--red) 0px, var(--red) 22px, #1a1a1a 22px, #1a1a1a 44px);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .92rem;
  letter-spacing: .02em;
}
.public-emergency-banner span.banner-text {
  background: rgba(0,0,0,.55);
  padding: .35rem .8rem;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------- */
.badge { font-weight: 700; letter-spacing: .02em; border-radius: var(--radius-sm); text-transform: uppercase; font-size: .68rem; }
.badge-critical { background: var(--red); color: #fff; }
.badge-important { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.badge-info { background: var(--blue); color: #fff; }
.badge-resolved { background: var(--green); color: #fff; }

/* ----------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------- */
table.table { color: var(--text); font-size: .88rem; }
.table>:not(caption)>*>* { background: transparent; color: var(--text); border-color: var(--border); }
.table thead th { color: var(--text-muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--ink); }

/* ----------------------------------------------------------------------
   Ordered sequences (checklist, priority contacts) — order is real data
   -------------------------------------------------------------------- */
.ordinal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: .78rem;
  color: var(--ink);
  flex-shrink: 0;
}
.checklist-row { display: flex; align-items: center; gap: .65rem; padding: .6rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.checklist-row:last-child { border-bottom: none; }
.checklist-row .check-btn { background: none; border: none; padding: 0; line-height: 1; }

/* ----------------------------------------------------------------------
   Quick-facts tiles
   -------------------------------------------------------------------- */
.info-tile {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.2rem;
}
.info-tile-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.info-tile-value { font-size: 1.2rem; font-weight: 800; }
.info-tile-sub { font-size: .82rem; color: var(--text-muted); }

/* ----------------------------------------------------------------------
   Every phone number on the site is a real, one-tap call button —
   no small links, no hunting for the digits.
   -------------------------------------------------------------------- */
a[href^="tel:"] {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--blue);
  color: #fff !important;
  font-weight: 700;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
a[href^="tel:"]:hover, a[href^="tel:"]:focus { background: var(--blue-dark); }
a[href^="tel:"]::before { content: "\260E"; font-size: .95em; }

/* ----------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------- */
.alert { border-radius: var(--radius-sm); border: 2px solid var(--border); font-weight: 500; }
.alert-success { background: #e9f5eb; color: var(--green-dark); border-color: var(--green); }
.alert-danger  { background: #fdecec; color: var(--red-dark); border-color: var(--red); }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.alert-secondary { background: var(--surface-2); color: var(--text-muted); }
[data-bs-theme="dark"] .alert-success { background: #123018; color: #bfe8c8; }
[data-bs-theme="dark"] .alert-danger  { background: #3a1414; color: #ffcfcf; }

::selection { background: var(--blue); color: #fff; }

a:focus-visible, button:focus-visible, input:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
