html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --sc-charcoal: #524c40;
  --sc-charcoal-light: #665f4f;
  --sc-gold: #d4a017;
  --sc-gold-dark: #b8890f;
  --sc-paper: #e8e2d5;
  --sc-taupe: #9c9284;
  --sc-bg-alt: #f7f5f1;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--sc-gold);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  color: var(--sc-charcoal);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

/* File upload input - the plain browser default is easy to skim past, so give it a visible
   drop-zone-style border and make the "Choose files" button match the site's primary action colour. */
.form-control[type="file"] {
  border: 2px dashed var(--sc-taupe);
  background-color: var(--sc-bg-alt);
  padding: 0.75rem;
}

.form-control[type="file"]:hover {
  border-color: var(--sc-gold);
}

.form-control[type="file"]::file-selector-button,
.form-control[type="file"]::-webkit-file-upload-button {
  background-color: var(--sc-gold);
  border: none;
  border-radius: 0.375rem;
  color: var(--sc-charcoal);
  font-weight: 600;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.form-control[type="file"]:hover::file-selector-button,
.form-control[type="file"]:hover::-webkit-file-upload-button {
  background-color: var(--sc-gold-dark);
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Brand */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-primary {
  background-color: var(--sc-gold);
  border-color: var(--sc-gold);
  color: var(--sc-charcoal);
  font-weight: 600;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--sc-gold-dark) !important;
  border-color: var(--sc-gold-dark) !important;
  color: var(--sc-charcoal) !important;
}

.btn-outline-light:hover {
  color: var(--sc-charcoal);
}

a {
  color: var(--sc-gold-dark);
}

a:hover {
  color: var(--sc-gold);
}

/* Hero */
.sc-hero {
  background: var(--sc-charcoal);
  color: #fff;
  border-radius: 0.5rem;
  border-top: 4px solid var(--sc-gold);
}

.sc-hero p.lead {
  color: var(--sc-paper);
}

/* Modals */
.modal-content {
  border: none;
  border-top: 4px solid var(--sc-gold);
  border-radius: 0.5rem;
}

.modal-title {
  color: var(--sc-charcoal);
}

/* Feature banner */
.sc-feature-banner {
  background: var(--sc-gold);
  color: var(--sc-charcoal);
  border-radius: 0.5rem;
}

.sc-feature-banner .btn-dark {
  background-color: var(--sc-charcoal);
  border-color: var(--sc-charcoal);
}

.sc-feature-banner .btn-dark:hover, .sc-feature-banner .btn-dark:focus, .sc-feature-banner .btn-dark:active {
  background-color: var(--sc-charcoal-light) !important;
  border-color: var(--sc-charcoal-light) !important;
}

/* Cards */
.sc-card {
  background: var(--sc-bg-alt);
  border-radius: 0.5rem;
  padding: 2rem 1.5rem;
  height: 100%;
  border-left: 3px solid var(--sc-gold);
}

.sc-card h3 {
  color: var(--sc-charcoal);
}

/* Info panel - like .sc-card but without height:100%, which only makes sense when every
   sibling in the row is also a card (e.g. the homepage's three-card grid). Used standalone
   (e.g. next to a form) it has no sane reference height and stretches to fill the page. */
.sc-info-panel {
  background: var(--sc-bg-alt);
  border-radius: 0.5rem;
  padding: 1.75rem;
  border-left: 3px solid var(--sc-gold);
}

.sc-info-panel h3 {
  color: var(--sc-charcoal);
  font-size: 1.15rem;
}

.sc-info-panel ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.sc-info-panel li {
  margin-bottom: 0.5rem;
}

.sc-info-panel li:last-child {
  margin-bottom: 0;
}

/* Chat with your statement (Insights Results page) */
.sc-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 22rem;
  overflow-y: auto;
}

.sc-chat-bubble {
  max-width: 80%;
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  white-space: pre-wrap;
}

.sc-chat-bubble-user {
  align-self: flex-end;
  background: var(--sc-gold);
  color: var(--sc-charcoal);
}

.sc-chat-bubble-assistant {
  align-self: flex-start;
  /* .sc-info-panel (the parent) is already --sc-bg-alt, so the bubble needs its own tone to
     read as a distinct bubble rather than blending into the panel background. */
  background: var(--sc-paper);
  border-left: 3px solid var(--sc-gold);
  color: var(--sc-charcoal);
}

/* Print (used for the Insights Results "Download PDF" button, via window.print()) */
.print-header {
  display: none;
}

@media print {
  .no-print {
    display: none !important;
  }

  .print-header {
    display: block;
  }

  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .sc-card {
    break-inside: avoid;
    border: 1px solid #ddd;
  }

  /* Bootstrap's row/col grid is flexbox, and flexbox doesn't paginate across printed
     pages - a tall column (e.g. a long subscription list) overflows into the space
     browsers have already laid out for the next row, so cards end up visually
     interleaved. Stack everything into a single column for print so each card flows
     top-to-bottom in normal block order instead. */
  .row {
    display: block !important;
  }

  .row > [class*="col-"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1rem;
  }

  .h-100 {
    height: auto !important;
  }
}

/* Processing-page loading mark - the brand triangle with a highlight chasing around
   its perimeter and through each node, instead of a generic spinner. */
.sc-loading-track {
  opacity: 0.3;
}

.sc-loading-comet {
  stroke-dasharray: 50 400;
  filter: drop-shadow(0 0 4px rgba(212, 160, 23, 0.7));
  animation: sc-loading-chase 1.6s linear infinite;
}

@keyframes sc-loading-chase {
  to {
    stroke-dashoffset: -450;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-loading-comet {
    animation: none;
    stroke-dasharray: none;
    filter: none;
  }
}
