/* =============================================================================
   Salesforce Assist - shared site styles (2026-09-29)

   Every page loads this first. The chrome (header, footer, breadcrumbs,
   page heading, notice) is taken verbatim from the Salesforce Assist
   prototype. Pages that have a matching prototype page additionally load
   its own stylesheet from sa/pages/<prototype>.css (see each template's
   {% block css %}), which is the prototype's CSS unchanged.

   The second half of this file ("Generic components") styles pages that
   have no prototype of their own - admin pages, loading/progress, error
   pages - in the same visual language, including a light compatibility
   layer for the older Bootstrap-style class names those templates still
   use (.panel, .btn, .table, .alert, .row/.col-md-*, .form-control).
   ============================================================================= */

:root{
  --primary: #e2711d;
  --primary-dark: #b95a14;
  --primary-tint: #fdf4ec;
  --primary-line: #f3d6bf;
  --ink: #1f2328;
  --ink-soft: #5f6770;
  --border: #e6e8eb;
  --surface: #ffffff;
  --canvas: #fafafa;
  --ok: #2f7a3b;
  --ok-bg: #f4faf5;
  --ok-line: #b9dcc0;
  --err: #b42318;
  --err-bg: #fef3f2;
  --err-line: #f4c7c3;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Archivo", sans-serif;
}

body{ min-height: 100vh; display: flex; flex-direction: column; }
main{ flex: 1; }
a{ text-decoration: none; color: inherit; }
:focus-visible{ outline: 2px solid var(--primary); outline-offset: 3px; }

