/*
 * Route `vote` — the consent + details form.
 *
 * Every value here is the one in `/tmp/pca/pca-web/vote-now.html`'s <style>
 * block (including its 560px breakpoint); only three things were translated:
 *
 * 1. raw hex -> semantic tokens, so dark mode needs no duplicate rules
 *    (#3a4b6b -> --muted, #cfd9ea / #d7e2f0 -> --field-border, --white ->
 *    --card-bg, --ink -> --body-ink, --navy-deep as a *heading* colour ->
 *    --heading-ink; --navy-deep survives where it is the brand fill);
 * 2. physical offsets -> logical properties, so the card mirrors in RTL;
 * 3. `direction: rtl` on `.ar` is applied only to a node that arrives without
 *    a `dir` attribute. `.ar` is a *slot* here, not a language: the templates
 *    put whichever language is secondary into it and stamp the real direction
 *    with `Lang::dir_for()`, so forcing RTL in CSS would mis-shape the English
 *    sub-line that appears while the page itself is Arabic.
 *
 * Shared pieces are deliberately absent: `.pca-empty`, `.pca-form-message` and
 * `.pca-hp-field` come from public.css and are only positioned here.
 */

/* ==========================================================================
   1. Section and card
   ========================================================================== */

.vote-section {
	padding: 16px 0 44px;
}

.vote-card {
	max-width: 660px;
	margin-inline: auto;
	border: 2px solid var(--navy-deep);
	border-radius: var(--radius);
	background: var(--card-bg);
	padding: 36px 34px 40px;
	box-shadow: var(--shadow);
}

.vote-card .ar:not([dir]) {
	direction: rtl;
}

/* ==========================================================================
   2. Welcome block
   ========================================================================== */

.vote-welcome {
	text-align: center;
	margin-bottom: 10px;
}

.section-heading-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.section-heading-row h3 {
	font-size: clamp(20px, 3vw, 30px);
	font-weight: 900;
	color: var(--heading-ink);
	margin: 0;
}

.section-heading-row .ar {
	font-size: clamp(17px, 2.6vw, 24px);
	font-weight: 800;
	color: var(--blue-bright);
}

.vote-welcome p.sub {
	text-align: center;
	color: var(--muted);
	font-size: 14.5px;
	margin: 10px 0 28px;
	line-height: 1.6;
}

.vote-welcome p.sub .ar {
	display: block;
	color: var(--blue-bright);
	font-weight: 700;
	margin-top: 4px;
}

/* ==========================================================================
   3. Disclaimer
   ========================================================================== */

.disclaimer-box {
	background: var(--blue-pale);
	border-radius: 14px;
	padding: 18px 20px;
	font-size: 13px;
	line-height: 1.65;
	color: var(--body-ink);
	margin-bottom: 24px;
	text-align: start;
}

.disclaimer-box strong {
	color: var(--heading-ink);
}

/* The Arabic (or English) sub-line is a sibling span, not inline copy. */
.disclaimer-box .ar {
	display: block;
	margin-top: 6px;
	color: var(--muted);
}

/* ==========================================================================
   4. Form
   ========================================================================== */

.vote-form {
	margin: 0;
	text-align: start;
}

.consent-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 30px;
	padding: 14px 16px;
	border: 1.5px solid var(--field-border);
	border-radius: 12px;
	background: var(--body-bg);
}

.consent-row input[type='checkbox'] {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	flex: 0 0 auto;
	accent-color: var(--navy-deep);
}

.consent-row label {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--body-ink);
}

.consent-row label .ar {
	display: block;
	color: var(--muted);
	margin-top: 5px;
	font-size: 13px;
}

.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 16px;
}

.form-grid .field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-grid .field.full {
	grid-column: 1 / -1;
}

.form-grid .field label {
	font-size: 12.5px;
	font-weight: 800;
	color: var(--heading-ink);
}

.form-grid .field label .ar {
	font-weight: 700;
	color: var(--blue-bright);
	margin-inline-start: 8px;
	font-size: 12px;
}

.form-grid .field input {
	border: 1.8px solid var(--field-border);
	border-radius: 10px;
	padding: 13px 14px;
	font-family: inherit;
	font-size: 14.5px;
	color: var(--body-ink);
	/* The prototype relies on the browser's white input default, which does not
	   survive dark mode — the token is the same colour in light mode. */
	background: var(--field-bg);
	width: 100%;
	transition: border-color 0.15s ease;
}

.form-grid .field input:focus {
	outline: none;
	border-color: var(--blue-bright);
}

/* A field the server rejected, flagged by assets/js/pages/vote.js. */
.form-grid .field.has-error input {
	border-color: #c62828;
}

/* ==========================================================================
   5. Submit / resume button
   The base rules live in public.css: this button also renders on the review
   screen, which loads its own page stylesheet and not this one — so keeping
   them here left it unstyled there.
   ========================================================================== */

/* ==========================================================================
   6. Resume and closed panels
   ========================================================================== */

.vote-continue {
	text-align: center;
	padding: 6px 0 0;
}

.vote-continue-title {
	font-size: clamp(18px, 2.6vw, 22px);
	font-weight: 900;
	color: var(--heading-ink);
	margin: 0;
}

.vote-continue-sub {
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--muted);
	margin: 8px 0 22px;
}

.vote-continue-sub .ar {
	display: block;
	color: var(--blue-bright);
	font-weight: 700;
	margin-top: 4px;
}

.vote-closed {
	padding: 34px 24px;
}

.vote-closed .btn {
	margin-top: 18px;
}

/* ==========================================================================
   7. Mobile
   ========================================================================== */

@media (max-width: 560px) {
	.form-grid {
		grid-template-columns: 1fr;
	}

	.vote-card {
		padding: 28px 20px 30px;
	}
}
