/*
 * Participant Platform — foundation stylesheet
 * =============================================================================
 * Scope:   participant host world ONLY (credentials.host[:participant_domain]).
 * Mechanism: this file lives outside app/assets/stylesheets so the customer
 *            manifest's `require_tree .` never folds it into the customer
 *            bundle. It is served via manifest.js `link_directory` and a
 *            config.assets.paths entry — the customer application.css stays
 *            byte-identical, and every rule below is additionally scoped under
 *            `body.participant` (set by layouts/participant/application) as a
 *            second safety net. layout/participant loads BOTH `application`
 *            (lifecycle base: bootstrap + GHDashClient vocab) and this sheet —
 *            no base duplication, no drift.
 *
 * Sections:
 *   1. Design tokens     — all colour/radius/spacing decisions live here
 *   2. Base              — body defaults
 *   3. Layout wrapper    — dashClient full-height centering
 *   4. Brand header      — shared frame header: Cavlent wordmark + language selector
 *   5. Card container    — loginContainer
 *   6. Titles            — page headings
 *   7. Forms             — cFlexContainer, detailItem rows, uk-input
 *   8. Buttons           — controlBarContainer, buttonItem
 *   9. Messages          — messageItem / errorItem
 *  10. Status feedback   — statusItem variants (hook classes)
 *  11. Notes & lists      — note text, uk-checkbox catalog rows
 *  12. Frame footer       — shared frame footer: quiet brand assurance line
 *  13. Responsive        — phone-first adjustments (QRIS arrivals)
 * =============================================================================
 */

/* ---------------------------------- 1. TOKENS ------------------------------ */
body.participant {
	/* Palette — Cavlent blue product family, aligned with MonoPilot's
	   themeController: --cavlentBlue #00467d as primary, cavlentBlue01 #e6ecf2
	   as the light tint surface, black main text, grey ramp for secondary copy,
	   #ddd borders. Status colours below are semantics, not brand — untouched. */
	--p-bg:            #f0f4f8;	  /* airy Cavlent-tinted ground — lighter derivation of cavlentBlue01 */
	--p-card:          #ffffff;	  /* crisp card surface — MonoPilot's white card language */
	--p-ink:           #000000;	  /* MonoPilot main-text black — maximum AA contrast */
	--p-muted:         #666666;	  /* MonoPilot secondary grey: notes, helper copy, labels */
	--p-line:          #dddddd;	  /* MonoPilot border grey — quiet but present */

	--p-accent:        #00467d;	  /* Cavlent blue — brand primary: buttons, links, focus, payment CTA */
	--p-accent-hover:  #003460;	  /* one step deeper into the Cavlent ramp for hover/press */
	--p-accent-soft:   #e6ecf2;	  /* cavlentBlue01 — official light tint for focus rings and highlights */

	--p-danger:        #d92d20;	  /* red reserved strictly for errors */
	--p-danger-soft:   #fdecea;	  /* tamed red wash for inline error banners */

	--p-warn:          #b45309;	  /* amber — "processing" feels pending, not broken */
	--p-warn-soft:     #fdf3e7;

	--p-ok:            #15803d;	  /* green — "ready/paid" success states */
	--p-ok-soft:       #e7f5ec;

	/* Shape & shadow */
	--p-radius:        14px;	  /* friendly card radius */
	--p-radius-sm:     10px;	  /* input/button radius */
	--p-shadow:        0 1px 2px rgba(0, 70, 125, 0.05), 0 12px 32px rgba(0, 70, 125, 0.08); /* Cavlent-tinted lift */

	/* Rhythm */
	--p-gap:           16px;	  /* default vertical rhythm between rows */
	--p-card-padding:  28px;	  /* generous card comfort on consumers' phones */
}

