:root {
  --ink: #172126;
  --muted: #60707a;
  --line: #d9e1df;
  --paper: #fbfcfa;
  --soft: #eef5f2;
  --green: #1e6f5c;
  --green-dark: #164f43;
  --gold: #c78220;
  --red: #9b2f2f;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a {
  color: var(--green-dark);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1;
  max-width: 880px;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.05rem;
}

.public-page {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(30, 111, 92, 0.18), rgba(199, 130, 32, 0.14)),
    var(--paper);
}

.public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.public-panel {
  width: min(720px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(28px, 6vw, 56px);
  box-shadow: 0 24px 80px rgba(23, 33, 38, 0.1);
}

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 24px 18px;
}

.admin-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px 56px;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 24px;
}

.tool-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 460px;
  resize: vertical;
}

.hero {
  min-height: 88vh;
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(9, 35, 32, 0.92), rgba(9, 35, 32, 0.66)),
    url("/assets/hero.svg");
  background-size: cover;
  background-position: center;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px clamp(20px, 5vw, 64px);
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

.hero-content {
  align-self: center;
  padding: 24px clamp(20px, 5vw, 64px) 80px;
  max-width: 960px;
}

.hero-content p {
  max-width: 680px;
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0 14px;
}

/* The HTML hidden attribute must win over element display rules below
   (e.g. .button sets display, which would otherwise keep hidden buttons visible). */
[hidden] {
  display: none !important;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.expiry,
.muted {
  color: var(--muted);
}

.hero .expiry {
  color: rgba(255, 255, 255, 0.78);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(38px, 8vw, 84px) 24px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.2fr;
  gap: 28px;
  align-items: start;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 750;
}

.checklist span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
}

.content-flow {
  display: grid;
  gap: 22px;
  padding-top: 0;
}

.guide-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 38px);
}

.okta-wizard {
  display: grid;
  gap: 22px;
}

.wizard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.wizard-head p {
  max-width: 760px;
}

.wizard-shell {
  display: grid;
  grid-template-columns: minmax(190px, 250px) 1fr;
  gap: 18px;
}

.wizard-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
}

.wizard-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.wizard-tab span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green-dark);
}

.wizard-tab.is-active {
  border-color: var(--green);
  background: var(--soft);
  color: var(--green-dark);
}

.wizard-tab.is-active span {
  background: var(--green);
  color: var(--white);
}

.wizard-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) 1fr;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f6;
}

.wizard-media {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(30, 111, 92, 0.14), rgba(199, 130, 32, 0.16)),
    #edf3f1;
}

.wizard-media img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 45px rgba(23, 33, 38, 0.2);
}

.wizard-copy {
  display: grid;
  align-content: center;
  padding: clamp(20px, 4vw, 40px);
}

.step-count {
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.wizard-detail {
  margin: 18px 0 24px;
  padding: 14px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  font-weight: 750;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button.secondary.dark {
  color: var(--green-dark);
  background: var(--white);
  border-color: var(--line);
}

.reference-steps {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.reference-steps summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--green-dark);
}

.password-panel {
  display: grid;
  grid-template-columns: minmax(170px, 0.35fr) 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}

.guide-block.two-column,
.support-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.guide-block.warning {
  border-color: rgba(155, 47, 47, 0.4);
  background: #fff8f6;
}

.guide-block.finish {
  background: var(--soft);
}

.callout {
  margin: 22px 0;
  padding: 16px;
  border-radius: 8px;
}

.callout.safe {
  background: var(--soft);
  border-left: 5px solid var(--green);
}

.steps {
  padding-left: 1.2rem;
}

.steps li,
ul li {
  margin: 10px 0;
}

.steps.compact li {
  margin: 7px 0;
}

.screenshot-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 18px;
  margin-top: 26px;
}

.screenshot-row figure {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.screenshot-row img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--white);
}

.screenshot-row figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

@media (max-width: 780px) {
  .admin-grid,
  .intro-grid,
  .guide-block.two-column,
  .support-options,
  .wizard-shell,
  .wizard-card,
  .password-panel,
  .screenshot-row {
    grid-template-columns: 1fr;
  }

  .wizard-head {
    display: grid;
  }

  .wizard-sidebar {
    grid-template-columns: 1fr;
  }

  .wizard-card {
    min-height: 0;
  }

  .wizard-media {
    min-height: 260px;
  }

  .hero {
    min-height: 92vh;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 2.7rem;
  }
}

/* ---- worker-v1 additions: admin invite table ---- */

.tool-panel.wide {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
}

.invite-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.invite-table th,
.invite-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.invite-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  background: var(--soft);
  color: var(--ink);
}

