/* ==========================================================================
   EnrollUp tool shell
   Progress rail, one step at a time, fixed action bar, docked preview.
   Loaded after main.css on tool pages only.
   ========================================================================== */

/* Room for the fixed action bar (and the preview bar above it). */
/* Fallback only. The real value is measured at runtime in tool-shell.js,
   because the action bar's height depends on how the status line wraps. */
body.has-eu-shell { padding-bottom: 150px; }

.eu-hidden-status { display: none !important; }

/* ---------- rail ---------- */
.eu-rail {
  display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none;
  padding: .5rem 0 1rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 72px; z-index: 60;
  background: rgba(255,255,255,.94); backdrop-filter: saturate(180%) blur(10px);
}
.eu-rail::-webkit-scrollbar { display: none; }

.eu-rstep {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  background: none; border: 0; cursor: default; padding: .45rem .7rem;
  border-radius: 999px; font: inherit; font-size: var(--step--1); font-weight: 600;
  color: var(--ink-45); white-space: nowrap;
}
.eu-rstep .eu-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--rule); color: var(--ink-45);
  font-size: .78rem; font-weight: 700;
}
.eu-rstep .eu-dot svg { width: 15px; height: 15px; }
.eu-rstep.is-done { color: var(--ink); cursor: pointer; }
.eu-rstep.is-done .eu-dot { background: #e3f2e8; color: #1f6b3c; }
.eu-rstep.is-done:hover { background: var(--cerulean-050); }
.eu-rstep.is-cur { color: var(--cerulean); background: var(--cerulean-050); }
.eu-rstep.is-cur .eu-dot { background: var(--cerulean); color: #fff; }
.eu-rstep[aria-disabled="true"] { pointer-events: none; opacity: .55; }

@media (max-width: 700px) {
  /* Keep the rail to dots plus the current label, or it eats the screen. */
  .eu-rstep .eu-rlabel { display: none; }
  .eu-rstep.is-cur .eu-rlabel { display: inline; }
}

/* ---------- steps ---------- */
.eu-step { animation: eu-in .22s var(--ease) both; }
@keyframes eu-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .eu-step { animation: none; } }

.eu-step__head { margin-bottom: 1.5rem; max-width: 60ch; }
.eu-step__head h2 { font-size: var(--step-2); margin-bottom: .35rem; }
.eu-step__hint { color: var(--ink-70); font-size: var(--step-0); margin: 0; }

/* One question per screen: the panels inside a step read as one form, not as
   a stack of competing cards. */
.eu-step .panel { border: 0; padding: 0; margin-bottom: 2rem; background: none; }
.eu-step .panel h3 { font-size: var(--step-0); }

/* Exactly one primary button exists, and it lives in the action bar. Anything
   inside a panel is secondary by definition. */
.eu-step .panel .btn--primary {
  background: var(--paper); color: var(--cerulean);
  border-color: var(--rule); box-shadow: none;
}
.eu-step .panel .btn--primary:hover {
  background: var(--cerulean-050); border-color: var(--cerulean); color: var(--cerulean);
}

/* ---------- action bar ---------- */
.eu-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--paper); border-top: 1px solid var(--rule);
  box-shadow: 0 -4px 20px rgba(20,35,43,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.eu-bar__in {
  max-width: var(--wrap); margin-inline: auto;
  padding: .7rem var(--gutter);
  display: flex; align-items: center; gap: .75rem;
}
.eu-status {
  margin: 0; flex: 1; min-width: 0;
  font-size: var(--step--1); color: var(--ink-70);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eu-next { flex: none; min-width: 150px; justify-content: center; }
.eu-next:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.eu-back[hidden] { display: none; }

@media (max-width: 560px) {
  .eu-bar__in { flex-wrap: wrap; gap: .5rem .6rem; padding: .6rem var(--gutter); }
  .eu-status { order: -1; flex: 1 0 100%; white-space: normal; line-height: 1.35; }
  .eu-back { flex: 0 0 auto; }
  .eu-next { flex: 1; min-width: 0; }
}

/* ---------- docked preview ----------
   On a phone the preview used to sit five screens below the inputs. It now
   lives directly above the action bar: a 44px strip carrying a live thumbnail
   so there is always evidence of what you are making, expanding to a sheet. */
.eu-preview {
  position: fixed; left: 0; right: 0; bottom: 61px; z-index: 91;
  background: var(--paper-warm); border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.eu-preview__tab {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  display: flex; align-items: center; gap: .6rem;
  background: none; border: 0; cursor: pointer; font: inherit;
  padding: .4rem var(--gutter); min-height: 44px; color: var(--ink-70);
}
.eu-preview__thumb {
  width: 30px; height: 30px; flex: none; border-radius: 5px; overflow: hidden;
  background: var(--cerulean-050); display: grid; place-items: center;
}
.eu-preview__img { width: 100%; height: 100%; object-fit: contain; }
.eu-preview__label { font-size: var(--step--1); font-weight: 650; color: var(--cerulean-900); }
.eu-preview__count { font-size: var(--step--1); color: var(--ink-45); margin-left: auto; }
.eu-preview__chev { font-size: .6rem; color: var(--ink-45); transition: transform .2s var(--ease); }
.eu-preview.is-open .eu-preview__chev { transform: rotate(180deg); }
.eu-preview__sheet {
  max-height: 78vh; overflow-y: auto;
  padding: 1rem var(--gutter) 1.25rem;
  border-top: 1px solid var(--rule); background: var(--paper);
}

@media (min-width: 900px) {
  /* Desktop: no docking. The preview sits in the flow beside the step. */
  .eu-preview {
    position: static; background: none; border-top: 0; padding: 0;
    max-width: var(--wrap); margin: 0 auto 2rem;
  }
  .eu-preview__tab { display: none; }
  .eu-preview__sheet {
    display: block !important; max-height: none; overflow: visible;
    border: 1px solid var(--rule); border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 1.75rem);
  }
  .eu-preview__sheet[hidden] { display: block !important; }
}

/* ---------- toast ---------- */
.eu-toast {
  position: fixed; left: 50%; bottom: 128px; transform: translate(-50%, 12px);
  z-index: 120; max-width: min(92vw, 460px);
  background: var(--cerulean-900); color: #fff;
  padding: .8rem 1.15rem; border-radius: 12px;
  font-size: var(--step--1); line-height: 1.4;
  box-shadow: var(--shadow-lg); pointer-events: none;
  opacity: 0; transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.eu-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .eu-toast { bottom: 86px; } }

/* ---------- pasted-format example ----------
   Replaces teaching tab-separated layout through a placeholder, where the
   browser collapses the tabs and destroys the columns being demonstrated. */
.eu-example { margin-bottom: .9rem; }
.eu-example__cap { font-size: var(--step--1); color: var(--ink-70); margin: 0 0 .5rem; }
.eu-example table { min-width: 0; font-size: .8rem; }
.eu-example th {
  background: var(--cerulean-050); color: var(--cerulean-900);
  font-family: var(--sans); font-weight: 700; padding: .45rem .7rem;
}
.eu-example td { padding: .45rem .7rem; color: var(--ink-70); }

/* ---------- visual layout picker ----------
   A sentence cannot describe a layout. These are real renders of the user's
   own data, produced by the same function that makes the download. */
.layout-grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
@media (min-width: 700px) { .layout-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }

.layout-card {
  display: flex; flex-direction: column; gap: .55rem;
  padding: .5rem; cursor: pointer; font: inherit; text-align: left;
  background: var(--paper); border: 2px solid var(--rule); border-radius: 14px;
  transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.layout-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gray-pastel); }
.layout-card.is-on { border-color: var(--brown); box-shadow: 0 0 0 3px var(--brown-050); }
.layout-card__img {
  width: 100%; height: auto; aspect-ratio: 1; display: block;
  border-radius: 9px; background: var(--cerulean-050);
}
/* Not every tool outputs a square, so the thumbnail has to carry the real
   output shape: ID cards are 1012 by 638, certificates are A4 landscape,
   report cards are A4 portrait, brand pack letterheads are A4 portrait. */
.layout-card__img--card { aspect-ratio: 1012 / 638; }
.layout-card__img--a4land { aspect-ratio: 297 / 210; }
.layout-card__img--a4port { aspect-ratio: 210 / 297; }
.layout-card__img--story { aspect-ratio: 9 / 16; }
/* Brand pack shows two assets in one thumbnail, letterhead beside display picture. */
.layout-card__img--pair { aspect-ratio: 3 / 2; }

.layout-card__cap { display: block; padding: 0 .25rem .2rem; }
.layout-card__cap b { display: block; font-size: var(--step--1); color: var(--cerulean-900); font-weight: 700; }
.layout-card__cap i { display: block; font-style: normal; font-size: .74rem; color: var(--ink-45); line-height: 1.35; }

/* "Start over" only appears once there is saved work to clear. */
.eu-startover { flex: none; }
@media (max-width: 560px) { .eu-startover { order: 2; } }

/* "or" divider between the two ways of giving us a logo */
.logo-or { display: flex; align-items: center; gap: .8rem; margin: 1rem 0 .9rem; }
.logo-or::before, .logo-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.logo-or span { font-size: var(--step--1); color: var(--ink-45); font-weight: 600; }

/* ---------- app bar on tool pages ----------
   The marketing nav stays in the document (crawlers and the mobile menu still
   reach it) but stops competing with the task. In its place: what this tool
   is, and a number to ring when stuck. */
.eu-appbar {
  display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0;
  padding-left: 1rem; margin-left: .25rem; border-left: 1px solid var(--rule);
}
.eu-appbar__name {
  font-family: var(--display); font-weight: 700; font-size: var(--step-0);
  color: var(--cerulean-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eu-appbar__help { margin-left: auto; display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.eu-appbar__help span { font-size: .68rem; color: var(--ink-45); }
.eu-appbar__help a { font-size: var(--step--1); font-weight: 700; color: var(--cerulean); text-decoration: none; }
.eu-appbar__all {
  flex: none; font-size: var(--step--1); font-weight: 600; color: var(--ink-70);
  text-decoration: none; padding: .45rem .8rem; border: 1px solid var(--rule); border-radius: 999px;
}
.eu-appbar__all:hover { border-color: var(--cerulean); color: var(--cerulean); }

/* In app mode the nav collapses to the hamburger at every width. */
body.eu-appmode .site-header__inner .nav {
  position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding: .75rem var(--gutter) 1.5rem; box-shadow: var(--shadow-md);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
body.eu-appmode .site-header__inner .nav[data-open="true"] { transform: none; opacity: 1; pointer-events: auto; }
body.eu-appmode .site-header__inner .nav a {
  padding: .8rem .5rem; font-size: var(--step-0); border-bottom: 1px solid var(--rule); border-radius: 0;
}
body.eu-appmode .nav-toggle { display: inline-flex; }

@media (max-width: 700px) {
  .eu-appbar { padding-left: .7rem; gap: .6rem; }
  .eu-appbar__name { font-size: var(--step--1); }
  .eu-appbar__help, .eu-appbar__all { display: none; }
}
