/**
 * Unstoppable Voting, Polls & Elections — Frontend Styles
 *
 * Designed for clubs, HOAs, schools, nonprofits, sports orgs — any group that holds formal votes.
 * Themed around brand gold (#f0b849) on neutral grays.
 */

.uvpe-poll {
/**
 * 	--uvpe-brand: #c9e9e6;
 */
        --uvpe-brand: #23408f;
	--uvpe-brand-dark: #d99a2a;
	--uvpe-text: #1d2327;
	--uvpe-muted: #555;
	--uvpe-border: #d8d8d8;
	--uvpe-bg: #fff;
	--uvpe-bg-soft: #fafafa;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
	background: var(--uvpe-bg);
	border: 1px solid var(--uvpe-border);
	border-radius: 8px;
	padding: 20px 24px;
	max-width: 720px;
	margin: 24px auto;
	color: var(--uvpe-text);
	line-height: 1.5;
	box-sizing: border-box;
}

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

/* Shared header */
.uvpe-poll__header {
	margin-bottom: 18px;
}

.uvpe-poll__question {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--uvpe-text);
	line-height: 1.3;
}

.uvpe-poll__description {
	font-size: 14px;
	color: var(--uvpe-muted);
	margin: 0;
}

.uvpe-poll__closed-notice {
	background: #f5f5f5;
	color: var(--uvpe-muted);
	padding: 12px 16px;
	border-radius: 6px;
	text-align: center;
	font-style: italic;
}

.uvpe-poll__total {
	margin-top: 14px;
	font-size: 13px;
	color: var(--uvpe-muted);
	text-align: right;
}

/* Shared form bits */
.uvpe-form__footer {
	margin-top: 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}

/**.uvpe-form__submit {
 *	background: var(--uvpe-brand);
 *	color: #1d1d1f;
 *	border: none;
 *	padding: 11px 22px;
 *	font-size: 15px;
 *	font-weight: 600;
 *	border-radius: 6px;
 *	cursor: pointer;
 *	transition: background 0.15s ease, transform 0.05s ease;
 *}
 **/

.uvpe-form__submit {
	background: var(--uvpe-brand);
	color: #ffffff;
	border: none;
	padding: 11px 22px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
}
 */


.uvpe-form__submit:hover {
	background: var(--uvpe-brand-dark);
}

.uvpe-form__submit:active {
	transform: translateY(1px);
}

.uvpe-form__submit--small {
	padding: 7px 14px;
	font-size: 13px;
}

