/* LexForge workspace onboarding.

   Two unrelated-looking things that belong together: the skin for the driver.js
   tour popovers, and the "Secure your account" strip auth.js drops in above the
   topbar. Both are part of the same first-run experience.

   Loaded AFTER vendor/driverjs/driver.1.8.0.css, so these rules win on order as
   well as on specificity. Every colour resolves through a workspace-ui.css
   token, which is what keeps light and dark in step — the two exceptions below
   are declared as tokens here and redefined for dark. */

:root {
  /* driver.js writes the overlay fill as an inline style on an SVG path, so it
     cannot inherit a token; the rule below has to force it. */
  --lf-tour-overlay: var(--ink);
  --lf-tour-shadow: 0 16px 40px rgba(34, 29, 24, .18);
}

:root[data-theme="dark"] {
  /* Warm near-black is right for a light ground, but on the dark workspace the
     dimming has to be pure black or the page looks washed rather than dimmed. */
  --lf-tour-overlay: #000000;
  --lf-tour-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}

/* --- Overlay -------------------------------------------------------------- */

.driver-overlay path { fill: var(--lf-tour-overlay) !important; }

/* --- Popover shell -------------------------------------------------------- */

.driver-popover.lf-tour {
  max-width: 360px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  box-shadow: var(--card-shadow), var(--lf-tour-shadow);
}

.driver-popover.lf-tour .driver-popover-title {
  margin: 0;
  /* clears the close button sitting in the top-right corner */
  padding-right: 28px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.driver-popover.lf-tour .driver-popover-description {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

.driver-popover.lf-tour .driver-popover-title[style*="block"] + .driver-popover-description {
  margin-top: 9px;
}

.driver-popover.lf-tour .driver-popover-close-btn {
  top: 9px;
  right: 9px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.driver-popover.lf-tour .driver-popover-close-btn:hover,
.driver-popover.lf-tour .driver-popover-close-btn:focus { color: var(--ink); }

/* --- Footer --------------------------------------------------------------- */

.driver-popover.lf-tour .driver-popover-footer {
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 17px;
}

.driver-popover.lf-tour .driver-popover-progress-text {
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
}

.driver-popover.lf-tour .driver-popover-navigation-btns {
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.driver-popover.lf-tour .driver-popover-navigation-btns button + button { margin-left: 0; }

.driver-popover.lf-tour .driver-popover-footer-btn {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-shadow: none;
  white-space: nowrap;
  cursor: pointer;
}

/* Next and Done: the site's primary button. */
.driver-popover.lf-tour .driver-popover-next-btn {
  border-color: var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.driver-popover.lf-tour .driver-popover-next-btn:hover,
.driver-popover.lf-tour .driver-popover-next-btn:focus {
  border-color: var(--btn-hover);
  background: var(--btn-hover);
  color: var(--btn-fg);
}

/* Back, and the "Skip for now" button the security step adds: ghost buttons. */
.driver-popover.lf-tour .driver-popover-prev-btn,
.driver-popover.lf-tour .lf-tour-skip-btn {
  border-color: var(--btn-line);
  background: transparent;
  color: var(--ink-2);
}

.driver-popover.lf-tour .driver-popover-prev-btn:hover,
.driver-popover.lf-tour .driver-popover-prev-btn:focus,
.driver-popover.lf-tour .lf-tour-skip-btn:hover,
.driver-popover.lf-tour .lf-tour-skip-btn:focus {
  border-color: var(--btn-line);
  background: var(--btn-ghost-hover);
  color: var(--ink);
}

.driver-popover.lf-tour .driver-popover-footer-btn:focus-visible,
.driver-popover.lf-tour .driver-popover-close-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- Arrow ---------------------------------------------------------------- */

/* driver.css draws the arrow as a 5px border box and colours exactly one side,
   so each side needs its own token override or the arrow stays white. */
.driver-popover.lf-tour .driver-popover-arrow { border-color: transparent; }
.driver-popover.lf-tour .driver-popover-arrow-side-left { border-left-color: var(--card); }
.driver-popover.lf-tour .driver-popover-arrow-side-right { border-right-color: var(--card); }
.driver-popover.lf-tour .driver-popover-arrow-side-top { border-top-color: var(--card); }
.driver-popover.lf-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--card); }

/* --- Replay button -------------------------------------------------------- */

/* .sb-foot already styles its buttons as quiet links. The only addition is
   keeping the three-word label on one line in a 250px sidebar. */
[data-tour-replay] { white-space: nowrap; }

/* --- Motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .driver-fade .driver-overlay,
  .driver-fade .driver-popover {
    animation: none !important;
  }

  .driver-popover,
  .driver-popover * {
    transition: none !important;
  }
}

/* --- "Secure your account" strip ------------------------------------------
   auth.js inserts <section class="mfa-nudge"> before header.topbar inside
   main.main. It is a reminder, not an alarm: one calm line across the top. */

.mfa-nudge {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--info-bg);
  color: var(--info-fg);
}

.mfa-nudge-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.mfa-nudge-title {
  color: var(--info-fg);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.mfa-nudge-text {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
}

.mfa-nudge-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.mfa-nudge-primary,
.mfa-nudge-dismiss {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.mfa-nudge-primary {
  border-color: var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.mfa-nudge-primary:hover,
.mfa-nudge-primary:focus {
  border-color: var(--btn-hover);
  background: var(--btn-hover);
  color: var(--btn-fg);
  text-decoration: none;
}

.mfa-nudge-dismiss {
  border-color: transparent;
  background: transparent;
  color: var(--muted-2);
}

.mfa-nudge-dismiss:hover,
.mfa-nudge-dismiss:focus {
  background: var(--btn-ghost-hover);
  color: var(--ink);
}

.mfa-nudge-primary:focus-visible,
.mfa-nudge-dismiss:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .mfa-nudge {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 18px;
  }

  .mfa-nudge-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
