/* Ridges Voice — front-end + admin styles */

:root {
	--rv-navy: #14304d;
	--rv-navy-deep: #0d2238;
	--rv-accent: #1f7a5a;       /* civic green */
	--rv-accent-hover: #176046;
	--rv-bg: #eef2f6;
	--rv-card: #ffffff;
	--rv-text: #1c2833;
	--rv-muted: #5b6b7a;
	--rv-border: #c9d4de;
	--rv-error: #b3261e;
	--rv-success: #1f7a5a;
	--rv-radius: 10px;
}

.rv-wrap {
	max-width: 760px;
	margin: 0 auto 48px;
	padding: 0 16px;
	color: var(--rv-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5;
}

/* Header */
.rv-header {
	background: linear-gradient(135deg, var(--rv-navy), var(--rv-navy-deep));
	color: #fff;
	border-radius: var(--rv-radius);
	padding: 32px 28px;
	margin: 28px 0 24px;
	text-align: center;
	box-shadow: 0 6px 18px rgba(13, 34, 56, 0.18);
}
.rv-header h1 {
	margin: 0;
	font-size: 28px;
	line-height: 1.25;
	font-weight: 700;
	color: #fff;
}

/* Eligibility notice (residents-only warning) */
.rv-eligibility {
	margin: 0 0 24px;
	padding: 14px 18px;
	background: #fdecea;
	border: 1px solid #f0c4c1;
	border-left: 5px solid var(--rv-error);
	border-radius: 8px;
	color: var(--rv-error);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.4;
	text-align: center;
}

/* Live vote counter banner */
.rv-count-banner {
	background: var(--rv-accent);
	background: linear-gradient(135deg, var(--rv-accent), var(--rv-accent-hover));
	color: #fff;
	border-radius: var(--rv-radius);
	padding: 18px 24px;
	margin: 0 0 24px;
	text-align: center;
	box-shadow: 0 4px 14px rgba(31, 122, 90, 0.22);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}
.rv-count-number {
	font-size: 46px;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.5px;
	font-variant-numeric: tabular-nums;
}
.rv-count-label {
	font-size: 15px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	opacity: 0.92;
}
@media (max-width: 560px) {
	.rv-count-number { font-size: 38px; }
}

/* Intro Letter link */
.rv-doc-link {
	margin: 0 0 24px;
	text-align: center;
}
.rv-doc-link a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 24px;
	background: var(--rv-navy);
	border: 2px solid var(--rv-navy-deep);
	border-radius: 999px;
	color: #ffd24a;
	font-weight: 700;
	font-size: 17px;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(13, 34, 56, 0.22);
	transition: background .15s, box-shadow .15s, transform .05s;
}
.rv-doc-link a:hover {
	background: var(--rv-navy-deep);
	box-shadow: 0 6px 16px rgba(13, 34, 56, 0.30);
}
.rv-doc-link a:active { transform: translateY(1px); }
.rv-doc-icon { font-size: 19px; line-height: 1; }

/* Main card */
.rv-main {
	background: var(--rv-card);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	padding: 28px;
	box-shadow: 0 2px 10px rgba(28, 40, 51, 0.06);
}

/* Intro / instruction line */
.rv-intro {
	margin: 0 0 22px;
	font-size: 17px;
	line-height: 1.45;
	color: var(--rv-muted);
	text-align: center;
}

/* Fields */
.rv-field { margin-bottom: 18px; }
.rv-field label {
	display: block;
	font-weight: 600;
	font-size: 15px;
	margin-bottom: 6px;
	color: var(--rv-text);
}
.rv-field-check label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rv-field-check input[type="checkbox"] { width: auto; }
.rv-help { display: block; margin-top: 6px; font-size: 13px; color: var(--rv-muted); }
.rv-req { color: var(--rv-error); }
.rv-optional { color: var(--rv-muted); font-weight: 400; font-size: 13px; }

.rv-field input[type="text"],
.rv-field input[type="email"],
.rv-field input[type="password"],
.rv-field select,
.rv-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	font-size: 16px;
	color: var(--rv-text);
	background: #fff;
	border: 1px solid var(--rv-border);
	border-radius: 8px;
	transition: border-color .15s, box-shadow .15s;
}
.rv-field input:focus,
.rv-field select:focus,
.rv-field textarea:focus {
	outline: none;
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.18);
}
.rv-field textarea { resize: vertical; }

