/* ==========================================================
   FCC Motto-Abstimmung – Abstimmbereich
   Vorlage: Prototyp, Abschnitt #abstimmen.
   Alles unter .fccm .fccm-poll gekapselt. Ausnahmen mit eigenem Präfix:
   .fccm-vbar (fixe Leiste) und .fccm-cf (Konfetti), weil sie direkt im <body> hängen.
   ========================================================== */

.fccm .fccm-poll,
.fccm-vbar {
	--fccm-red: #cb0000;
	--fccm-red-dark: #9c0000;
	--fccm-bg: #f3efec;
	--fccm-ink: #171511;
	--fccm-yellow: #ffc400;
	--fccm-head: "Poppins", system-ui, sans-serif;
	--fccm-body: "Radio Canada", system-ui, sans-serif;
}

.fccm .fccm-poll {
	color: #fff;
	font-family: var(--fccm-body);
}

.fccm .fccm-poll *,
.fccm .fccm-poll *::before,
.fccm .fccm-poll *::after {
	box-sizing: border-box;
}

.fccm .fccm-poll [hidden] {
	display: none !important;
}

.fccm .fccm-sr,
.fccm .fccm-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.fccm .fccm-hp {
	left: -9999px;
}

.fccm .fccm-fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

/* ---------- Karten (Handy zuerst: untereinander) ---------- */
.fccm .fccm-tiles {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin: 0 0 28px;
}

@media (min-width: 800px) {
	.fccm .fccm-tiles {
		grid-template-columns: repeat(3, 1fr);
	}
}

.fccm .fccm-tile {
	position: relative;
	display: block;
	cursor: pointer;
	color: #fff;
	margin: 0;
	padding: 0;
	min-height: 150px;
	overflow: hidden;
	border: 4px solid transparent;
	transition: transform 0.15s, border-color 0.15s;
	-webkit-tap-highlight-color: transparent;
}

@media (min-width: 800px) {
	.fccm .fccm-tile {
		min-height: 170px;
	}
}

.fccm .fccm-tile:hover {
	transform: translateY(-3px);
}

/* Echter Radio-Button, optisch versteckt, aber fokussier- und per Tastatur bedienbar. */
.fccm .fccm-tile input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.fccm .fccm-tile:focus-within {
	outline: 3px solid var(--fccm-yellow);
	outline-offset: 3px;
}

.fccm .fccm-tile-bg {
	position: absolute;
	inset: 0;
}

.fccm .fccm-tile-txt {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	min-height: inherit;
	padding: 72px 22px 22px; /* oben Platz fürs Emoji, damit sich nichts überlappt */
	font-size: 16px;
	line-height: 1.4;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent 70%);
}

.fccm .fccm-tile-txt strong {
	display: block;
	font: 500 26px/1.1 var(--fccm-head);
	margin-bottom: 4px;
}

.fccm .fccm-tile-mark {
	display: none;
	position: absolute;
	z-index: 2;
	top: 12px;
	right: 12px;
	background: var(--fccm-yellow);
	color: var(--fccm-ink);
	font-weight: 700;
	padding: 4px 10px;
	font-size: 14px;
}

.fccm .fccm-tile-emoji {
	position: absolute;
	z-index: 1;
	left: 18px;
	top: 12px;
	font-size: 44px;
	line-height: 1;
	transition: transform 0.3s;
}

.fccm .fccm-tile:hover .fccm-tile-emoji {
	transform: rotate(-12deg) scale(1.2);
}

.fccm .fccm-tile.is-picked {
	border-color: #fff;
	transform: translateY(-4px) scale(1.02);
}

.fccm .fccm-tile.is-picked .fccm-tile-mark {
	display: block;
}

