/**
 * Board Results - front-end styles.
 * Light, clean, elegant. All colors come from CSS variables set inline
 * on .br-app so the admin color picker controls everything.
 */

.br-app {
	--br-primary: #1f6feb;
	--br-accent: #0d9488;
	--br-header: #ffffff;
	--br-surface: #ffffff;
	--br-bg: #f5f7fb;
	--br-text: #1f2933;
	--br-muted: #64748b;
	--br-radius: 14px;
	--br-border: rgba(15, 23, 42, 0.08);
	--br-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 30px rgba(15, 23, 42, 0.06);
	--br-maxwidth: 760px;

	box-sizing: border-box;
	width: 100%;
	max-width: var(--br-maxwidth, 760px);
	margin: 0 auto;
	padding: 0;
	background: var(--br-bg);
	color: var(--br-text);
	border-radius: var(--br-radius);
	overflow: hidden;
	border: 1px solid var(--br-border);
	box-shadow: var(--br-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Bengali", sans-serif;
	line-height: 1.5;
}

.br-app *,
.br-app *::before,
.br-app *::after {
	box-sizing: border-box;
}

/* ---------------------------- Header ---------------------------- */
.br-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 22px 26px;
	background: var(--br-header);
	border-bottom: 1px solid var(--br-border);
}

.br-header-logo img {
	width: 58px;
	height: 58px;
	object-fit: contain;
	display: block;
}

.br-header-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--br-text);
	line-height: 1.2;
}

.br-header-tagline {
	margin: 4px 0 0;
	font-size: 0.95rem;
	color: var(--br-primary);
	font-weight: 600;
}

/* ----------------------------- Tabs ----------------------------- */
.br-tablist {
	display: flex;
	gap: 4px;
	padding: 14px 16px 0;
	background: var(--br-bg);
	flex-wrap: wrap;
}

.br-tab {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--br-muted);
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	padding: 10px 18px;
	border-radius: 10px 10px 0 0;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.br-tab:hover {
	color: var(--br-text);
	background: rgba(15, 23, 42, 0.04);
}

.br-tab.is-active {
	color: var(--br-primary);
	background: var(--br-surface);
	box-shadow: 0 -2px 0 var(--br-primary) inset;
}

/* ---------------------------- Panels ---------------------------- */
.br-panels {
	padding: 20px;
	background: var(--br-bg);
}

.br-panel {
	display: none;
	animation: br-fade 0.25s ease;
}

.br-panel.is-active {
	display: block;
}

@keyframes br-fade {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------- Cards ----------------------------- */
.br-card {
	background: var(--br-surface);
	border: 1px solid var(--br-border);
	border-radius: var(--br-radius);
	padding: 22px;
	margin-bottom: 18px;
}

.br-card:last-child {
	margin-bottom: 0;
}

.br-card-title {
	margin: 0 0 16px;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--br-text);
}

/* ---------------------------- Fields ---------------------------- */
.br-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

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

.br-field label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--br-muted);
}

.br-field input,
.br-field select {
	width: 100%;
	padding: 11px 13px;
	font: inherit;
	font-size: 0.95rem;
	color: var(--br-text);
	background: #fff;
	border: 1px solid var(--br-border);
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.br-field input:focus,
.br-field select:focus {
	outline: none;
	border-color: var(--br-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--br-primary) 18%, transparent);
}

/* ---------------------------- Buttons --------------------------- */
.br-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
	padding: 12px 22px;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	border-radius: 11px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.br-btn:active {
	transform: translateY(1px);
}

.br-btn-primary {
	background: var(--br-primary);
	color: #fff;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--br-primary) 28%, transparent);
}

.br-btn-primary:hover {
	filter: brightness(1.05);
}

.br-btn-ghost {
	background: transparent;
	color: var(--br-primary);
	border-color: color-mix(in srgb, var(--br-primary) 35%, var(--br-border));
}

.br-btn-ghost:hover {
	background: color-mix(in srgb, var(--br-primary) 8%, transparent);
}

.br-btn-ghost.is-done {
	color: var(--br-accent);
	border-color: var(--br-accent);
}