.uvpe-form__submit[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.uvpe-form__message {
	font-size: 13px;
	color: var(--uvpe-muted);
}

.uvpe-form__message.is-error {
	color: #b32d2e;
}

.uvpe-form__message.is-success {
	color: #2e7d32;
}

.uvpe-form__hint {
	font-size: 13px;
	color: var(--uvpe-muted);
	margin: 10px 0 0;
	font-style: italic;
}

/* ----------------------------------------------------------------------
 * Template: Classic Bars
 * ---------------------------------------------------------------------- */
.uvpe-poll--classic .uvpe-options {
	list-style: none;
	margin: 0;
	padding: 0;
}

.uvpe-poll--classic .uvpe-options__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.uvpe-poll--classic .uvpe-options__label {
	display: flex;
	align-items: center;
	padding: 12px 14px;
	margin-bottom: 8px;
	background: var(--uvpe-bg-soft);
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.uvpe-poll--classic .uvpe-options__label:hover {
	border-color: var(--uvpe-brand);
}

.uvpe-poll--classic .uvpe-options__input {
	margin-right: 10px;
	accent-color: var(--uvpe-brand);
}

.uvpe-poll--classic .uvpe-options__text {
	font-weight: 500;
}

.uvpe-poll--classic .uvpe-options__sub {
	display: block;
	font-size: 12px;
	color: var(--uvpe-muted);
	margin-left: 28px;
	font-weight: 400;
}

.uvpe-results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.uvpe-results__row {
	margin-bottom: 12px;
}

.uvpe-results__label-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 4px;
}

.uvpe-results__name {
	font-weight: 600;
}

.uvpe-results__value {
	font-size: 13px;
	color: var(--uvpe-text);
	font-weight: 600;
}

.uvpe-results__sub {
	color: var(--uvpe-muted);
	font-weight: 400;
}

.uvpe-results__bar {
	background: #f0f0f1;
	border-radius: 10px;
	height: 12px;
	overflow: hidden;
}

.uvpe-results__bar-fill {
	background: var(--uvpe-brand);
	height: 100%;
	transition: width 0.4s ease;
}

.uvpe-results__label {
	color: var(--uvpe-muted);
	font-weight: 400;
}

/* ----------------------------------------------------------------------
 * Template: Official Ballot
 * ---------------------------------------------------------------------- */
.uvpe-poll--ballot {
	background: #fffdf5;
	border: 2px solid #1d1d1f;
}

.uvpe-ballot__header {
	border-bottom: 3px double #1d1d1f;
	padding-bottom: 14px;
	margin-bottom: 18px;
	text-align: center;
}

.uvpe-ballot__badge {
	display: inline-block;
	background: #1d1d1f;
/*	color: var(--uvpe-brand); */
	color: #ffffff; 
	padding: 4px 14px;
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-weight: 700;
	border-radius: 2px;
	margin-bottom: 10px;
}

.uvpe-ballot__question {
	font-size: 22px;
	font-weight: 700;
	margin: 0;
}

.uvpe-ballot__description {
	font-size: 14px;
	color: var(--uvpe-muted);
	margin: 6px 0 0;
}

.uvpe-ballot__instruction {
	font-style: italic;
	color: var(--uvpe-muted);
	margin: 0 0 12px;
}

.uvpe-ballot__options {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: ballot;
}

.uvpe-ballot__option {
	border: 1px solid var(--uvpe-border);
	margin-bottom: 6px;
	background: #fff;
}

.uvpe-ballot__option-label {
	display: flex;
	align-items: center;
	padding: 12px 14px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.uvpe-ballot__option-label:hover {
	background: #fffbf0;
}

.uvpe-ballot__option-number {
	font-weight: 700;
	color: #1d1d1f;
	font-size: 16px;
	min-width: 28px;
}

.uvpe-ballot__option-input {
	margin: 0 12px 0 4px;
	accent-color: var(--uvpe-brand);
	transform: scale(1.2);
}

.uvpe-ballot__option-text {
	display: flex;
	flex-direction: column;
}

.uvpe-ballot__option-name {
	font-weight: 600;
	font-size: 15px;
}

.uvpe-ballot__option-sub {
	font-size: 12px;
	color: var(--uvpe-muted);
	margin-top: 2px;
}

.uvpe-ballot__results-title {
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 1px solid var(--uvpe-border);
	padding-bottom: 8px;
	margin: 0 0 12px;
}

.uvpe-ballot__results-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.uvpe-ballot__results-row {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	margin-bottom: 4px;
	background: #fff;
	border: 1px solid var(--uvpe-border);
}

.uvpe-ballot__results-row.is-leader {
	background: #fffbe6;
	border-color: var(--uvpe-brand);
}

.uvpe-ballot__results-row.is-leader::before {
	content: "🏆";
	position: absolute;
	margin-left: -38px;
}

.uvpe-ballot__results-rank {
	font-weight: 700;
	font-size: 18px;
	text-align: center;
}

.uvpe-ballot__results-name {
	font-weight: 600;
}

.uvpe-ballot__results-value {
	font-weight: 700;
	color: var(--uvpe-text);
}

/* ----------------------------------------------------------------------
 * Template: Candidate Cards
 * ---------------------------------------------------------------------- */
.uvpe-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 14px;
}

.uvpe-card {
	position: relative;
	background: #fff;
	border: 2px solid var(--uvpe-border);
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.15s ease, transform 0.1s ease;
	display: flex;
	flex-direction: column;
}

.uvpe-card--selectable:hover {
	border-color: var(--uvpe-brand);
	transform: translateY(-2px);
}

.uvpe-card--result {
	cursor: default;
}

.uvpe-card__input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.uvpe-card__input:checked ~ .uvpe-card__check {
	background: var(--uvpe-brand);
	border-color: var(--uvpe-brand);
}

.uvpe-card__input:checked ~ .uvpe-card__check::after {
	content: "✓";
	color: #fff;
	font-weight: 700;
	font-size: 14px;
}

.uvpe-card:has(.uvpe-card__input:checked) {
	border-color: var(--uvpe-brand);
	background: #fffbf0;
}

.uvpe-card__image {
	width: 100%;
	aspect-ratio: 1 / 1;
	background-size: cover;
	background-position: center;
	background-color: #f5f5f5;
}

.uvpe-card__image--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--uvpe-brand), var(--uvpe-brand-dark));
	color: #fff;
	font-size: 42px;
	font-weight: 700;
}

.uvpe-card__body {
	padding: 10px 12px 12px;
}

.uvpe-card__name {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 2px;
}

.uvpe-card__sub {
	font-size: 12px;
	color: var(--uvpe-muted);
	margin: 0;
}

.uvpe-card__bar {
	background: #f0f0f1;
	border-radius: 8px;
	height: 8px;
	margin-top: 10px;
	overflow: hidden;
}

.uvpe-card__bar-fill {
	background: var(--uvpe-brand);
	height: 100%;
	transition: width 0.4s ease;
}

