/* ============================================================
   ShouldIQuitMyJob.net — Assessment Header
   Completely isolated from the marketing site header.
   All class names prefixed with .asmnt-* to prevent leakage.
   ============================================================ */

/* Override global scroll-padding for the assessment page.
   The sticky asmnt-header is 60px, so anchor links scroll
   to the right position when using scrollToQuiz(). */
.assessment-page {
  scroll-padding-top: 76px; /* 60px header + 16px breathing room */
}


/* ── Root ── */
.asmnt-header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  background: #fbfaf7;
  border-bottom: 1px solid rgba(28,35,31,.1);
  box-shadow: 0 1px 0 rgba(28,35,31,.05), 0 2px 12px rgba(15,20,17,.06);
}

/* Skip link — re-declare for assessment context */
.asmnt-skip-link {
  position: fixed;
  z-index: 300;
  top: .6rem;
  left: .75rem;
  padding: .6rem 1rem;
  border-radius: .5rem;
  background: #0e1411;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .18s ease;
}
.asmnt-skip-link:focus { color: #fff; transform: translateY(0); }

/* ── Inner layout — desktop ── */
.asmnt-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  width: min(calc(100% - 2.5rem), 1120px);
  height: 60px;
  margin-inline: auto;
}

/* ── Left: brand ── */
.asmnt-brand {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #1c231f;
  white-space: nowrap;
  /* The brand link itself triggers exit confirmation when in active assessment */
  cursor: pointer;
}

.asmnt-brand__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.asmnt-brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asmnt-brand__text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.15;
}

.asmnt-brand__name {
  font-family: 'Outfit', sans-serif;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #1c231f;
}

.asmnt-brand__name span { color: #087c6d; }

.asmnt-brand__context {
  font-family: 'Outfit', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #4f6358;
}

/* ── Centre: progress cluster ── */
.asmnt-header__progress {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: .22rem;
  min-width: 0;
}

.asmnt-header__progress[hidden] { display: none !important; }

.asmnt-header__section {
  font-family: 'Outfit', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #4f6358;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .3s ease;
}

.asmnt-header__bar-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}

.asmnt-progress-bar {
  flex: 1 1 auto;
  min-width: 96px;
  height: 5px;
  border-radius: 99px;
  background: #d5ddd8;
  box-shadow: inset 0 1px 2px rgba(28,35,31,.1);
  overflow: hidden;
}

.asmnt-progress-bar__fill {
  position: relative;
  display: block;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #087c6d, #0fa393);
  transition: width .4s cubic-bezier(.22,.8,.2,1);
  will-change: width;
}

.asmnt-progress-bar__fill::after {
  content: "";
  position: absolute;
  inset-block: 0;
  right: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(217,243,140,0), rgba(217,243,140,.95));
}

.asmnt-header__pct {
  min-width: 34px;
  font-family: 'Outfit', sans-serif;
  font-size: .62rem;
  font-weight: 700;
  color: #4f6358;
  text-align: right;
  white-space: nowrap;
  transition: opacity .3s ease;
}

/* Analyzing state: message shown instead of section name */
.asmnt-header__section--analyzing {
  color: #087c6d;
  letter-spacing: .03em;
}

/* ── Right: exit button ── */
.asmnt-exit {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1.5px solid rgba(28,35,31,.15);
  border-radius: .55rem;
  background: transparent;
  color: #4f6358;
  font-family: 'Outfit', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.asmnt-exit:hover {
  border-color: rgba(28,35,31,.3);
  background: rgba(28,35,31,.04);
  color: #1c231f;
}
.asmnt-exit:focus-visible {
  outline: 3px solid #045c52;
  outline-offset: 3px;
}
.asmnt-exit__icon {
  font-size: .8em;
  line-height: 1;
}

/* ── Exit confirmation dialog ── */
.asmnt-dialog {
  position: fixed;
  z-index: 500;
  inset: 0;
  width: min(92vw, 400px);
  margin: auto;
  padding: 2rem;
  border: 1px solid rgba(28,35,31,.12);
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: 0 30px 80px rgba(14,20,17,.25);
  color: #1c231f;
}

/* backdrop via ::backdrop for <dialog> */
.asmnt-dialog::backdrop {
  background: rgba(14,20,17,.45);
  backdrop-filter: blur(4px);
}

.asmnt-dialog__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 1.1rem;
  border-radius: .75rem;
  background: #fff3e0;
  color: #c8861a;
  font-size: 1.3rem;
}

.asmnt-dialog h2 {
  margin: 0 0 .45rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #1c231f;
}

.asmnt-dialog p {
  margin: 0 0 1.6rem;
  font-size: .84rem;
  color: #4f6358;
  line-height: 1.55;
}

.asmnt-dialog__actions {
  display: grid;
  gap: .55rem;
}

.asmnt-dialog__continue {
  padding: .75rem 1rem;
  border: 0;
  border-radius: .65rem;
  background: #087c6d;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease;
}
.asmnt-dialog__continue:hover { background: #045c52; }
.asmnt-dialog__continue:focus-visible { outline: 3px solid #045c52; outline-offset: 3px; }

.asmnt-dialog__leave {
  padding: .75rem 1rem;
  border: 1.5px solid rgba(28,35,31,.15);
  border-radius: .65rem;
  background: transparent;
  color: #4f6358;
  font-family: 'Outfit', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.asmnt-dialog__leave:hover {
  border-color: #bf4343;
  color: #923939;
  background: #fff3f3;
}
.asmnt-dialog__leave:focus-visible { outline: 3px solid #bf4343; outline-offset: 3px; }

/* ── Responsive ── */

/* Tablet: slightly tighter */
@media (max-width: 840px) {
  .asmnt-header__inner {
    gap: 1rem;
    width: min(calc(100% - 2rem), 1120px);
  }
}

/* Mobile: two-row layout */
@media (max-width: 600px) {
  .asmnt-header {
    /* Two rows: row 1 brand+exit, row 2 section+bar+percentage */
  }

  .asmnt-header__inner {
    display: grid;
    grid-template-columns: 1fr auto; /* brand | exit */
    grid-template-rows: auto auto;
    align-items: center;
    gap: .3rem .6rem;
    height: auto;
    padding-block: .55rem .6rem;
    width: min(calc(100% - 1.6rem), 1120px);
  }

  /* Row 1 */
  .asmnt-brand         { grid-column: 1; grid-row: 1; }
  .asmnt-exit          { grid-column: 2; grid-row: 1; padding: .38rem .65rem; font-size: .67rem; }
  .asmnt-brand__context { display: none; }

  /* Row 2: progress fills full width */
  .asmnt-header__progress {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    gap: .55rem;
  }

  /* On mobile, bar-row IS the progress row */
  .asmnt-header__bar-row {
    flex: 1;
  }

  .asmnt-progress-bar { min-width: 68px; }

  /* Section name on mobile — slim */
  .asmnt-header__section {
    font-size: .6rem;
    min-width: 0;
    flex-shrink: 1;
  }

  .asmnt-exit__label { display: none; } /* show only icon on mobile */
}

@media (prefers-reduced-motion: reduce) {
  .asmnt-progress-bar__fill { transition: none; }
}