/* ---------- Header ---------- */
header.topbar{
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand{ display: flex; align-items: center; }
.brand img{ width: 150px; height: auto; display: block; }

.top-nav{ display: flex; align-items: center; gap: 22px; }
.top-nav a{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.top-nav a:hover{ color: var(--ink); }
.top-nav a[aria-current="page"]{ color: var(--ink); border-bottom-color: var(--primary); }

/* ---------- Page ---------- */
.page{
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 88px;
}
.crumbs{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 36px;
}
.crumbs a{ font-weight: 600; color: var(--primary-dark); }
.crumbs a:hover{ text-decoration: underline; text-underline-offset: 3px; }
.crumbs .sep{ color: #b8bec4; }

.tool-head{ margin-bottom: 26px; max-width: 760px; }
.tool-head h1{
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 10px;
}
.tool-head .lead{ font-size: 16px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.privacy{ margin: 10px 0 0; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
footer.site-footer{
  text-align: center;
  padding: 28px;
  color: var(--ink-soft);
  font-size: 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ---------- Flash messages (Django messages framework) ---------- */
.sa-messages{
  max-width: 1180px;
  width: 100%;
  margin: 18px auto 0;
  padding: 0 32px;
}
.sa-msg{
  border: 1px solid var(--primary-line);
  background: var(--primary-tint);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.sa-msg.success{ background: var(--ok-bg); border-color: var(--ok-line); color: #1f5a29; }
.sa-msg.error, .sa-msg.danger{ background: var(--err-bg); border-color: var(--err-line); color: #8a1c13; }
.sa-msg.warning{ background: #fffaf0; border-color: #e8c77d; color: #7a4f05; }

/* =============================================================================
   Generic components (pages without a prototype of their own). Everything
   below is scoped to body.sa-generic so it can never leak into the
   prototype-styled tool pages.
   ============================================================================= */

.sa-generic .page h1{ font-size: 30px; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 12px; }
.sa-generic .page h2{ font-size: 20px; font-weight: 700; margin: 24px 0 12px; }
.sa-generic .page h3{ font-size: 16px; font-weight: 700; margin: 18px 0 8px; }
.sa-generic .page p{ line-height: 1.6; }
.sa-generic .page a:not(.btn){ color: var(--primary-dark); font-weight: 600; }
.sa-generic .page a:not(.btn):hover{ text-decoration: underline; text-underline-offset: 3px; }
.sa-generic .muted{ color: var(--ink-soft); }

/* Panels */
.sa-generic .panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.sa-generic .panel-heading{ margin: -22px -24px 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.sa-generic .panel-title{ font-size: 16px; font-weight: 700; margin: 0; }
.sa-generic .panel-body p{ color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; }

/* Grid (Bootstrap-compatible subset) */
.sa-generic .row{ display: flex; flex-wrap: wrap; margin: 0 -9px; }
.sa-generic .row > [class*="col-"]{ padding: 0 9px; width: 100%; }
@media (min-width: 900px){
  .sa-generic .row > .col-md-3{ width: 25%; }
  .sa-generic .row > .col-md-4{ width: 33.333%; }
  .sa-generic .row > .col-md-6{ width: 50%; }
  .sa-generic .row > .col-md-8{ width: 66.666%; }
  .sa-generic .row > .col-md-12{ width: 100%; }
}

/* Buttons */
.sa-generic .btn, .sa-generic input[type="submit"]{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.sa-generic .btn:hover{ border-color: #cfd4d9; background: var(--canvas); text-decoration: none; }
.sa-generic .btn-primary, .sa-generic input[type="submit"]{ border-color: var(--primary); background: var(--primary); color: #fff; }
.sa-generic .btn-primary:hover, .sa-generic input[type="submit"]:hover{ background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.sa-generic .btn-danger{ border-color: var(--err); background: var(--err); color: #fff; }
.sa-generic .btn-danger:hover{ background: #8a1c13; border-color: #8a1c13; color: #fff; }
.sa-generic .btn-block{ display: flex; width: 100%; }
.sa-generic .btn-xs, .sa-generic .btn-sm{ height: 30px; padding: 0 11px; font-size: 13px; }

/* Forms */
.sa-generic .form-control,
.sa-generic .page input[type="text"],
.sa-generic .page input[type="email"],
.sa-generic .page input[type="password"],
.sa-generic .page input[type="number"],
.sa-generic .page select,
.sa-generic .page textarea{
  width: 100%;
  max-width: 520px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sa-generic .page textarea{ height: auto; min-height: 90px; padding: 10px 12px; line-height: 1.5; }
.sa-generic .form-control:focus, .sa-generic .page input:focus, .sa-generic .page select:focus, .sa-generic .page textarea:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(226,113,29,.14);
}
.sa-generic .form-group{ margin-bottom: 16px; }
.sa-generic .form-group label{ display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.sa-generic .checkbox label{ display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.sa-generic .page input[type="checkbox"]{ accent-color: var(--primary); width: 16px; height: 16px; }

/* Tables */
.sa-generic .table{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 13.5px;
  background: var(--surface);
  margin-bottom: 18px;
}
.sa-generic .table th{
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fcfcfc;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sa-generic .table td{ padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.5; }
.sa-generic .table tbody tr:last-child td{ border-bottom: none; }
.sa-generic .table-striped tbody tr:nth-child(odd) td{ background: #fdfdfd; }
.sa-generic .table-hover tbody tr:hover td{ background: var(--primary-tint); }
.sa-generic .table-condensed th, .sa-generic .table-condensed td{ padding: 8px 12px; }

/* Alerts */
.sa-generic .alert{
  border: 1px solid var(--primary-line);
  background: var(--primary-tint);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 16px;
}
.sa-generic .alert-success{ background: var(--ok-bg); border-color: var(--ok-line); color: #1f5a29; }
.sa-generic .alert-danger, .sa-generic .alert-error{ background: var(--err-bg); border-color: var(--err-line); color: #8a1c13; }
.sa-generic .alert-warning{ background: #fffaf0; border-color: #e8c77d; color: #7a4f05; }

/* Status pills (usable anywhere) */
.pill{
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eeeff1;
  color: var(--ink-soft);
}
.pill.ok{ background: var(--ok-bg); color: var(--ok); }
.pill.err{ background: var(--err-bg); color: var(--err); }
.pill.run{ background: var(--primary-tint); color: var(--primary-dark); }

/* Loading / progress page (usable anywhere) */
.progress-card{
  max-width: 620px;
  margin: 40px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 32px;
  text-align: center;
}
.spinner{
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid var(--primary-line);
  border-top-color: var(--primary);
  animation: sa-spin .9s linear infinite;
}
@keyframes sa-spin{ to{ transform: rotate(360deg); } }
.progress-card h1{ font-size: 22px; margin: 0 0 6px; }
.progress-card p{ color: var(--ink-soft); margin: 0; font-size: 14.5px; line-height: 1.6; }

/* Legacy helpers still referenced by main.js */
.loading, .logging_out{ display: none; }
.clear{ clear: both; }

@media (max-width: 620px){
  .topbar-inner{ padding: 14px 20px; }
  .page{ padding: 22px 20px 64px; }
  .sa-messages{ padding: 0 20px; }
  .crumbs{ margin-bottom: 26px; }
  .tool-head h1{ font-size: 28px; }
}
@media (prefers-reduced-motion: reduce){ *{ transition: none !important; animation: none !important; } }