.uvpe-card__result {
	margin: 6px 0 0;
	font-size: 13px;
	font-weight: 600;
}

.uvpe-card__check {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 22px;
	height: 22px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

/* ----------------------------------------------------------------------
 * Template: Compact
 * ---------------------------------------------------------------------- */
.uvpe-poll--compact {
	padding: 14px 16px;
	max-width: 360px;
	font-size: 14px;
}

.uvpe-poll__question--compact {
	font-size: 15px;
	margin-bottom: 10px;
}

.uvpe-compact__options {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.uvpe-compact__options li {
	margin: 0;
	padding: 4px 0;
}

.uvpe-compact__label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 14px;
}

.uvpe-compact__label input {
	accent-color: var(--uvpe-brand);
}

.uvpe-compact__results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.uvpe-compact__result-row {
	display: grid;
	grid-template-columns: 1fr 60px auto;
	gap: 8px;
	align-items: center;
	font-size: 13px;
	padding: 4px 0;
}

.uvpe-compact__result-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.uvpe-compact__result-bar {
	background: #f0f0f1;
	border-radius: 6px;
	height: 6px;
	overflow: hidden;
}

.uvpe-compact__result-fill {
	background: var(--uvpe-brand);
	height: 100%;
	display: block;
}

.uvpe-compact__result-value {
	font-size: 12px;
	font-weight: 600;
	color: var(--uvpe-muted);
}

.uvpe-poll__total--compact {
	font-size: 12px;
}

/* ----------------------------------------------------------------------
 * Template: Tournament
 * ---------------------------------------------------------------------- */
.uvpe-poll--tournament {
	background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.uvpe-poll__header--tournament {
	text-align: center;
	border-bottom: 2px solid var(--uvpe-brand);
	padding-bottom: 14px;
}

.uvpe-tournament__badge {
	display: inline-block;
	background: var(--uvpe-brand);
	color: #1d1d1f;
	padding: 3px 12px;
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-weight: 700;
	border-radius: 12px;
	margin-bottom: 8px;
}

.uvpe-tournament__bracket {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.uvpe-tournament__matchup {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 10px;
	align-items: center;
	background: #fff;
	border: 1px solid var(--uvpe-border);
	border-radius: 8px;
	padding: 12px;
}

.uvpe-tournament__side {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 6px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.uvpe-tournament__side:hover {
	border-color: var(--uvpe-brand);
}

.uvpe-tournament__side:has(.uvpe-tournament__input:checked) {
	background: #fffbf0;
	border-color: var(--uvpe-brand);
}

.uvpe-tournament__input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.uvpe-tournament__side-logo {
	width: 44px;
	height: 44px;
	border-radius: 6px;
	background-size: cover;
	background-position: center;
	background-color: #f0f0f1;
	flex-shrink: 0;
}

.uvpe-tournament__side-logo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--uvpe-brand), var(--uvpe-brand-dark));
	color: #fff;
	font-weight: 700;
	font-size: 18px;
}

.uvpe-tournament__side-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.uvpe-tournament__side-name {
	font-weight: 700;
	font-size: 14px;
}

.uvpe-tournament__side-sub {
	font-size: 11px;
	color: var(--uvpe-muted);
	margin-top: 2px;
}

.uvpe-tournament__vs {
	font-weight: 700;
	color: var(--uvpe-brand-dark);
	font-style: italic;
	font-size: 14px;
}

/* Tournament results */
.uvpe-tournament__results {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.uvpe-tournament__row {
	display: grid;
	grid-template-columns: 40px 44px 1fr 1fr 70px;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid var(--uvpe-border);
	border-radius: 6px;
}

.uvpe-tournament__row.is-winner {
	background: #fffbe6;
	border-color: var(--uvpe-brand);
}

.uvpe-tournament__seed {
	font-weight: 700;
	color: var(--uvpe-brand-dark);
}

.uvpe-tournament__logo {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	background-size: cover;
	background-position: center;
	background-color: #f0f0f1;
}

.uvpe-tournament__name {
	font-weight: 600;
}

.uvpe-tournament__bar {
	background: #f0f0f1;
	border-radius: 6px;
	height: 8px;
	overflow: hidden;
}

.uvpe-tournament__fill {
	background: var(--uvpe-brand);
	height: 100%;
	display: block;
}

.uvpe-tournament__value {
	font-size: 13px;
	font-weight: 700;
	text-align: right;
}

@media (max-width: 600px) {
	.uvpe-tournament__matchup {
		grid-template-columns: 1fr;
	}
	.uvpe-tournament__vs {
		text-align: center;
	}
	.uvpe-tournament__row {
		grid-template-columns: 30px 36px 1fr 60px;
	}
	.uvpe-tournament__row .uvpe-tournament__bar {
		display: none;
	}
}
