/* ===================================================================
   RailNexus — login/portal styles
   Visual parity with bnsf-portal-wilson.surge.sh
   =================================================================== */

:root {
  --navy: #0b1e3d;          /* page background / headings */
  --navy-deep: #081729;     /* radial edge */
  --navy-panel: #0e254a;    /* logo box on portal view */
  --orange: #e8641c;        /* primary action */
  --orange-hover: #cf551338;
  --orange-solid-hover: #cf5513;
  --ink: #16233a;           /* dark text on white */
  --muted: #6b7a90;         /* secondary text */
  --line: #e3e8f0;
  --white: #ffffff;
  --tile-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --focus: #ffb27a;
  --radius: 16px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  color: var(--white);
  background:
    radial-gradient(1200px 800px at 70% 30%, #12305e 0%, var(--navy) 45%, var(--navy-deep) 100%);
  min-height: 100vh;
}

.view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.view[hidden] { display: none; }

/* ---------- Brand lockup (marketing image asset) ---------- */
.wordmark-slot {
  display: flex;
  justify-content: center;
}
.lockup-img {
  display: block;
  width: 100%;
  height: auto;
}
/* Matches the main site's boxed header logo:
   background:#fff; border-radius:12px; padding:14px 28px; img max 300px */
.wordmark-slot--boxed {
  background: var(--white);
  padding: 14px 28px;
  border-radius: 12px;
  box-shadow: var(--tile-shadow);
}
.wordmark-slot--boxed .lockup-img {
  width: 300px;
  max-width: 80vw;
}

/* ---------- Login view ---------- */
.card {
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--tile-shadow);
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 34px 34px;
  text-align: center;
}
/* Matches the main site's login logo: max-width:260px; margin:0 auto 14px */
.login-card .wordmark-slot { max-width: 260px; margin: 0 auto 14px; }

.welcome {
  margin: 26px 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.welcome-sub {
  margin: 0 auto 22px;
  max-width: 280px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

#login-form { text-align: left; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 16px 0 7px;
}
.text-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.text-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 100, 28, 0.18);
}
.error-msg {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #c02626;
  font-weight: 600;
}
.error-msg[hidden] { display: none; }

.btn-primary {
  width: 100%;
  margin-top: 22px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  background: var(--orange);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn-primary:hover { background: var(--orange-solid-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Portal view ---------- */
.portal-view { gap: 0; }
.logo-block { margin-bottom: 26px; }
.portal-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  text-align: center;
}
.portal-sub {
  margin: 8px 0 0;
  font-size: 14px;
  color: #b9c6db;
  text-align: center;
}
.wilson-mark {
  margin: 20px 0 34px;
  text-align: center;
}
/* Matches the main site: white Wilson & Company logo via invert filter */
.wilson-mark img {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
  max-width: 1360px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 34px 22px 30px;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--tile-shadow);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
}
.tile:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.tile-icon {
  width: 44px;
  height: 44px;
  color: var(--navy);
}
/* Image tile icons (copied from the main site) — its X icon is 52x52 */
.tile-icon-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
/* Railroad brand rendered above the module title (text now; swap for the
   railroad's logo image via config brandLogo when the asset is available) */
.tile-brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}
.tile-brand-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
}
.tile-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.tile-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.tile-badge {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--orange);
}
/* Coming-soon tile: visible but inert */
.tile--disabled {
  cursor: default;
  opacity: 0.75;
}
.tile--disabled:hover {
  transform: none;
  box-shadow: var(--tile-shadow);
}

/* Back to the marketing landing page */
.portal-back {
  margin-top: 30px;
  font-size: 13px;
  font-weight: 600;
  color: #b9c6db;
  text-decoration: none;
}
.portal-back:hover { color: var(--white); text-decoration: underline; }
.portal-back:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Footer */
.portal-footer { margin-top: 24px; text-align: center; }
.footer-access {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #8ea3c2;
}
.footer-brand {
  margin: 8px 0 0;
  font-size: 11px;
  color: #5f739a;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 940px; }
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; max-width: 360px; }
  .portal-title { font-size: 22px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .tile, .btn-primary { transition: none; }
  .tile:hover { transform: none; }
}
