/**
 * FIT Plan Studio - internal composer tool.
 * Two-column layout: inputs left, live preview + copy block right.
 * The previewed card carries its own plan-boxes.css classes; the overrides at
 * the bottom just size a single corporate card sensibly inside the preview.
 */

body.page-template-page_plan-studio .content,
body.page-template-page_plan-studio-php .content {
	max-width: none;
	width: 100%;
}

.plan-studio {
	max-width: min(1680px, 95vw);
	margin-left: auto;
	margin-right: auto;
	padding: 32px 24px 64px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
}

.plan-studio-header {
	margin-bottom: 28px;
}

.plan-studio-header h1 {
	font-size: 30px;
	margin: 0 0 8px;
}

.plan-studio-intro {
	margin: 0;
	color: #555;
	max-width: 760px;
	line-height: 1.5;
}

.plan-studio code {
	background: #f0f0f2;
	padding: 1px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}

.plan-studio-layout {
	display: grid;
	/* Fixed preview column wide enough for a real ~408px location card so the
	   preview never squeezes the card narrower than production; the form takes
	   the remaining space. Stacks to one column under 900px (see media query). */
	grid-template-columns: minmax(0, 1fr) 448px;
	gap: 40px;
	align-items: start;
}

/* ---- Inputs -------------------------------------------------------------- */
.plan-studio-section {
	background: #fff;
	border: 1px solid #e2e2e6;
	border-radius: 10px;
	padding: 24px;
	margin-bottom: 24px;
}

.plan-studio-section h2 {
	font-size: 18px;
	margin: 0 0 4px;
}

.plan-studio-section-note {
	margin: 0 0 18px;
	font-size: 13px;
	color: #777;
	line-height: 1.45;
}

.ps-field {
	margin-bottom: 16px;
}

.ps-field > label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 6px;
}

.ps-field input[type="text"],
.ps-field input[type="number"],
.ps-field select,
.ps-field textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #cfcfd6;
	border-radius: 7px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color: #1a1a1a;
}

.plan-studio-inputs .ps-field input[type="text"],
.plan-studio-inputs .ps-field input[type="number"],
.plan-studio-inputs .ps-field select {
	max-width: 560px;
}

.ps-field textarea {
	resize: vertical;
	min-height: 64px;
}

.ps-field input:focus,
.ps-field select:focus,
.ps-field textarea:focus {
	outline: none;
	border-color: #d1202f;
	box-shadow: 0 0 0 3px rgba(209, 32, 47, 0.12);
}

.ps-hint {
	display: block;
	margin-top: 5px;
	font-size: 12px;
	color: #8a8a92;
	line-height: 1.4;
}

/* Toggle (bool) */
.ps-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}

.ps-toggle input {
	width: 18px;
	height: 18px;
	accent-color: #d1202f;
}

/* Repeaters (include / exclude) */
.ps-repeater-rows {
	margin-bottom: 8px;
}

.ps-repeater-row {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.ps-repeater-row .ps-repeater-input {
	flex: 1 1 auto;
	min-width: 0;
	box-sizing: border-box;
	border: 1px solid #cfcfd6;
	border-radius: 7px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
}

.ps-repeater-row .ps-repeater-input:focus {
	outline: none;
	border-color: #d1202f;
	box-shadow: 0 0 0 3px rgba(209, 32, 47, 0.12);
}

.ps-repeater-row .ps-row-up,
.ps-repeater-row .ps-row-down,
.ps-repeater-row .ps-row-remove {
	flex: 0 0 auto;
	width: 36px;
	min-width: 36px;
	height: 40px;
	padding: 0;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #cfcfd6;
	background: #f6f6f8;
	border-radius: 7px;
	line-height: 1;
	color: #777;
	cursor: pointer;
}

.ps-row-up,
.ps-row-down {
	font-size: 13px;
}

.ps-row-remove {
	font-size: 20px;
}

.ps-row-up:hover,
.ps-row-down:hover,
.ps-row-remove:hover {
	background: #efe0e1;
	color: #d1202f;
	border-color: #e0b8bc;
}

.ps-row-add {
	border: 1px dashed #c3c3cc;
	background: #fafafb;
	border-radius: 7px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #444;
	cursor: pointer;
}

.ps-row-add:hover {
	border-color: #d1202f;
	color: #d1202f;
}

/* ---- Output -------------------------------------------------------------- */
.plan-studio-output {
	position: sticky;
	top: 20px;
}

.plan-studio-preview-wrap h2,
.plan-studio-copy-wrap h2 {
	font-size: 18px;
	margin: 0 0 12px;
}

.plan-studio-preview {
	background: #f6f6f8;
	border: 1px solid #e2e2e6;
	border-radius: 10px;
	padding: 28px;
	margin-bottom: 28px;
}

.ps-preview-placeholder {
	margin: 0;
	color: #9a9aa2;
	text-align: center;
	padding: 40px 0;
}

.plan-studio-copy-wrap {
	background: #fff;
	border: 1px solid #e2e2e6;
	border-radius: 10px;
	padding: 24px;
}

.ps-copy-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ps-copy-btn {
	border: none;
	background: #d1202f;
	color: #fff;
	border-radius: 7px;
	padding: 8px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ps-copy-btn:hover {
	background: #b31a27;
}

.ps-copy-btn.is-copied {
	background: #2e8b57;
}

.plan-studio-copy-box {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #cfcfd6;
	border-radius: 7px;
	padding: 12px 14px;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
	font-size: 13px;
	line-height: 1.55;
	background: #fbfbfc;
	color: #1a1a1a;
	resize: vertical;
}

/* Single-card sizing: keep the card's internal plan-boxes.css styling (all
   scoped under .membership-plans .plan-box) while rendering one card at a
   natural width instead of a one-third flex column. */
.plan-studio-preview.membership-plans {
	display: block;
}

.plan-studio-preview.membership-plans .plan-box {
	flex-basis: auto;
	/* Render at the real location-card width (~408px border-box) so the preview's
	   wrapping and layout match production exactly; shrink only on narrow screens. */
	width: 408px;
	max-width: 100%;
	margin: 0 auto;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
	.plan-studio-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.plan-studio-output {
		position: static;
	}
}
