/**
 * NPS launch configurator - app-shell skin (P2M5-R7).
 *
 * Michael's 21 prototypes carry the per-product behavior we need; this skin
 * re-dresses them in the app-shell visual design Jeremy signed off (the same
 * look as nps-configurator.css on the engine form): the light blue-grey canvas,
 * the white sticky bar, 3px-rounded cards, the #1f5fa8 accent, the "Your Quote
 * Request So Far" sidebar, and - via nps-configurator-skin.js - a two-step flow
 * (confirmation is not a counted step), a mobile sticky action bar, and a
 * "View Quote Request" bottom-sheet drawer. Injected into every prototype frame.
 * Presentation only; the prototype's fields, logic and submit are untouched.
 */

/* App-shell palette, mapped onto the prototype's own CSS variables so every
   rule that reads them recolors at once. */
:root {
	--navy: #0f1b2d;
	--text: #17263a;
	--muted: #5b6675;
	--line: #d7dce3;
	--field: #ffffff;
	--cyan: #1f5fa8;   /* app-shell accent (was prototype cyan) */
	--panel: #ffffff;
	--nps-accent: #1f5fa8;
}

/* iOS Safari sizes an iframe to its document's scroll height and ignores the
   element height, which would let the frame outgrow its box and break the sticky
   top bar + the fixed mobile action bar/drawer. Make the document its own scroll
   container so the body (not the iframe) scrolls and the frame never expands. */