.br-btn[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

/* ---------------------------- Notes ----------------------------- */
.br-note {
	margin: 12px 0 0;
	font-size: 0.85rem;
	color: #b91c1c;
}

/* --------------------------- SMS block -------------------------- */
.br-sms-preview {
	margin-top: 18px;
	padding: 16px;
	background: var(--br-bg);
	border: 1px dashed var(--br-border);
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.br-sms-label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--br-muted);
}

.br-sms-text {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--br-text);
	letter-spacing: 0.02em;
	word-break: break-word;
	min-height: 1.4em;
}

.br-sms-text.is-empty::before {
	content: attr(data-empty);
	color: var(--br-muted);
	font-weight: 400;
	font-family: inherit;
	font-size: 0.9rem;
}

.br-sms-to {
	font-size: 0.85rem;
	color: var(--br-muted);
}

.br-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.br-actions .br-btn {
	margin-top: 16px;
	flex: 1 1 auto;
}

/* --------------------------- iFrame ----------------------------- */
.br-iframe {
	width: 100%;
	border: 0;
	border-radius: 10px;
	background: #fff;
	display: block;
}

.br-iframe-card {
	padding: 12px;
}

.br-live-bar {
	margin-bottom: 12px;
}

.br-live-bar .br-field {
	max-width: 360px;
}

.br-live-hint {
	color: var(--br-muted);
	text-align: center;
	margin: 14px 0 4px;
}

/* -------------------------- Responsive -------------------------- */
@media ( max-width: 560px ) {
	.br-grid {
		grid-template-columns: 1fr;
	}
	.br-header {
		padding: 18px;
	}
	.br-header-title {
		font-size: 1.15rem;
	}
	.br-panels {
		padding: 14px;
	}
	.br-card {
		padding: 18px;
	}
	.br-tab {
		flex: 1 1 auto;
		text-align: center;
		padding: 10px 12px;
	}
}

/* ================================================================= */
/* Info sections (v1.2): stats, guides, challenge, notice, FAQ       */
/* ================================================================= */

.br-info {
	margin-top: 18px;
}

.br-panels + .br-info {
	margin-top: 0;
	padding: 0 20px 20px;
	background: var(--br-bg);
}

.br-info-picker {
	margin-bottom: 18px;
}

.br-info-picker .br-field {
	max-width: 420px;
}

.br-info-hint {
	text-align: center;
	color: var(--br-muted);
	background: var(--br-surface);
	border: 1px dashed var(--br-border);
	border-radius: var(--br-radius);
	padding: 18px 16px;
	margin: 0 0 18px;
}

.br-info-pack > .br-sec {
	margin-bottom: 18px;
}

.br-info-pack > .br-sec:last-child {
	margin-bottom: 0;
}

.br-sec-title {
	margin: 0 0 16px;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--br-text);
	line-height: 1.4;
	padding-left: 12px;
	border-left: 4px solid var(--br-primary);
}

.br-sub {
	margin: 18px 0 12px;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--br-text);
}

/* --------------------------- Stat cards ------------------------- */
.br-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.br-stat {
	background: var(--br-bg);
	border: 1px solid var(--br-border);
	border-radius: 12px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
}

.br-stat-icon {
	color: var(--br-primary);
	display: inline-flex;
	margin-bottom: 2px;
}

.br-stat-icon svg {
	width: 22px;
	height: 22px;
}

.br-stat-value {
	font-size: 1.22rem;
	font-weight: 800;
	color: var(--br-text);
	letter-spacing: -0.01em;
	word-break: break-word;
	line-height: 1.25;
}

.br-stat-label {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--br-muted);
}

.br-linkrow {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.br-chip-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--br-primary) 30%, var(--br-border));
	color: var(--br-primary);
	text-decoration: none;
	font-size: 0.86rem;
	font-weight: 600;
	background: transparent;
	transition: background 0.15s ease;
}

.br-chip-link:hover {
	background: color-mix(in srgb, var(--br-primary) 8%, transparent);
	color: var(--br-primary);
}

.br-chip-link svg {
	width: 15px;
	height: 15px;
	flex: none;
}

