/**
 * VLINZZA Proposal Questionnaire — component styles.
 *
 * RTL-first (the component always renders dir="rtl"), mobile-first responsive,
 * no color-only state signaling (selected/error states also change border,
 * weight and an icon-equivalent check), visible focus rings, minimum 44px
 * touch targets. Loaded only when the block/shortcode actually renders
 * (brief §44 — no global CSS).
 */

.vlzpf {
	--vlzpf-accent: #1a4d8f;
	--vlzpf-accent-contrast: #ffffff;
	--vlzpf-border: #d8dee6;
	--vlzpf-error: #b3261e;
	--vlzpf-text: #1b1f24;
	--vlzpf-muted: #5b6470;
	--vlzpf-bg-card: #ffffff;
	--vlzpf-radius: 12px;
	max-width: 880px;
	margin-inline: auto;
	font-size: 16px;
	color: var( --vlzpf-text );
	text-align: right;
}

.vlzpf * {
	box-sizing: border-box;
}

.vlzpf-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
}

.vlzpf-progress-wrap {
	margin-block-end: 14px;
}

/* The visible "سؤال X من Y" step counter was removed by Owner decision
   (PROPOSAL-FORM-FINAL-LAYOUT-CORRECTION-AND-OWNER-UX-CLEANUP.md §14).
   Only the progress BAR remains visible; the same step/count text is still
   announced to assistive tech through the component's aria-live region
   (.vlzpf-visually-hidden), so nothing was lost for screen-reader users. */

.vlzpf-progress {
	height: 6px;
	background: var( --vlzpf-border );
	border-radius: 999px;
	overflow: hidden;
}

.vlzpf-progress-bar {
	height: 100%;
	background: var( --vlzpf-accent );
	transition: width 0.25s ease;
	width: 0%;
}

.vlzpf-panel {
	background: var( --vlzpf-bg-card );
	border: 1px solid var( --vlzpf-border );
	border-radius: var( --vlzpf-radius );
	padding: 26px 28px;
	box-shadow: 0 8px 22px rgba( 16, 27, 43, 0.08 ), 0 2px 5px rgba( 16, 27, 43, 0.05 );
}

@media ( max-width: 480px ) {
	.vlzpf-panel {
		padding: 18px 16px;
		border-radius: 10px;
	}
}

.vlzpf-heading {
	font-size: 1.2rem;
	line-height: 1.45;
	margin: 0 0 14px;
	outline: none; /* focused programmatically for step announcement, not via a visible browser outline */
}

.vlzpf-hint {
	margin: -8px 0 12px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var( --vlzpf-accent );
}

/* VERTICAL STACK ONLY — Owner-fixed rule (PROPOSAL-FORM-CLEAN-REBUILD-FROM-APPROVED-REFERENCE-CONTRACT.md
   §10–§14). Every choice-based question (single- or multi-select) renders as
   full-width rows stacked one below another at every breakpoint — never a
   grid, never side-by-side cards. This single rule replaces the prior
   3-column Desktop / 2-column Mobile `display:grid` layout for good; do not
   reintroduce a `grid-template-columns` rule here. */