html { background: #eef2f7 !important; height: 100%; overflow: hidden; }
body { background: #eef2f7 !important; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* --- top bar: prototype sticky-head -> app-shell context bar --------------- */
.sticky-head {
	background: rgba(255, 255, 255, .97) !important;
	border-bottom: 1px solid #e2e8f0 !important;
	-webkit-backdrop-filter: saturate(180%) blur(8px);
	backdrop-filter: saturate(180%) blur(8px);
}
.sticky-inner { max-width: 1200px; padding: 10px 22px 9px; gap: 16px; }
.nps-skin-logo { display: inline-flex; align-items: center; flex: none; }
.nps-skin-logo img { height: 32px; width: auto; display: block; }
.sticky-title { color: #0f1b2d; font-weight: 800; flex: 1 1 auto; min-width: 0; }   /* grows so the progress bar is pushed to the right of the nav */
.sticky-type:not(#stickyType) { display: none; }   /* drop the static "Quick Quote" tag, but keep the live #stickyType context (garment type, etc.) */
#stickyType.sticky-type { color: #5b6675; font-size: 13px; }
.sticky-step { color: #5b6675; font-weight: 600; }
.progress { background: #dfe5ee; height: 5px; border-radius: 999px; }
.progress > span { background: #1f5fa8; width: 50%; }   /* two steps: 50% default so the bar doesn't animate up from the prototype's 33% on load */
/* skin.js wraps .progress + .sticky-step in .nps-skin-progrow so they can move
   together to a row beneath the nav on mobile. On desktop it stays inline. */
/* Desktop: the progress bar sits on the RIGHT of the nav, next to "Step X of Y"
   (the product title grows to push the pair over). */
.nps-skin-progrow { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.nps-skin-progrow .progress { flex: 0 0 auto; width: 160px; max-width: 160px; }
.nps-skin-progrow .sticky-step { flex: none; white-space: nowrap; }

/* --- page canvas ---------------------------------------------------------- */
.page { max-width: 1200px; padding: 24px 22px 60px; }
h1, .sticky-title { color: #0f1b2d; }
/* Section headings match the Request a Quote form: navy, bold, sentence case.
   The prototypes ship them ALL CAPS ("PROJECT OPTIONS"); lowercase the text and
   re-capitalize the first letter so they read like the rest of the site. h2 is
   only ever a section heading in these forms; h1 is the product name (untouched). */
h2 { color: #0f3358; font-weight: 700; text-transform: lowercase; }
h2::first-letter { text-transform: uppercase; }
/* Sub-section headings (BUILD YOUR BUSINESS CARD, FRONT OF CARD, MULTIPLE PEOPLE /
   VERSIONS, etc.) are all-caps too; de-cap them the same way. Verified: no h3/h4 in
   any of the 21 is a proper noun, so lowercasing is safe. Their sizes are unchanged. */
h3, h4 { text-transform: lowercase; }
h3::first-letter, h4::first-letter { text-transform: uppercase; }
.brandbar { display: none; }               /* the CMYK bar is not in the app-shell */
.steps { display: none !important; }       /* the 3 step boxes are replaced by the 2-step progress bar */
.footer { display: none !important; }      /* the prototype footer carries an internal "V10.x" build stamp; the brand is in the top bar */
.intro-copy .sub { color: #5b6675; }

/* --- cards + fields: 3px corners, app-shell surfaces ---------------------- */
.content-card {
	border: 1px solid #d7dce3;
	border-radius: 4px;
	box-shadow: 0 1px 2px rgba(15, 27, 45, .04);
	background: #fff;
}
/* Form controls mirror the Request a Quote (Submit a Project) form: 4px corners,
   a light neutral border, and an inline chevron instead of the prototype's boxed
   arrow, so the two flows read as one site. */
.control, select, textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"] {
	border-radius: 4px !important;
	border: 1px solid #d1d5db !important;
	background-color: #fff !important;   /* background-color, not the shorthand, so the select keeps its chevron background-image */
}
.control:focus, select:focus, textarea:focus, input:focus {
	border-color: #0b7da4 !important;
	box-shadow: none !important;
	outline: none;
}
/* Replace the prototype's boxed "▼" with the Request a Quote inline SVG chevron.
   Applied to EVERY select (not just .select-wrap ones): a few products build extra
   selects from script without the wrapper, and they must not keep the native arrow. */
.select-wrap::after { display: none !important; }
/* `.field-error select` is included so a select that fails validation keeps the
   chevron - the prototype's `.field-error select{background:... !important}` shorthand
   would otherwise wipe the background-image and leave a red box with no arrow. */
select, .field-error select {
	appearance: none; -webkit-appearance: none; -moz-appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 16px center !important;
	background-size: 14px !important;
	padding-right: 44px !important;
}
/* The small selects a few products build from script (no .select-wrap, no width)
   sit in fixed desktop grid cells; the 44px chevron gutter would overflow them.
   Tighten to fill the cell with a compact chevron. */
.panel-row select, .vehicle-row select {
	width: 100%; min-width: 0;
	padding: 0 26px 0 8px !important;
	background-position: right 8px center !important;
}
/* Error fields turn their border red on every product (one packaging prototype uses
   a lower-specificity `.field-error input` that the skin's border was overriding). */
.field-error input:not([type="checkbox"]):not([type="radio"]),
.field-error select, .field-error textarea, .field-error .date-box, .field-error-control {
	border-color: #b3261e !important;
}
label { color: #17263a; }
.helpbox, .row-note { border-radius: 4px; background: #f6f9fc; border-color: #dbe3ec; }

/* --- buttons -------------------------------------------------------------- */
.primary { background: #1f5fa8; border-radius: 4px; }
.primary:hover { background: #184e8c; }
.secondary { background: #e9eef5; color: #1f5fa8; border-radius: 4px; }
.small-upload, .panel-file-btn, .vehicle-file-btn, .panel-add, .vehicle-add { border-radius: 4px; border-color: #1f5fa8; color: #1f5fa8; }
.file-clear, .remove-line, .panel-remove, .vehicle-remove, .breakdown, .location-upload, .panel-schedule, .vehicle-schedule { border-radius: 4px; }
.date-box { border-radius: 4px; }

/* --- artwork upload: the Request a Quote drop-zone (dashed rectangle, centered
       icon) in place of the prototype's solid blue button + text box. Behaviour
       is unchanged: the <label class="upload-btn"> still opens its file input. --- */
.upload-row { display: block; }
.upload-btn {
	display: block; width: 100%; box-sizing: border-box; margin: 0;
	background: #f9fafb; border: 1.5px dashed #d1d5db; border-radius: 4px;
	padding: 22px 20px; text-align: center;   /* label sentence-cased in JS (styleUploadLabels) so "Side A/B" stay upper */
	color: #0f3358; font-weight: 600; font-size: 15px; line-height: 1.3;
	min-width: 0; cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.upload-btn::before {
	content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 9px;
	background: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 24 24' fill='none' stroke='%230b7da4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E") center/contain no-repeat;
}
.upload-btn:hover, .upload-btn:focus { border-color: #0b7da4; background: rgba(11, 125, 164, .05); outline: none; }
.file-name {
	display: block; width: 100%; box-sizing: border-box; margin-top: 10px; min-height: 0;
	border: 1px solid #e5e7eb; border-radius: 4px; background: #fff;
	padding: 10px 12px; color: #6b7280; font-size: 13px;
}

/* --- "Your Quote Request So Far": app-shell sidebar card ------------------ */
.summary {
	border: 1px solid #d7dce3;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 27, 45, .04);
	position: sticky;
	top: 69px;
}
.summary h2 {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: lowercase;   /* + the global h2::first-letter = sentence case */
	color: #0f3358;
	padding-bottom: 12px;
	border-bottom: 1px solid #e2e7ee;
	margin: 0 0 12px;
}
.summary .small { display: none; }   /* "Updates as you make choices." is redundant with "So Far" in the title */
/* Scroll inside the sidebar when the request gets long, instead of pushing the
   card taller than the viewport. */
.summary-body {
	border: 0; background: transparent; padding: 0 6px 0 0; color: #17263a;
	white-space: pre-wrap; overflow-wrap: anywhere;
	min-height: 120px; max-height: calc(100vh - 220px); overflow-y: auto;
}
/* Styled summary rows (skin.js rebuilds the plain-text summary into these): the
   label is a slightly-bold sentence-case word, not an all-caps heading. */
/* Soft compatibility advisory (non-blocking) injected by the skin's advisory engine. */
.nps-advisory { display: none; margin: 0 0 16px; padding: 12px 14px; border-radius: 6px; background: #fff8e6; border: 1px solid #f1d58a; color: #6b5312; font-size: 14px; line-height: 1.45; }
.nps-advisory div + div { margin-top: 8px; }

.nps-sum-item { margin: 0 0 12px; }
.nps-sum-item:last-child { margin-bottom: 0; }
.nps-sum-label { font-weight: 600; color: #0f3358; font-size: 13px; margin: 0 0 1px; }
.nps-sum-value { color: #3a4657; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { color: #8a93a1; }

/* --- confirmation screen (#step3): two labelled subsections (Your details / Project
       details), number + email as plain read-only text (not field boxes), no scroll. --- */
#step3 .content-card { max-width: 860px; }
#step3 .field > label { font-weight: 600; color: #6b7280; font-size: 13px; }
/* subsection headings are the page's heading blue; item labels below are gray (blue
   is reserved for headings on this page). */
.nps-confirm-head { font-size: 16px; font-weight: 700; color: #0f3358; margin: 0 0 12px; }
#step3 .nps-confirm-grid { grid-template-columns: 1fr; gap: 22px; }   /* phone/tablet: the two sections stack */
#step3 #confirmDetails .nps-sum-label { color: #6b7280; }             /* item labels gray, blue is for headings */
@media (min-width: 901px) {
	#step3 .nps-confirm-grid { grid-template-columns: 280px 1fr; gap: 44px; align-items: start; }
}
#step3 #confirmNum, #step3 #confirmEmail {
	border: 0 !important; background: transparent !important; padding: 2px 0 0 !important;
	min-height: 0 !important; border-radius: 0 !important;
	font-size: 15px; font-weight: 400; color: #17263a; letter-spacing: 0;   /* number matches the email text */
}
/* the styled "Full project details" rows carry their own spacing; drop the tall
   min-height, the inner scroll, and the field-box look - let the card just grow. */
#step3 #confirmDetails {
	min-height: 0 !important; max-height: none !important; overflow: visible !important;
	border: 0 !important; background: transparent !important; padding: 0 !important;
}
#step3 #confirmDetails .nps-sum-item { margin-bottom: 10px; }
/* The request is sent, so no big action buttons - just a quiet edit line. */
#step3 .actions.nps-editline {
	display: block; grid-template-columns: none; gap: 0; margin: 18px 0 0;
	border-top: 1px solid #eef1f5; padding-top: 16px; font-size: 14px; color: #6b7280;
}
.nps-edit-note { color: #6b7280; }
#step3 #editBtn.nps-editlink {
	display: inline; width: auto; min-width: 0; margin: 0; padding: 0;
	border: 0; background: transparent; border-radius: 0;
	color: #1f5fa8; font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
#step3 #editBtn.nps-editlink:hover { color: #184e8c; }

/* rounded corners on the various per-product panels so they match the cards */
.allocation-box, .panel-schedule, .vehicle-schedule, .size-artwork, .version-art,
.side-artwork, .builder-box, .qr-upload-box, .confirm-box, .confirm-details,
.type-card, .select-type { border-radius: 4px; }

/* --- validation + rush keep their meaning, just softened corners ---------- */
.validation, .rush, .email-warning { border-radius: 4px; }

/* --- mobile: hide the sidebar, show the fixed bar + drawer ---------------- */
.nps-skin-mobilebar { display: none; }        /* desktop: the in-form buttons are used */
.nps-skin-viewquote { display: none; }
.nps-skin-drawer, .nps-skin-backdrop { display: none; }

@media (max-width: 900px) {
	/* G05: on iPhone the styled date box called showPicker(), which the browser
	   blocks inside an iframe, so the native date picker never opened. Make the real
	   type=date input tappable (it sits transparent over the box) so a tap lands on
	   it and the OS opens its own picker - the reliable mobile path. */
	.date-native { pointer-events: auto !important; z-index: 3; cursor: pointer; }

	/* Fit the whole configurator in the visible area so the action bar is never
	   below the fold behind the mobile browser chrome. The iframe body is a flex
	   column: header on top (flex:none), the form scrolls in the middle (flex:1),
	   and the action bar is a normal in-flow row pinned to the bottom - NOT
	   position:fixed, which mis-measures against a dynamic mobile toolbar. */
	html, body { height: 100%; overflow: hidden; }
	body { display: flex; flex-direction: column; align-items: stretch; }
	.sticky-head { position: static; flex: 0 0 auto; }
	/* min-width:0 is essential: as a flex-column child, .page would otherwise grow to
	   its content's min-content width and get clipped by body{overflow:hidden}, eating
	   the right gutter. overflow-x:hidden is a belt against any single stubborn child. */
	.page { flex: 1 1 auto; width: 100%; min-width: 0; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; min-height: 0; padding-bottom: 20px; }

	/* minmax(0,1fr) (not 1fr, whose auto min is min-content) lets the single mobile
	   column shrink to the viewport instead of forcing the page wider than the screen. */
	.main-grid { grid-template-columns: minmax(0, 1fr); min-width: 0; }
	.content-card, .summary { min-width: 0; max-width: 100%; }
	.summary { display: none; }               /* replaced by the drawer */
	.nps-skin-mobilebar { display: block; }
	/* the prototype's own in-form action rows are proxied into the fixed bar */
	#step1 .actions, #step2 .actions, #step3 .actions { display: none; }
	/* two-tier sticky header: logo + product name on top, then the progress bar
	   with "Step X of Y" beside it on a row beneath the nav. (The prototype hides
	   the bar under 620px; .nps-skin-progrow brings it back for mobile.) */
	.sticky-inner { flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 14px; }
	.nps-skin-logo { order: 1; flex: 0 0 auto; }
	.nps-skin-logo img { height: 26px; }
	/* long product names (30-50 chars) must wrap, not force a horizontal page scroll */
	.sticky-title { flex: 1 1 auto; min-width: 0; max-width: none; order: 2; white-space: normal; line-height: 1.2; font-size: 14px; }
	#stickyType.sticky-type { order: 3; flex: 0 0 100%; margin: 0; }   /* garment context on its own line under the name */
	.nps-skin-progrow { order: 4; flex: 1 1 100%; display: flex; align-items: center; gap: 10px; }
	.nps-skin-progrow .progress { display: block !important; flex: 1 1 auto; max-width: none; height: 6px; margin: 0; }
	.nps-skin-progrow .sticky-step { flex: 0 0 auto; font-size: 12px; white-space: nowrap; margin: 0; }

	/* during "Sending...", the cloned mobile-bar buttons must read as disabled too
	   (the real ones are disabled by setBusy()); otherwise they look tappable. */
	body.nps-cfg-sending .nps-skin-mobilebar .actions button { opacity: .5; pointer-events: none; }

	/* in-flow bottom action bar (flex row at the end of the body column, so it is
	   always within the visible area - no position:fixed) */
	.nps-skin-mobilebar {
		flex: 0 0 auto; z-index: 55;
		background: #fff; border-top: 1px solid #e2e8f0;
		box-shadow: 0 -2px 10px rgba(15, 27, 45, .08);
		padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
	}
	.nps-skin-viewquote {
		display: block; width: 100%; background: transparent; border: 0;
		padding: 0 0 12px; font-size: 13px; font-weight: 700; color: #1f5fa8;
		text-decoration: underline; text-align: center; cursor: pointer;
	}
	/* the prototype's .actions row, moved into the fixed bar, split full-width */
	.nps-skin-mobilebar .actions {
		display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; margin: 0;
	}
	.nps-skin-mobilebar .actions .primary,
	.nps-skin-mobilebar .actions .secondary { min-width: 0; width: 100%; padding: 12px 10px; }

	/* backdrop + bottom-sheet drawer */
	.nps-skin-backdrop {
		display: block; position: fixed; inset: 0; background: rgba(15, 27, 45, .45);
		opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 70;
	}
	.nps-skin-drawer {
		display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0;
		z-index: 71; max-height: 72vh; background: #fff; border-radius: 14px 14px 0 0;
		box-shadow: 0 -8px 30px rgba(15, 27, 45, .22); transform: translateY(100%);
		transition: transform .25s ease;
	}
	body.nps-skin-drawer-open .nps-skin-backdrop { opacity: 1; pointer-events: auto; }
	body.nps-skin-drawer-open .nps-skin-drawer { transform: translateY(0); }
	body.nps-skin-drawer-open { overflow: hidden; }
	.nps-skin-drawer__head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 16px 18px 12px; border-bottom: 1px solid #eef1f5;
	}
	.nps-skin-drawer__title {
		margin: 0; font-weight: 700; color: #0f3358; font-size: 15px; letter-spacing: 0;
	}
	.nps-skin-drawer__close {
		border: 0; background: transparent; font-size: 26px; line-height: 1;
		color: #5b6675; cursor: pointer; padding: 0 4px;
	}
	.nps-skin-drawer__body {
		overflow-y: auto; padding: 14px 18px 22px; font-size: 14px;
		white-space: pre-wrap; -webkit-overflow-scrolling: touch; color: #17263a;
	}
}
