/* Thompson brand (Quick Guide 2020): Calibri for internal/UI; colors per Pantone refs. */
:root {
  /* Brand */
  --tcs-navy: #003c71;
  --tcs-orange: #f8991d;
  --tcs-gray: #77787b;
  --tcs-teal: #4e87a0;
  --tcs-green: #009a44;

  --bg: #f0f3f7;
  --surface: #ffffff;
  --border: #d8dde6;
  --text: #1a1f26;
  --muted: #5a5d62;
  --accent: var(--tcs-navy);
  --accent-secondary: var(--tcs-orange);
  --accent-soft: rgba(0, 60, 113, 0.08);
  --accent-warm-soft: rgba(248, 153, 29, 0.12);
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 60, 113, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 60, 113, 0.07);
  --header-h: 3.5rem;

  font-family: Calibri, "Segoe UI", Candara, system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 1rem;
}

/* —— Site header (navy bar; wordmark as text per logo guide when image not embedded) —— */
.site-header {
  background: var(--tcs-navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
  padding: 0.65rem 0;
}

.site-brand:hover {
  opacity: 0.94;
}

.site-brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.site-brand__tag {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.88;
  color: rgba(255, 255, 255, 0.85);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.site-user {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

.site-user strong {
  color: #fff;
  font-weight: 600;
}

/* —— Layout —— */
.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.page--wide {
  max-width: 920px;
}

.layout-login .page {
  max-width: 440px;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.layout-login .login-panel {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.login-card-accent {
  height: 4px;
  margin: -1.5rem -1.5rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(
    90deg,
    var(--tcs-teal) 0%,
    var(--tcs-navy) 45%,
    var(--tcs-orange) 100%
  );
}

/* —— Page hero (title strip below header on inner pages) —— */
.page-hero {
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--tcs-navy);
  letter-spacing: -0.02em;
  line-height:1.25;
}

.page-hero p,
.page-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 52ch;
}

.nav-back {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}

.nav-back a {
  color: var(--tcs-teal);
  font-weight: 600;
  text-decoration: none;
}

.nav-back a:hover {
  color: var(--tcs-navy);
  text-decoration: underline;
}

/* —— Cards —— */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.5rem 1.35rem;
  margin-top: 1.25rem;
}

.card:first-of-type {
  margin-top: 0;
}

.card--flat {
  box-shadow: var(--shadow);
}

.card__title {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tcs-gray);
}

.form-section {
  margin-bottom: 0;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.form-section h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tcs-navy);
  padding: 0 0 0.55rem;
  border-bottom: 2px solid var(--tcs-orange);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--tcs-orange);
  border-radius: 2px;
}

.field {
  margin-bottom: 1.1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.label-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  color: var(--text);
}

.help-btn {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--tcs-teal);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.help-btn:hover,
.help-btn:focus-visible {
  background: var(--accent-soft);
  border-color: var(--tcs-teal);
  color: var(--tcs-navy);
  outline: none;
}

.help-panel {
  display: none;
  margin: 0.35rem 0 0.5rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--tcs-teal);
}

.help-panel.is-open {
  display: block;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--tcs-teal);
  box-shadow: 0 0 0 3px rgba(78, 135, 160, 0.2);
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  margin-top: 0.35rem;
}

.inline-options label {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.inline-options input[type="radio"],
.inline-options input[type="checkbox"] {
  accent-color: var(--tcs-navy);
}

.actions--plain {
  border: none;
  padding-top: 0;
  margin-top: 1rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}

.btn--primary {
  background: var(--tcs-orange);
  color: #fff;
  border-color: var(--tcs-orange);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--secondary {
  background: var(--tcs-navy);
  color: #fff;
  border-color: var(--tcs-navy);
}

.btn--secondary:hover {
  filter: brightness(1.08);
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.btn--sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
}

button[type="submit"] {
  padding: 0.6rem 1.35rem;
  border: 2px solid var(--tcs-orange);
  border-radius: var(--radius-sm);
  background: var(--tcs-orange);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s;
}

button[type="submit"]:hover {
  filter: brightness(1.05);
}

.logout-form {
  margin: 0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--tcs-teal);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}

.link-button:hover {
  color: var(--tcs-navy);
}

.thanks .card p,
.card.thanks p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.thanks .card p:last-child,
.card.thanks p:last-child {
  margin-bottom: 0;
}

.thanks a,
.card.thanks a {
  color: var(--tcs-teal);
  font-weight: 600;
}

.error-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #8b1a1a;
  background: #fdeded;
  border: 1px solid #e8b4b4;
  border-radius: var(--radius-sm);
}

.login-panel .error-banner {
  margin-top: 0;
}

.login-form .field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--tcs-navy);
}

.login-sub {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-sub code {
  font-size: 0.88em;
}

.login-actions {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
}

.muted,
p.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.flash {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.flash-success {
  background: rgba(0, 154, 68, 0.1);
  border: 1px solid rgba(0, 154, 68, 0.35);
  color: #0d5c2e;
}

.flash-error {
  background: #fdeded;
  border: 1px solid #e8b4b4;
  color: #8b1a1a;
}

/* —— Hub —— */
.hub-grid {
  display: grid;
  gap: 1.15rem;
  margin-top: 0.5rem;
}

@media (min-width: 700px) {
  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 11rem;
}

.hub-card:hover {
  border-color: var(--tcs-teal);
  box-shadow: 0 8px 28px rgba(0, 60, 113, 0.1);
  transform: translateY(-2px);
}

.hub-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--tcs-navy);
}

.hub-card p {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.hub-card-cta {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--tcs-orange);
}

.hub-card:hover .hub-card-cta {
  text-decoration: underline;
}

.report-card .card__title {
  margin-bottom: 0.65rem;
}

.results-heading {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tcs-navy);
}

.report-pre {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Segoe UI Mono", ui-monospace, monospace;
}

#zip-upload-row {
  padding: 1rem;
  background: var(--accent-warm-soft);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(248, 153, 29, 0.45);
}

#zip.upload-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