.status-badge.status-active { background: #e3f2ec; color: var(--green-dark); }
.status-badge.status-completed { background: #e8ecf7; color: #2f4b9b; }
.status-badge.status-expired { background: #f7f0e3; color: var(--gold); }
.status-badge.status-revoked { background: #f7e5e5; color: var(--red); }

.invite-actions {
  display: flex;
  gap: 0.4rem;
}

.button.small {
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar .brand-lockup {
  margin-bottom: 8px;
}

.topbar h1 {
  font-size: 1.7rem;
  line-height: 1.15;
  max-width: none;
}

/* ---- admin dark theme ---- */

.admin-page {
  --paper: #24292c;  /* dark grey background */
  --white: #2e3538;  /* panel surfaces */
  --ink: #e9eeec;
  --muted: #a3b2ad;
  --line: #414b4f;
  --soft: #343d41;
  background: var(--paper);
}

.admin-page .button {
  color: #ffffff;
}

.admin-page input,
.admin-page textarea {
  background: #1d2225;
  color: var(--ink);
}

.admin-page input::placeholder,
.admin-page textarea::placeholder {
  color: #6d7c78;
}

.admin-page a {
  color: #6fcfae;
}

.admin-page .tool-panel,
.admin-page .public-panel {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.admin-page .status-badge.status-active { background: #1f3d33; color: #7fd6b8; }
.admin-page .status-badge.status-completed { background: #23304d; color: #9db4ee; }
.admin-page .status-badge.status-expired { background: #40361f; color: #e2b566; }
.admin-page .status-badge.status-revoked { background: #442626; color: #e59a9a; }

/* ---- worker-v2: framed step wizard ---- */

.portal-page {
  background: var(--soft);
}

.nav.solo {
  background: var(--green-dark);
  color: var(--white);
}

.frame-shell {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 40px) 16px 64px;
}

.step-frame {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(23, 33, 38, 0.1);
  overflow: hidden;
}

.frame-head {
  padding: clamp(22px, 4vw, 36px) clamp(20px, 4vw, 40px) 10px;
}

.frame-head h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: 8px;
}

.step-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px clamp(20px, 4vw, 40px) 0;
  border-bottom: 1px solid var(--line);
}

.step-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  padding: 10px 13px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.step-tab > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.72rem;
}

.step-tab:hover {
  color: var(--ink);
}

.step-tab.is-active {
  color: var(--green-dark);
  background: var(--soft);
  border-color: var(--line);
}

.step-tab.is-active > span:first-child {
  background: var(--green);
  color: var(--white);
}

.step-pane {
  display: none;
  padding: clamp(22px, 4vw, 36px) clamp(20px, 4vw, 40px);
  min-height: 420px;
}

.step-pane.is-active {
  display: block;
}

.step-pane h2 {
  margin-bottom: 14px;
}

.step-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.step-controls .button.secondary.dark:disabled {
  opacity: 0.4;
  cursor: default;
}

.link-button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: underline;
  cursor: pointer;
}

.support-contact {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pane-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
  margin: 18px 0;
}

.pane-media figure {
  margin: 0;
}

.pane-media img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pane-media figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

.warning-callout {
  border: 1px solid #e5c1c1;
  background: #fdf4f4;
  border-radius: 8px;
  padding: 16px 18px;
}

.info-callout {
  border: 1px solid rgba(17, 69, 89, 0.22);
  background: #eef6f7;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  padding: 16px 18px;
}

.info-callout p:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .step-tab {
    font-size: 0.8rem;
    padding: 8px 9px;
  }
  .step-pane {
    min-height: 0;
  }
}

/* ---- worker-v2: Sendero branding pass ---- */

/* Mint background from the signatures site */
.portal-page {
  background: #e8fff1;
}

/* Light header with agave lockup, top left */
.portal-page .nav.solo {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-bottom: 1px solid rgba(17, 69, 89, 0.2);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--ink);
}

.brand-lockup img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.portal-page .pill {
  border-color: rgba(17, 69, 89, 0.3);
  color: #51626f;
}

/* Frame border tuned to the teal palette */
.portal-page .step-frame {
  border-color: rgba(17, 69, 89, 0.2);
  box-shadow: 0 24px 80px rgba(9, 79, 83, 0.12);
}

/* Retire the gold eyebrow color everywhere; teal reads as brand, not warning */
.eyebrow {
  color: #0b6b6f;
}

/* Interactive network background canvas (portal) */
#net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Verify pane: keep phone screenshots a sensible size; single-figure rows stay narrow */
.pane-media.signin-reminder,
.pane-media:has(> figure:only-child) {
  grid-template-columns: minmax(0, 420px);
}

.step-pane h3 {
  margin-top: 22px;
}

/* ---- image lightbox ---- */

.step-pane img.zoomable {
  cursor: zoom-in;
}

.step-pane img.zoomable:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(13, 32, 30, 0.82);
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
}

.lightbox figure {
  margin: 0;
  max-width: min(920px, 100%);
  max-height: 100%;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox figcaption {
  color: #ffffff;
  font-size: 0.95rem;
  text-align: center;
  max-width: 640px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

body.lightbox-open {
  overflow: hidden;
}

/* ---- language toggle (English / Español) ---- */

/* Default is English. portal.js adds .lang-es to <body> to switch. */
body.portal-page:not(.lang-es) [data-lang="es"] { display: none !important; }
body.portal-page.lang-es [data-lang="en"] { display: none !important; }

.lang-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.lang-toggle-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: 4px;
}

.lang-btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn:hover {
  border-color: var(--green);
}

.lang-btn.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.lang-btn:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