/* --------------------------- Step lists ------------------------- */
.br-steps {
	list-style: none;
	counter-reset: brstep;
	margin: 0;
	padding: 0;
}

.br-steps li {
	counter-increment: brstep;
	position: relative;
	padding: 0 0 16px 44px;
	font-size: 0.95rem;
	color: var(--br-text);
	line-height: 1.55;
}

.br-steps li::before {
	content: counter(brstep);
	position: absolute;
	left: 0;
	top: -1px;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--br-primary) 12%, transparent);
	color: var(--br-primary);
	font-weight: 700;
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.br-steps li::after {
	content: "";
	position: absolute;
	left: 13.5px;
	top: 30px;
	bottom: 4px;
	width: 1px;
	background: var(--br-border);
}

.br-steps li:last-child {
	padding-bottom: 0;
}

.br-steps li:last-child::after {
	display: none;
}

/* --------------------------- Meta chips ------------------------- */
.br-meta-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 6px;
}

.br-meta {
	background: var(--br-bg);
	border: 1px solid var(--br-border);
	border-radius: 12px;
	padding: 12px 14px;
}

.br-meta-label {
	display: block;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--br-muted);
	margin-bottom: 3px;
}

.br-meta-value {
	font-size: 0.98rem;
	font-weight: 700;
	color: var(--br-text);
	word-break: break-word;
}

/* ----------------------- Callout & rich text -------------------- */
.br-callout {
	margin-top: 16px;
	padding: 13px 16px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--br-accent) 8%, transparent);
	border-left: 4px solid var(--br-accent);
	font-size: 0.88rem;
	color: var(--br-text);
	line-height: 1.55;
}

.br-richtext {
	font-size: 0.95rem;
	color: var(--br-text);
	line-height: 1.6;
}

.br-richtext a,
.br-faq-a a,
.br-callout a {
	color: var(--br-primary);
}

.br-sec .br-btn {
	margin-top: 16px;
}

.br-sec .br-btn svg {
	width: 17px;
	height: 17px;
}

/* ----------------------------- Notice --------------------------- */
.br-lead {
	margin: 0 0 14px;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--br-text);
}

.br-notice-fig {
	margin: 0 0 14px;
}

.br-notice-fig:last-of-type {
	margin-bottom: 0;
}

.br-notice-fig img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 10px;
	border: 1px solid var(--br-border);
}

/* ------------------------------ FAQ ----------------------------- */
.br-faq-item {
	border: 1px solid var(--br-border);
	border-radius: 12px;
	background: var(--br-bg);
	margin-bottom: 10px;
	overflow: hidden;
}

.br-faq-item:last-child {
	margin-bottom: 0;
}

.br-faq-item summary {
	list-style: none;
	cursor: pointer;
	padding: 14px 44px 14px 16px;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--br-text);
	position: relative;
	line-height: 1.45;
}

.br-faq-item summary::-webkit-details-marker {
	display: none;
}

.br-faq-item summary::after {
	content: "+";
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--br-primary);
	line-height: 1;
}

.br-faq-item[open] summary::after {
	content: "\2212";
}

.br-faq-item summary:hover {
	color: var(--br-primary);
}

.br-faq-a {
	padding: 0 16px 14px;
	font-size: 0.92rem;
	color: var(--br-text);
	line-height: 1.6;
}

/* -------------------------- Responsive -------------------------- */
@media ( max-width: 720px ) {
	.br-stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media ( max-width: 560px ) {
	.br-panels + .br-info {
		padding: 0 14px 14px;
	}
	.br-sec-title {
		font-size: 0.98rem;
	}
}

/* ------------------ National summary (v1.3) --------------------- */
.br-info > .br-sec-national {
	margin-bottom: 18px;
}

.br-sec-national .br-sec-title {
	border-left-color: var(--br-accent);
}

.br-sec-national .br-stat-icon {
	color: var(--br-accent);
}

.br-sec-national .br-chip-link {
	border-color: color-mix(in srgb, var(--br-accent) 35%, var(--br-border));
	color: var(--br-accent);
}

.br-sec-national .br-chip-link:hover {
	background: color-mix(in srgb, var(--br-accent) 8%, transparent);
	color: var(--br-accent);
}
