/* Jungle Haus: Apply page only. Loaded by the Apply page after site.css.
   The extra questions (E1–E5) and the site preview, plus the progress bar
   for a varying number of steps. Lane B - Apply form and Notion,
   2026-10-19. */

/* The progress bar has one part per step in use (5 since #112). */
.jh-progress-bar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }

/* Spam trap: off screen and hidden from assistive technology. People never
   see it; bots that fill every field get dropped quietly. */
.jh-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* The line under each step's heading: muted body text tucked under it. */
.jh-apply .jh-step-lead { margin: calc(-1 * var(--space-12)) 0 var(--space-24); color: var(--text-muted); }

/* A hint under its field (the phone's), so fields side by side line up;
   the field's error line comes first, level with its neighbor's. */
.jh-apply .jh-error + .jh-hint { margin-top: var(--space-8); }

/* The note under the buttons: between phone and tablet widths it would wrap
   alone to the right, so it takes its own line on the left. */
@container jh (width > 520px) and (width <= 900px) {
  .jh-apply .jh-step-note { flex-basis: 100%; margin-left: 0; }
}

/* Question groups inside a step. */
.jh-choice-group > legend { margin-bottom: 0; }
.jh-choice-group > .jh-hint { margin-top: var(--space-4); }
.jh-choice-group[aria-invalid="true"] .jh-option-body { box-shadow: inset 0 0 0 var(--stroke-hairline) var(--error); }
.jh-choice-group[aria-invalid="true"] .jh-choice span { border-color: var(--error); }

/* Option cards: a name and a short line. A round mark means one choice,
   a square mark means any number. Selected shows a filled mark, a tint
   and a 2px edge, so it never relies on color alone. */