/* ----------------------------------- 2. BASE ------------------------------- */
body.participant {
	margin: 0;
	color: var(--p-ink);
	background: var(--p-bg);
	font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* ----------------------------- 3. LAYOUT WRAPPER --------------------------- */
/* Keep the house vocabulary; re-skin it. */
body.participant .dashClient {
	min-height: 100vh;
}

body.participant .flexContainer {
	display: flex;
}
body.participant .fullVContainer {
	min-height: 100vh;
	width: 100%;
}
body.participant .flexJusCenter { justify-content: center; }
body.participant .flexAlCenter { align-items: center; }
body.participant .flexWrap { flex-wrap: wrap; }

/* Top-aligned flow stack: content starts at the top of tall viewports
   instead of hanging mid-page; the house flexJusCenter still owns the
   card's horizontal placement. Beats flexJusCenter's vertical centering
   only inside the page wrapper (dashClient). */
body.participant .dashClient.flexAlCenter { align-items: flex-start; }
body.participant .cFlexContainer {
	display: flex;
	flex-direction: column;
	gap: var(--p-gap);
}

/* ------------------------------ 4. BRAND HEADER ---------------------------- */
/* Shared frame (shared/_header): clean brand chrome — the Cavlent wordmark
   centered above the divider line, then a quiet utility row below it holding
   the session reset (left) and the language selector (right). */
body.participant .header {
	margin-bottom: 0;
}

body.participant .logoContainer {
	display: flex;
	justify-content: center;
}

body.participant .header .logoContainer {
	padding-bottom: 2px;
	border-bottom: 1px solid var(--p-line);
}

body.participant .brandLink {
	display: inline-flex;
	align-items: center;
}

/* Height-constrained so the SVG's intrinsic ratio keeps the wordmark crisp —
   no hard-coded width to distort an asset we don't control. 50px reads as a
   confident brand mark; the selector self-centers, so no crowding on phones. */
body.participant .brandLogo {
	display: block;
	height: 50px;
	width: auto;
	margin: 0px 0px 20px 0px;
}

/* Text stand-in when the preset SVG table has no wordmark — carries the same
   Cavlent gradient voice as the retired participantBrand span. */
body.participant .brandFallback {
	display: inline-block;
	font-weight: 800;
	font-size: 0.95rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	background: linear-gradient(120deg, var(--p-accent), #3975b4);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* Utility row — quiet chrome BELOW the brand line, above the page content:
   reset pill left (only while a session is active), language selector right.
   margin-left: auto pins the selector right even when the reset is absent —
   no layout jump. Bottom margin gives the page title breathing room. */
body.participant .utilityRow {
	display: flex;
	align-items: center;
	margin: 12px 0 14px 0;
}

/* Language dropdown — MonoPilot convenience-footer vocabulary, rebuilt as a
   tap-friendly <details> disclosure: pure CSS interaction, no JS. Lives at the
   utility row's right edge; the open list anchors to the pill itself. */
body.participant .languageSelectorContainer {
	margin-left: auto;
}

body.participant .languageSelector {
	position: relative;
}

body.participant .languageCurrent {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	background: var(--p-card);
	border: 1px solid var(--p-line);
	border-radius: 999px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body.participant .languageCurrent::-webkit-details-marker { display: none; }
body.participant .languageCurrent::after {
	content: "\25BE"; /* ▾ — affordance glyph, rotates when open */
	font-size: 10px;
	color: var(--p-muted);
	transition: transform 0.15s ease;
}
body.participant .languageSelector[open] .languageCurrent::after { transform: rotate(180deg); }
body.participant .languageCurrent:hover {
	border-color: var(--p-accent);
	box-shadow: 0 0 0 3px var(--p-accent-soft);
}

body.participant .languageIcon {
	display: block;
	height: 16px;
	width: auto;
	border-radius: 3px;
}

body.participant .languageList {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 150px;
	padding: 6px;
	background: var(--p-card);
	border: 1px solid var(--p-line);
	border-radius: var(--p-radius-sm);
	box-shadow: var(--p-shadow);
	z-index: 30;
}

body.participant .languageItem {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--p-ink);
	text-decoration: none;
	transition: background 0.15s ease;
}
body.participant .languageItem:hover { background: var(--p-accent-soft); }
body.participant .languageItem.active {
	color: var(--p-accent);
	background: var(--p-accent-soft);
}

/* Session reset — quiet pill at the utility row's left edge, mirroring the
   language selector at the right. Muted by default; the accent only surfaces
   on hover, so it never reads as an alarm. */
body.participant .resetContainer {
	flex: 0 0 auto;
}

body.participant .resetButton {
	appearance: none;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--p-muted);
	background: var(--p-card);
	border: 1px solid var(--p-line);
	border-radius: 999px;
	padding: 5px 12px;
	transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
body.participant .resetButton:hover {
	color: var(--p-accent);
	border-color: var(--p-accent);
	box-shadow: 0 0 0 3px var(--p-accent-soft);
}

/* ----------------------------- 5. CARD CONTAINER --------------------------- */
body.participant .loginContainer {
	width: 100%;
	max-width: 440px;
	margin: 24px;
	padding: var(--p-card-padding);
	background: var(--p-card);
	border: 1px solid var(--p-line);
	border-radius: var(--p-radius);
	box-shadow: var(--p-shadow);
}

/* --------------------------------- 6. TITLES ------------------------------- */
body.participant .title {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 18px 0;
	text-align: center;
}

body.participant .detailItem .title {
	/* sub-heading inside catalog groups */
	font-size: 15px;
	font-weight: 700;
	text-align: left;
	margin: 0;
}

/* Purchase-group headers — announce each (products/counsellings) */
body.participant .sectionTitle {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--p-accent);
	margin: 0;
}

body.participant .sectionSubTitle {
	font-size: 13px;
	color: var(--p-muted);
	margin: 0;
}

body.participant .sectionSubTitle .textBold {
	color: var(--p-ink);
	font-weight: 700;
}

/* ---------------------------------- 7. FORMS ------------------------------- */
body.participant .detailItem {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

body.participant .detailItem > label,
body.participant .detailItem label,
body.participant form label {
	font-size: 13px;
	font-weight: 600;
	color: var(--p-muted);
}

body.participant .uk-input,
body.participant input[type="text"],
body.participant input[type="email"],
body.participant input[type="date"] {
	box-sizing: border-box;
	width: 100%;
	padding: 11px 14px;
	font-size: 16px; /* prevents iOS zoom on focus */
	color: var(--p-ink);
	background: var(--p-card);
	border: 1px solid var(--p-line);
	border-radius: var(--p-radius-sm);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.participant .uk-input:focus,
body.participant input:focus {
	outline: none;
	border-color: var(--p-accent);
	box-shadow: 0 0 0 3px var(--p-accent-soft);
}

/* --------------------------------- 8. BUTTONS ------------------------------ */
body.participant .controlBarContainer {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 8px;
}

body.participant .buttonItem {
	appearance: none;
	border: none;
	cursor: pointer;
	display: inline-block;
	font: inherit;
	font-weight: 700;
	color: #ffffff;
	background: var(--p-accent);
	border-radius: var(--p-radius-sm);
	padding: 12px 22px;
	transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

body.participant .buttonItem:hover {
	background: var(--p-accent-hover);
	box-shadow: 0 6px 16px rgba(0, 70, 125, 0.28);
}

body.participant .buttonItem:active {
	transform: translateY(1px);
}

body.participant .buttonItem.small {
	padding: 10px 18px;
	font-size: 14px;
}

/* button_to rails helper wraps in a form — keep it flow-friendly */
body.participant .button_to {
	display: inline;
}

/* -------------------------------- 9. MESSAGES ------------------------------ */
body.participant .messageContainer {
	margin: 0 0 14px 0;
}

body.participant .messageItem {
	padding: 11px 14px;
	border-radius: var(--p-radius-sm);
	font-size: 14px;
	text-align: center;
}

body.participant .errorItem {
	color: var(--p-danger);
	background: var(--p-danger-soft);
	border: 1px solid #f5c6c0;
}

/* ----------------------------- 10. STATUS FEEDBACK ------------------------- */
/* Hook classes used on the order page: ready / generating / processing. */
body.participant .statusItem {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 14px;
	border-radius: 999px;
}

body.participant .statusItem::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

body.participant .statusProcessing {
	color: var(--p-warn);
	background: var(--p-warn-soft);
}

body.participant .statusGenerating,
body.participant .statusReady {
	background: var(--p-ok-soft);
	color: var(--p-ok);
}

body.participant .statusGenerating::before {
	background: var(--p-accent);
	animation: p-pulse 1.2s ease-in-out infinite;
}

@keyframes p-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.35; transform: scale(0.8); }
}

/* ----------------------------- 11. NOTES & LISTS --------------------------- */
body.participant .note {
	color: var(--p-muted);
	font-size: 13px;
}

/* Catalog checkbox rows — comfortable touch targets for phone checkout */
body.participant .uk-checkbox {
	appearance: none;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 1.5px solid var(--p-line);
	border-radius: 6px;
	background: var(--p-card);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

body.participant .uk-checkbox:checked {
	background: var(--p-accent);
	border-color: var(--p-accent);
}

/* Payment-method radio rows — round sibling of the catalog checkbox */
body.participant .uk-radio {
	appearance: none;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 1.5px solid var(--p-line);
	border-radius: 50%;
	background: var(--p-card);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

body.participant .uk-radio:checked {
	background: var(--p-accent);
	border-color: var(--p-accent);
}

body.participant label.uk-flex {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--p-ink);
	cursor: pointer;
	transition: opacity 0.15s ease;
}

body.participant .detailItem + .detailItem {
	padding: 10px 0;
	border-top: 1px solid var(--p-line);
}

/* Catalog item price — right-aligned on the checkbox row */
body.participant .catalogItemName {
	flex: 1 1 auto;
}

body.participant .catalogItemPrice {
	color: var(--p-accent);
	font-weight: 700;
	font-size: 14px;
	white-space: nowrap;
}

/* Product description — the primary template manager's language-resolved
   notes; quiet helper copy under the row, never competing with the price. */
body.participant .catalogItemNote {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--p-muted);
}

/* Purchased catalog rows — owned items lose their checkbox and price; the
   green badge replaces both (mirror of the customer overlay's ticketPurchased
   "Owned" chip, same --p-ok success language as statusReady). */
body.participant .catalogRow {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 600;
	color: var(--p-ink);
}

body.participant .catalogItemBadge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--p-ok);
	background: var(--p-ok-soft);
}

body.participant .catalogItemBadge::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

/* Live cart total line */
body.participant .cartTotal {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
	padding: 12px 14px;
	background: var(--p-accent-soft);
	border-radius: var(--p-radius-sm);
	font-size: 15px;
}

body.participant .cartTotalLabel {
	font-weight: 600;
	color: var(--p-muted);
}

body.participant .cartTotalValue {
	font-weight: 800;
	color: var(--p-ink);
}

/* Completion picker — two-column table (booktabs language, not boxes):
   the finish date owns column one, the row action hugs column two. Rules are
   INTERNAL ONLY — header underline plus between-row separators; no outermost
   top/bottom lines, so the table never doubles the header/footer dividers.
   Every rule line reuses the same --p-line rhythm as the detailItem
   separators, the header stays a quiet --p-muted uppercase label, and the
   empty action header keeps the underline continuous. */
body.participant .pickerTable {
	width: 100%;
	border-collapse: collapse;
}

body.participant .pickerTable th {
	padding: 10px 0;
	border-bottom: 1px solid var(--p-line);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--p-muted);
	text-align: left;
}