.rv-counter {
	margin-top: 5px;
	font-size: 13px;
	color: var(--rv-muted);
	text-align: right;
}

/* Rows */
.rv-row { display: flex; gap: 16px; }
.rv-row .rv-field { flex: 1; }

.rv-row-csz .rv-field-city { flex: 3; }
.rv-row-csz .rv-field-state { flex: 1; }
.rv-row-csz .rv-field-zip { flex: 1.4; }

@media (max-width: 560px) {
	.rv-row { flex-direction: column; gap: 0; }
	.rv-header h1 { font-size: 22px; }
}

/* Footer / vote button */
.rv-footer {
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid var(--rv-border);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}
.rv-recaptcha { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.rv-vote-button {
	display: block;
	width: 100%;
	max-width: 480px;
	padding: 18px 24px;
	font-size: 20px;
	font-weight: 700;
	color: #fff;
	background: var(--rv-accent);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(31, 122, 90, 0.28);
	transition: background .15s, transform .05s;
}
.rv-vote-button:hover { background: var(--rv-accent-hover); }
.rv-vote-button:active { transform: translateY(1px); }
.rv-vote-button:disabled,
.rv-vote-button.rv-disabled {
	background: #9aa7b1;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}
.rv-admin-button { max-width: 280px; }

/* Notices */
.rv-notice {
	padding: 14px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 16px;
}
.rv-notice-success { background: #e7f4ee; border: 1px solid #b9e0cd; color: var(--rv-success); }
.rv-notice-error { background: #fae9e8; border: 1px solid #f0c4c1; color: var(--rv-error); }
.rv-error { display: block; color: var(--rv-error); font-size: 14px; margin-top: 5px; }

/* Admin */
.rv-admin-header { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.rv-admin-header h1 { font-size: 22px; }
.rv-logout { color: #cfe0ef; font-size: 14px; text-decoration: underline; }
.rv-admin-section { margin-bottom: 34px; }
.rv-admin-section h2 { font-size: 19px; margin: 0 0 14px; color: var(--rv-navy); }
.rv-admin-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rv-export {
	background: var(--rv-navy);
	color: #fff;
	padding: 9px 16px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}
.rv-export:hover { background: var(--rv-navy-deep); color: #fff; }

/* Table */
.rv-table-scroll { overflow-x: auto; border: 1px solid var(--rv-border); border-radius: 8px; }
.rv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rv-table th, .rv-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rv-border); white-space: nowrap; }
.rv-table th { background: #f3f6f9; color: var(--rv-navy); font-weight: 700; position: sticky; top: 0; }
.rv-table tbody tr:nth-child(even) { background: #f8fafc; }
.rv-table td { vertical-align: top; }
.rv-empty { text-align: center; color: var(--rv-muted); padding: 24px; white-space: normal; }

/* Delete controls */
.rv-inline-form { margin: 0; display: inline; }
.rv-delete-btn {
	background: transparent;
	border: 1px solid var(--rv-error);
	color: var(--rv-error);
	padding: 5px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.rv-delete-btn:hover { background: var(--rv-error); color: #fff; }

.rv-danger-zone { margin-top: 18px; text-align: right; }
.rv-clear-btn {
	background: var(--rv-error);
	border: none;
	color: #fff;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(179, 38, 30, 0.25);
	transition: background .15s;
}
.rv-clear-btn:hover { background: #8f1e17; }

/* -------------------------------------------------------------------------
 * Voting closed: dim the form, disable the controls, lay a message over it.
 * ---------------------------------------------------------------------- */
.rv-form-area { position: relative; }

.rv-closed .rv-form-inner {
	opacity: 0.32;
	filter: grayscale(85%);
	pointer-events: none;
	user-select: none;
}

.rv-closed-overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 0 8px;
	pointer-events: none;
}

.rv-closed-message {
	position: sticky;
	top: 24px;
	margin: 0;
	max-width: 460px;
	padding: 20px 26px;
	background: linear-gradient(135deg, var(--rv-navy), var(--rv-navy-deep));
	border: 2px solid var(--rv-navy-deep);
	border-radius: var(--rv-radius);
	box-shadow: 0 8px 26px rgba(13, 34, 56, 0.32);
	color: #fff;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
}

@media (max-width: 560px) {
	.rv-closed-message { font-size: 17px; padding: 16px 18px; }
}