.jh-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); margin-top: var(--space-12); }
.jh-option { position: relative; display: flex; }
.jh-option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.jh-option-body {
  position: relative; display: grid; align-content: start; gap: var(--space-4); width: 100%;
  padding: var(--space-16) var(--space-16) var(--space-16) calc(var(--space-16) + 20px + var(--space-12));
  border-radius: var(--radius-card); background: var(--surface);
  box-shadow: inset 0 0 0 var(--stroke-hairline) var(--border);
  transition: background-color var(--duration-control) var(--ease-standard), box-shadow var(--duration-control) var(--ease-standard);
}
.jh-option-body::before {
  content: ""; position: absolute; left: var(--space-16); top: calc(var(--space-16) + 2px);
  width: 20px; height: 20px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--text-muted); background: var(--surface);
}
.jh-option--check .jh-option-body::before { border-radius: 5px; }
.jh-option-name { font-weight: var(--weight-emphasis); color: var(--text); line-height: var(--leading-snug); }
.jh-option-text { font-size: var(--text-body-sm); color: var(--text-muted); }
.jh-option:hover .jh-option-body { background: var(--raised); }
.jh-option input:checked + .jh-option-body { background: color-mix(in srgb, var(--action) 10%, var(--surface)); box-shadow: inset 0 0 0 2px var(--action); }
.jh-option input:checked + .jh-option-body::before { background: var(--action); box-shadow: inset 0 0 0 5px var(--action), inset 0 0 0 10px var(--on-action); }
.jh-option--check input:checked + .jh-option-body::before {
  box-shadow: none;
  background: var(--action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.jh-option input:focus-visible + .jh-option-body { outline: var(--stroke-focus) solid var(--focus); outline-offset: var(--focus-offset); }
.jh-option input:disabled + .jh-option-body { opacity: var(--opacity-disabled); }
.jh-option-more { margin-top: var(--space-16); }
.jh-textarea--short { min-height: calc(var(--target) * 2); }

/* Errors: dropdowns and text boxes get the same red edge as one-line
   fields (the design system styles only .jh-input), and the icon stays by
   the first line when a message wraps. */
.jh-apply .jh-select[aria-invalid="true"], .jh-apply .jh-textarea[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.jh-apply .jh-error { align-items: flex-start; }
.jh-apply .jh-error .jh-icon { flex: none; margin-top: 2px; }

/* "Did you mean …?" under the email field. */
.jh-suggest { margin: var(--space-8) 0 0; font-size: var(--text-body-sm); color: var(--text-muted); }
.jh-suggest-button {
  margin: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: var(--weight-emphasis);
  color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.jh-suggest-button:focus-visible { outline: var(--stroke-focus) solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* "We don't have a website yet", and the details that replace the
   address: a panel set slightly in, so it reads as part of the website
   question. */
.jh-no-site { display: inline-block; margin-top: var(--space-12); }
.jh-details { margin-top: var(--space-16); padding: var(--space-20); border-radius: var(--radius-card); background: var(--surface); box-shadow: inset 0 0 0 var(--stroke-hairline) var(--hairline); }
@container jh (max-width: 520px) { .jh-details { padding: var(--space-16); } }

/* Permission to use their materials: a card with a square mark, its
   statement in body text. */
.jh-consent .jh-option-text { font-size: var(--text-body); color: var(--text); line-height: var(--leading-body); }
.jh-consent .jh-option-body { padding-block: var(--space-20); }
.jh-consent .jh-option-body::before { top: calc(var(--space-20) + 2px); }
.jh-consent input[aria-invalid="true"] + .jh-option-body { box-shadow: inset 0 0 0 1.5px var(--error); }

/* Budget: a typed amount with a dollar sign, or "Not sure yet". The error
   sits right under the amount; on phones the box is full width with the
   choice below. */
.jh-budget { display: grid; grid-template-columns: minmax(0, 240px) auto; justify-content: start; align-items: center; gap: var(--space-8) var(--space-16); margin-top: var(--space-8); }
.jh-budget .jh-error { grid-column: 1 / -1; grid-row: 2; margin: 0; }
.jh-budget .jh-choice { grid-column: 2; grid-row: 1; }
/* The choice keeps its width when ticked, so nothing shifts. */
.jh-budget .jh-choice span { min-width: 9.5em; justify-content: center; }
@container jh (max-width: 520px) {
  .jh-budget { grid-template-columns: minmax(0, 1fr); }
  .jh-budget .jh-error { grid-row: auto; }
  .jh-budget .jh-choice { grid-column: 1; grid-row: auto; justify-self: start; }
}
.jh-money { position: relative; min-width: 0; }
.jh-money .jh-input { margin-top: 0; padding-left: calc(var(--space-16) + 14px); font-variant-numeric: tabular-nums; }
.jh-money-sign { position: absolute; left: var(--space-16); top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.jh-money:has(.jh-input:disabled) .jh-money-sign { opacity: var(--opacity-disabled); }

/* Site preview: their own site, drawn by their own browser at desktop
   width (1280 by 800) and scaled to fit. It can't be clicked or tabbed
   into. */
.jh-site-preview { max-width: 420px; margin: var(--space-16) 0 0; }
.jh-site-preview-frame {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius-card); background: var(--raised);
  box-shadow: inset 0 0 0 var(--stroke-hairline) var(--hairline);
}
.jh-site-preview-frame iframe {
  position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0;
  transform: scale(var(--preview-scale, .5)); transform-origin: 0 0;
  background: #fff; opacity: 0; transition: opacity var(--duration-section) var(--ease-standard);
}
.jh-site-preview.is-loaded iframe { opacity: 1; }
.jh-site-preview.is-failed .jh-site-preview-frame { display: none; }
.jh-site-preview figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) var(--space-16); margin-top: var(--space-8); font-size: var(--text-body-sm); color: var(--text-muted); }
.jh-site-preview-address { font-weight: var(--weight-emphasis); color: var(--text); overflow-wrap: anywhere; }

@container jh (max-width: 640px) {
  .jh-options { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .jh-site-preview-frame iframe { transition: none; }
}
@media (forced-colors: active) {
  .jh-option-body { border: 1px solid CanvasText; }
  .jh-option input:checked + .jh-option-body { outline: 2px solid Highlight; }
  .jh-option-body::before { border: 1px solid CanvasText; }
  .jh-option input:checked + .jh-option-body::before { background: Highlight; }
}

/* ---------- One raised panel (#73, Direction A, Business 11-10) ----------
   The form and the thank-you sit on the overlay surface with the panel
   shadow: the services panel's recipe (components.css:186-195). Every value
   is an existing token. The header row's and footer's negative margins
   follow --card-padding, so they change with it. */
.jh-apply #apply-form,
.jh-apply .jh-confirmation {
  padding: var(--card-padding);
  border: var(--stroke-hairline) solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--overlay);
  box-shadow: var(--shadow-panel);
}
.jh-apply .jh-confirmation { max-width: none; }

/* The progress line is the panel's header row; Back and Continue are its
   footer. */
.jh-apply .jh-progress {
  margin: calc(-1 * var(--card-padding)) calc(-1 * var(--card-padding)) var(--space-32);
  padding: var(--space-20) var(--card-padding);
  border-bottom: var(--stroke-hairline) solid var(--line);
}
.jh-apply .jh-step-actions {
  margin: var(--space-40) calc(-1 * var(--card-padding)) calc(-1 * var(--card-padding));
  padding: var(--space-20) var(--card-padding);
  border-top: var(--stroke-hairline) solid var(--line);
  border-radius: 0 0 calc(var(--radius-card) - var(--stroke-hairline)) calc(var(--radius-card) - var(--stroke-hairline));
  background: var(--overlay-hover);
}

/* Cards inside the panel: white with today's edge. The pointer darkens the
   edge, as on a field (components.css:506). Selected keeps today's tint,
   2px edge and filled tile (site.css:172-173), mixed on white. */
.jh-apply .jh-option-body { background: var(--overlay); }
.jh-apply .jh-option:hover .jh-option-body { background: var(--overlay-hover); box-shadow: inset 0 0 0 var(--stroke-hairline) var(--text-muted); }
.jh-apply .jh-option input:checked + .jh-option-body { background: color-mix(in srgb, var(--action) 10%, var(--overlay)); box-shadow: inset 0 0 0 2px var(--action); }
.jh-apply .jh-details { background: var(--overlay-hover); }

/* A group left empty keeps its red edge, under the pointer too (site.css:175,
   above at "Question groups"). */
.jh-apply .jh-choice-group[aria-invalid="true"] .jh-option-body,
.jh-apply .jh-choice-group[aria-invalid="true"] .jh-option:hover .jh-option-body { box-shadow: inset 0 0 0 var(--stroke-hairline) var(--error); }
.jh-apply .jh-consent input[aria-invalid="true"] + .jh-option-body,
.jh-apply .jh-consent:hover input[aria-invalid="true"] + .jh-option-body { box-shadow: inset 0 0 0 1.5px var(--error); }

/* The aside sits flat beside the panel, so the form is the one raised
   thing. */
.jh-apply-aside { padding: var(--space-20) 0 0; background: none; box-shadow: none; }

/* Phones: the panel runs edge to edge, so the fields keep today's width. */
@container jh (max-width: 520px) {
  .jh-apply #apply-form,
  .jh-apply .jh-confirmation {
    --card-padding: var(--gutter);
    margin-inline: calc(-1 * var(--gutter));
    border-inline: 0; border-radius: 0; box-shadow: none;
  }
  .jh-apply .jh-step-actions { border-radius: 0; }
}

/* ---------- Finish (Business, 11-11) ---------- */
/* Short last lines are balanced in hints and the aside's steps. */
.jh-apply .jh-hint,
.jh-apply-aside li { text-wrap: pretty; }

/* Up to 640 px, fields stand one under the other, as the option cards do,
   so a hint or an error never squeezes into half the row. */
@container jh (max-width: 640px) {
  .jh-apply .jh-form { grid-template-columns: 1fr; }
}

/* The aside sits beside the panel only when the panel keeps its full
   760 px there (760 + the 72 px gap + an aside of 288 px or more). Below
   that, from 901 to 1199 px, the aside sits under the panel and the panel
   keeps its 760 px; at 900 and under, site.css stacks them full width. */
@container jh (width > 900px) and (width < 1200px) {
  .jh-apply { grid-template-columns: minmax(0, 760px); }
  .jh-apply-aside { position: static; }
}

/* Beside the panel, the aside's first rule lines up with the panel's
   header rule. */
@container jh (width >= 1200px) {
  .jh-apply-aside { padding-top: var(--space-32); }
}

/* Under the panel, the aside's text lines up with the form's text. */
@container jh (width > 520px) and (width < 1200px) {
  .jh-apply-aside { padding-inline: calc(var(--card-padding) + var(--stroke-hairline)); }
}

.jh-apply #apply-form { container: apply-panel / inline-size; }

/* A step change scrolls the panel's top just below the sticky header, so
   the step line shows (as prose headings do, site.css). */
.jh-apply #apply-form { scroll-margin-top: calc(var(--header-height) + var(--space-24)); }

/* ---------- #112: services, then a few questions for each ----------
   JH Form 1's picked look (C, icon tiles; Business 11-12), from its
   mockup's styles with every value an existing token. */

/* Step 1: "We do it for you" and "We help you use AI", each a row of icon
   tiles (two across in a narrow panel), then "or" and "Not sure yet". */
.jh-svc-group { margin: 0 0 var(--space-24); padding: 0; border: 0; min-width: 0; }
.jh-svc-group-name { margin-bottom: var(--space-12); padding: 0; font-size: var(--text-body-sm); font-weight: var(--weight-emphasis); color: var(--text-muted); letter-spacing: .02em; text-transform: uppercase; }
.jh-svc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12); }
.jh-svc-tile { position: relative; display: flex; }
.jh-svc-tile input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.jh-svc-tile-body {
  display: grid; grid-template-columns: 1fr 20px; grid-template-rows: auto 1fr; gap: var(--space-12);
  width: 100%; min-height: 112px; padding: var(--space-16);
  border-radius: var(--radius-card); background: var(--overlay);
  box-shadow: inset 0 0 0 var(--stroke-hairline) var(--border);
  transition: background-color var(--duration-control) var(--ease-standard), box-shadow var(--duration-control) var(--ease-standard);
}
.jh-svc-tile-body .jh-tile { background: var(--surface); }
.jh-svc-tile-name { grid-column: 1 / -1; grid-row: 2; align-self: end; font-size: var(--text-body-sm); font-weight: var(--weight-emphasis); color: var(--text); line-height: var(--leading-snug); }
/* The square mark: empty, or filled with a check (as the option cards). */
.jh-svc-check { grid-column: 2; grid-row: 1; width: 20px; height: 20px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--text-muted); background: var(--overlay); }
/* The pointer darkens the edge, as on the option cards; chosen shows a
   tint, a 2px edge, a filled icon tile and a checked mark, so it never
   relies on color alone. */