/* Between-row separators only — the last row stays open so the table ends
   clean against the footer divider. */
body.participant .pickerTable tbody tr:not(:last-child) {
	border-bottom: 1px solid var(--p-line);
}

body.participant .pickerTable td {
	padding: 12px 0;
	vertical-align: middle;
	font-size: 15px;
	font-weight: 600;
	color: var(--p-ink);
}

/* Action column shrink-wraps the Continue button — the date column takes the
   remaining width, so every row's button lands on the same right edge. */
body.participant .pickerTable .pickerCellAction {
	width: 1%;
	white-space: nowrap;
	text-align: right;
}

/* Window-closed note stacks under the date inside column one — quiet helper
   weight, never a third column. */
body.participant .pickerTable .pickerNote {
	margin-top: 4px;
	font-weight: 400;
}

/* ----------------------------- 12. FRAME FOOTER ---------------------------- */
/* Shared frame (shared/_footer): quiet brand-assurance line —
   trust signal, not navigation. */
body.participant .footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid var(--p-line);
}

body.participant .footerNote {
	font-size: 12px;
	color: var(--p-muted);
}

/* ------------------------------- 13. RESPONSIVE ---------------------------- */
@media (max-width: 480px) {
	body.participant .dashClient {
		padding: 12px;
	}

	body.participant .loginContainer {
		margin: 12px;
		padding: 22px 18px;
	}

	body.participant .title {
		font-size: 20px;
	}

	body.participant .buttonItem {
		width: 100%;
		text-align: center;
	}

	/* Picker rows stack: date (and any window note) above a full-width
	   Continue — the existing .buttonItem phone rule supplies the width. The
	   empty action header would claim half the table, so it drops out. */
	body.participant .pickerTable th:empty {
		display: none;
	}

	body.participant .pickerTable tbody tr {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 12px 0;
	}

	body.participant .pickerTable td {
		width: auto;
		padding: 0;
		text-align: left;
	}
}