.fccm .fccm-t-weltall .fccm-tile-bg {
	background: radial-gradient(circle at 70% 30%, #6f4bd8 0, #16103f 60%);
}

.fccm .fccm-t-alpen .fccm-tile-bg {
	background: linear-gradient(180deg, #0f2742, #2f6592 70%, #d97a52);
}

.fccm .fccm-t-maerchen .fccm-tile-bg {
	background: linear-gradient(180deg, #14304a, #1d4a3a);
}

/* ---------- Absenden ---------- */
.fccm .fccm-center {
	text-align: center;
}

.fccm .fccm-submit {
	display: inline-block;
	min-height: 56px;
	background: #fff;
	color: var(--fccm-red);
	font: 700 20px var(--fccm-body);
	padding: 18px 40px;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
	transition: transform 0.15s;
}

.fccm .fccm-submit:hover:not(:disabled) {
	transform: translateY(-2px);
}

.fccm .fccm-submit:focus-visible {
	outline: 3px solid var(--fccm-yellow);
	outline-offset: 3px;
}

.fccm .fccm-submit:disabled {
	background: rgba(255, 255, 255, 0.35);
	color: rgba(255, 255, 255, 0.85);
	box-shadow: none;
	cursor: not-allowed;
}

.fccm .fccm-submit[aria-busy="true"] {
	cursor: progress;
}

.fccm .fccm-hint {
	margin: 16px auto 0;
	max-width: 60ch;
	font-size: 15px;
	line-height: 1.5;
	opacity: 0.92;
}

.fccm .fccm-hint a,
.fccm .fccm-noscript a {
	color: #fff;
	text-decoration: underline;
}

.fccm .fccm-poll a:focus-visible {
	outline: 3px solid var(--fccm-yellow);
	outline-offset: 3px;
}

.fccm .fccm-noscript {
	text-align: center;
	font-weight: 600;
}

/* ---------- Rückmeldungen ---------- */
.fccm .fccm-msg {
	background: #fff;
	color: var(--fccm-ink);
	max-width: 700px;
	margin: 0 auto 20px;
	padding: 34px 28px;
	text-align: center;
	border-top: 8px solid var(--fccm-yellow);
	font-size: 17.5px;
	line-height: 1.6;
	animation: fccm-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.fccm .fccm-msg:focus {
	outline: none;
}

.fccm .fccm-msg:focus-visible {
	outline: 3px solid var(--fccm-yellow);
	outline-offset: 3px;
}

.fccm .fccm-poll .fccm-msg .fccm-msg-title {
	color: var(--fccm-red);
	font: 500 clamp(26px, 4.4vw, 42px)/1.15 var(--fccm-head);
	margin: 0 0 10px;
	text-align: center;
}

.fccm .fccm-msg p {
	margin: 0 0 8px;
}

.fccm .fccm-msg a {
	color: var(--fccm-red);
	word-break: break-word;
}

.fccm .fccm-msg-error {
	border-top-color: var(--fccm-ink);
}

@keyframes fccm-pop {
	from {
		transform: scale(0.85);
		opacity: 0;
	}
}

/* Wie im Prototyp: Untertitel der Seite ausblenden, solange nicht abgestimmt werden kann. */
.fccm .fccm-vote:has(.fccm-poll[data-state="early"]) .sub,
.fccm .fccm-vote:has(.fccm-poll[data-state="closed"]) .sub {
	display: none;
}

/* ---------- Fixe Abstimmleiste ---------- */
.fccm-vbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 60;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 16px;
	padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
	background: #171511;
	color: #fff;
	font-family: "Radio Canada", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.4);
	transform: translateY(160%);
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
	visibility: hidden;
}

.fccm-vbar.is-shown {
	transform: none;
	visibility: visible;
}

.fccm-vbar .fccm-vbar-c b {
	color: #ffc400;
}

.fccm-vbar .fccm-vbar-go {
	display: inline-block;
	min-height: 44px;
	font: 600 16px "Radio Canada", system-ui, sans-serif;
	background: #cb0000;
	color: #fff;
	border: 0;
	border-radius: 0;
	padding: 11px 22px;
	cursor: pointer;
	transition: background 0.15s;
}

.fccm-vbar .fccm-vbar-go:hover:not(:disabled) {
	background: #9c0000;
}

.fccm-vbar .fccm-vbar-go:focus-visible {
	outline: 3px solid #ffc400;
	outline-offset: 3px;
}

.fccm-vbar .fccm-vbar-go:disabled {
	background: #9c968c;
	cursor: not-allowed;
}

/* ---------- Konfetti ---------- */
.fccm-cf {
	position: fixed;
	top: -20px;
	width: 10px;
	height: 16px;
	z-index: 100;
	pointer-events: none;
	animation: fccm-fall 2.6s ease-in forwards;
}

@keyframes fccm-fall {
	to {
		transform: translateY(110vh) rotate(720deg);
		opacity: 0.9;
	}
}

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
	.fccm .fccm-poll *,
	.fccm-vbar {
		animation: none !important;
		transition: none !important;
	}
	.fccm .fccm-tile:hover,
	.fccm .fccm-tile.is-picked,
	.fccm .fccm-tile:hover .fccm-tile-emoji {
		transform: none;
	}
	.fccm-cf {
		display: none !important;
	}
}