.vlzpf-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vlzpf-card {
	appearance: none;
	width: 100%;
	background: #fff;
	border: 2px solid var( --vlzpf-border );
	border-radius: 10px;
	padding: 11px 16px;
	min-height: 46px;
	display: flex;
	align-items: center;
	font: inherit;
	font-size: 0.98rem;
	line-height: 1.4;
	text-align: right;
	cursor: pointer;
	color: var( --vlzpf-text );
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.vlzpf-card:hover {
	border-color: var( --vlzpf-accent );
	box-shadow: 0 4px 10px rgba( 16, 27, 43, 0.08 );
}

.vlzpf-card.is-selected {
	border-color: var( --vlzpf-accent );
	border-width: 2px;
	font-weight: 700;
	background: color-mix( in srgb, var( --vlzpf-accent ) 8%, #fff );
	box-shadow: 0 0 0 3px color-mix( in srgb, var( --vlzpf-accent ) 18%, transparent );
}

.vlzpf-card:focus-visible,
.vlzpf-btn:focus-visible,
.vlzpf-option input:focus-visible,
.vlzpf-textarea:focus-visible,
.vlzpf-field input:focus-visible,
.vlzpf-field select:focus-visible {
	outline: 3px solid #0b5fff;
	outline-offset: 2px;
}

.vlzpf-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vlzpf-option {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var( --vlzpf-border );
	border-radius: 10px;
	padding: 9px 14px;
	min-height: 44px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.vlzpf-option:hover {
	border-color: var( --vlzpf-accent );
}

.vlzpf-option:has( input:checked ) {
	border-color: var( --vlzpf-accent );
	border-width: 2px;
	font-weight: 600;
	background: color-mix( in srgb, var( --vlzpf-accent ) 6%, #fff );
}

.vlzpf-option input {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	accent-color: var( --vlzpf-accent );
}

.vlzpf-textarea,
.vlzpf-field input,
.vlzpf-field select {
	width: 100%;
	font: inherit;
	padding: 10px 14px;
	min-height: 44px;
	border: 1px solid var( --vlzpf-border );
	border-radius: 10px;
	background: #fff;
	color: var( --vlzpf-text );
	transition: border-color 0.15s ease;
}

.vlzpf-textarea:focus,
.vlzpf-field input:focus,
.vlzpf-field select:focus {
	border-color: var( --vlzpf-accent );
}

textarea.vlzpf-textarea {
	min-height: 88px;
	resize: vertical;
}

.vlzpf-field {
	margin-block-end: 12px;
}

.vlzpf-field label {
	display: block;
	margin-block-end: 6px;
	font-weight: 600;
}

.vlzpf-error {
	color: var( --vlzpf-error );
	font-size: 0.9rem;
	margin: 8px 0 0;
	font-weight: 600;
}

.vlzpf-error::before {
	content: '⚠ ';
}

.vlzpf-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 18px;
}

.vlzpf-btn {
	appearance: none;
	border: none;
	/* Medium radius, not a full pill — Owner rule §19, kept consistent with the
	   choice rows and fields above. */
	border-radius: 10px;
	padding: 11px 24px;
	min-height: 44px;
	font: inherit;
	font-size: 0.98rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

/* GeneratePress styles `button:hover, button:focus` (specificity 0,1,1),
   which outranks the single-class .vlzpf-btn-next rule above — the primary
   button reverted to the theme grey whenever it held focus (e.g. straight
   after a failed "Next" click, and on every keyboard tab-stop). These
   two-class state rules take the cascade back for this component only. */
.vlzpf-btn-next:hover:not(:disabled),
.vlzpf-btn-next:focus,
.vlzpf-btn-next:focus-visible {
	background: color-mix( in srgb, var( --vlzpf-accent ) 88%, #000 );
	color: var( --vlzpf-accent-contrast );
}

.vlzpf-btn-next:hover:not(:disabled) {
	transform: translateY( -1px );
}

.vlzpf-btn-back:hover:not(:disabled),
.vlzpf-btn-back:focus,
.vlzpf-btn-back:focus-visible {
	color: var( --vlzpf-text );
	border-color: var( --vlzpf-accent );
}

.vlzpf-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.vlzpf-btn-next {
	background: var( --vlzpf-accent );
	color: var( --vlzpf-accent-contrast );
	margin-inline-start: auto;
}

.vlzpf-btn-back {
	background: transparent;
	color: var( --vlzpf-muted );
	border: 1px solid var( --vlzpf-border );
}

.vlzpf-success {
	text-align: center;
}

.vlzpf-noscript {
	padding: 16px;
	border: 1px solid var( --vlzpf-border );
	border-radius: 8px;
}

.vlzpf-editor-placeholder {
	padding: 24px;
	border: 2px dashed var( --vlzpf-border, #d8dee6 );
	border-radius: 8px;
	text-align: center;
}