.jh-svc-tile:hover .jh-svc-tile-body { background: var(--overlay-hover); box-shadow: inset 0 0 0 var(--stroke-hairline) var(--text-muted); }
.jh-svc-tile input:checked + .jh-svc-tile-body { background: color-mix(in srgb, var(--action) 10%, var(--overlay)); box-shadow: inset 0 0 0 2px var(--action); }
.jh-svc-tile input:checked + .jh-svc-tile-body .jh-tile { background: var(--action); color: var(--on-action); }
.jh-svc-tile input:checked + .jh-svc-tile-body .jh-svc-check {
  box-shadow: none;
  background: var(--action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.jh-svc-tile input:focus-visible + .jh-svc-tile-body { outline: var(--stroke-focus) solid var(--focus); outline-offset: var(--focus-offset); }
/* Nothing chosen: every tile gets the red edge, under the pointer too. */
.jh-apply .jh-step-group[aria-invalid="true"] .jh-svc-tile-body,
.jh-apply .jh-step-group[aria-invalid="true"] .jh-svc-tile:hover .jh-svc-tile-body { box-shadow: inset 0 0 0 var(--stroke-hairline) var(--error); }
/* "Not sure yet, help me choose": one wide row, icon, name, mark. */
.jh-svc-tiles.jh-svc-tiles--one { grid-template-columns: 1fr; }
.jh-svc-tiles--one .jh-svc-tile-body { grid-template-columns: var(--tile-size) 1fr 20px; grid-template-rows: auto; align-items: center; min-height: 0; }
.jh-svc-tiles--one .jh-svc-tile-name { grid-column: 2; grid-row: 1; align-self: center; font-size: var(--text-body); }
.jh-svc-tiles--one .jh-svc-check { grid-column: 3; }
.jh-or { display: flex; align-items: center; gap: var(--space-12); margin: var(--space-8) 0 var(--space-16); color: var(--text-muted); font-size: var(--text-body-sm); }
.jh-or::before, .jh-or::after { content: ""; flex: 1; border-top: var(--stroke-hairline) solid var(--line); }
@container apply-panel (width < 600px) {
  .jh-svc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
  .jh-svc-tile-body { min-height: 96px; padding: var(--space-12); gap: var(--space-8); }
  .jh-svc-tiles--one .jh-svc-tile-body { min-height: 0; }
}

/* Step 2: one block per chosen service, headed by its icon and name, with
   a rule between blocks. Hidden blocks take no room. */
.jh-svc { display: grid; row-gap: var(--space-24); }
.jh-svc:not([hidden]) ~ .jh-svc { margin-top: var(--space-24); padding-top: var(--space-24); border-top: var(--stroke-hairline) solid var(--line); }
.jh-svc-name { display: flex; align-items: center; gap: var(--space-12); margin: 0 0 calc(-1 * var(--space-8)); font: var(--weight-display) var(--text-subheading)/var(--leading-snug) var(--font-display); letter-spacing: var(--tracking-heading); }
.jh-svc-name .jh-tile { background: var(--action); color: var(--on-action); }
.jh-q-slot { display: contents; }
.jh-q .jh-choices { margin-top: var(--space-12); gap: var(--space-8); }
.jh-q .jh-field-label { margin-bottom: 0; }
.jh-shared { margin: calc(-1 * var(--space-12)) 0 0; font-size: var(--text-body-sm); color: var(--text-muted); }

@media (forced-colors: active) {
  .jh-svc-tile-body, .jh-svc-check { border: 1px solid CanvasText; }
  .jh-svc-tile input:checked + .jh-svc-tile-body { outline: 2px solid Highlight; }
  .jh-svc-tile input:checked + .jh-svc-tile-body .jh-svc-check { background: Highlight; }
}

/* Less blank above the title (JH Review 1, A13: the section space, 160 on
   desktop, put 240 px of nothing between the screen's top and "Apply", and
   step 1's Continue under a 900 px screen). The page opens as the service
   pages do: 72 above the title, 40 on phones. */
.jh-section:has(> .jh-wrap > .jh-apply) { padding-top: var(--space-72); }
@media (max-width: 699px) {
  .jh-section:has(> .jh-wrap > .jh-apply) { padding-top: var(--space-40); }
}
