/**
 * EduBoard Result Checker — front-end styles.
 *
 * Scoped under .eduboard-rc so a host theme can't leak in and we can't
 * leak out. Colours follow the official board site (primary #0080b9).
 *
 * @package EduBoardResultChecker
 */

.eduboard-rc {
	--ebrc-primary: #0080b9;
	--ebrc-primary-dark: #006a99;
	--ebrc-primary-soft: #e8f4fa;
	--ebrc-fg: #101828;
	--ebrc-muted: #667085;
	--ebrc-border: #e4e7ec;
	--ebrc-row-alt: #f8fafc;
	--ebrc-bg: #f4f7fa;
	--ebrc-card: #ffffff;
	--ebrc-danger: #b42318;
	--ebrc-danger-soft: #fef3f2;
	--ebrc-radius: 12px;
	--ebrc-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);

	box-sizing: border-box;
	max-width: 980px;
	margin: 0 auto;
	color: var(--ebrc-fg);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.eduboard-rc *,
.eduboard-rc *::before,
.eduboard-rc *::after {
	box-sizing: inherit;
}

.eduboard-rc.is-bn {
	font-family: "Noto Sans Bengali", "Hind Siliguri", "SolaimanLipi", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.eduboard-rc__boot {
	min-height: 260px;
}

.eduboard-rc__noscript {
	padding: 16px;
	background: var(--ebrc-danger-soft);
	border-radius: var(--ebrc-radius);
	color: var(--ebrc-danger);
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.ebrc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 4px 16px;
	flex-wrap: wrap;
}

.ebrc-header__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ebrc-header__crest {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 50% 46%, #f42a41 0 34%, transparent 34%),
		#006a4e;
	border: 2px solid #d9e2ec;
}

.ebrc-header__title {
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.25;
}

.ebrc-header__sub {
	font-size: .78rem;
	color: var(--ebrc-muted);
	line-height: 1.35;
}

.ebrc-lang {
	display: inline-flex;
	background: #eef2f6;
	border-radius: 999px;
	padding: 3px;
	gap: 2px;
	flex: 0 0 auto;
}

.ebrc-lang__btn {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--ebrc-muted);
	font: inherit;
	font-size: .8rem;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 999px;
	cursor: pointer;
	line-height: 1.4;
}

.ebrc-lang__btn.is-active {
	background: var(--ebrc-primary);
	color: #fff;
}

.ebrc-lang__btn:focus-visible {
	outline: 2px solid var(--ebrc-primary);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Card + panel                                                        */
/* ------------------------------------------------------------------ */

.ebrc-card {
	background: var(--ebrc-card);
	border: 1px solid var(--ebrc-border);
	border-radius: var(--ebrc-radius);
	box-shadow: var(--ebrc-shadow);
	padding: 28px 24px 32px;
}

.ebrc-page-title {
	margin: 4px 0 22px;
	text-align: center;
	font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.95rem);
	font-weight: 700;
	line-height: 1.3;
	color: var(--ebrc-fg);
}

.ebrc-rule {
	border: 0;
	border-top: 1px solid var(--ebrc-border);
	margin: 0 0 18px;
}

.ebrc-panel {
	max-width: 700px;
	margin: 0 auto;
	border: 1px solid var(--ebrc-border);
	border-radius: var(--ebrc-radius);
	padding: 22px 20px 24px;
}

.ebrc-panel__title {
	margin: 0 0 18px;
	text-align: center;
	font-size: 1.05rem;
	font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Fields                                                              */
/* ------------------------------------------------------------------ */

.ebrc-field {
	margin-bottom: 14px;
}

.ebrc-label {
	display: block;
	margin-bottom: 5px;
	font-size: .85rem;
	font-weight: 500;
	color: #344054;
}

.ebrc-input {
	display: block;
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	font-size: .95rem;
	color: var(--ebrc-fg);
	background: #fff;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	transition: border-color .15s, box-shadow .15s;
	min-height: 42px;
}

.ebrc-input::placeholder {
	color: #98a2b3;
}

.ebrc-input:focus {
	outline: 0;
	border-color: var(--ebrc-primary);
	box-shadow: 0 0 0 3px rgba(0, 128, 185, .16);
}

.ebrc-select {
	appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 18px;
	padding-right: 36px;
}

.eduboard-rc[dir="rtl"] .ebrc-select {
	background-position: left 10px center;
	padding-right: 12px;
	padding-left: 36px;
}

.ebrc-field.has-error .ebrc-input,
.ebrc-captcha.has-error .ebrc-captcha__input {
	border-color: var(--ebrc-danger);
}

.ebrc-error {
	margin: 5px 0 0;
	font-size: .8rem;
	color: var(--ebrc-danger);
}

/* ------------------------------------------------------------------ */
/* CAPTCHA                                                             */
/* ------------------------------------------------------------------ */

.ebrc-captcha {
	margin: 18px 0 20px;
	padding: 14px;
	border: 1px solid var(--ebrc-border);
	border-radius: 10px;
	background: #fcfdfe;
}

.ebrc-captcha__label {
	font-size: .85rem;
	font-weight: 600;
}

.ebrc-captcha__hint {
	font-size: .8rem;
	color: var(--ebrc-muted);
	margin-bottom: 10px;
}

.ebrc-captcha__row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ebrc-captcha__frame {
	flex: 0 0 auto;
	width: 164px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	overflow: hidden;
}

.ebrc-captcha__img {
	display: block;
	width: 160px;
	height: 40px;
	image-rendering: pixelated;
}

.ebrc-captcha__img.is-loading {
	background: linear-gradient(90deg, #f2f4f7 25%, #e4e7ec 37%, #f2f4f7 63%);
	background-size: 400% 100%;
	animation: ebrc-shimmer 1.2s ease-in-out infinite;
}

@keyframes ebrc-shimmer {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

.ebrc-captcha__reload {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 2px solid var(--ebrc-primary);
	border-radius: 8px;
	background: #fff;
	color: var(--ebrc-primary);
	cursor: pointer;
	transition: background .15s;
}

.ebrc-captcha__reload:hover {
	background: var(--ebrc-primary-soft);
}

.ebrc-captcha__input {
	flex: 1 1 180px;
	min-width: 0;
	letter-spacing: .06em;
}

.ebrc-captcha__auto {
	margin: 8px 0 0;
	font-size: .78rem;
	color: #067647;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.ebrc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	font: inherit;
	font-size: .92rem;
	font-weight: 600;
	line-height: 1.4;
	border-radius: 8px;
	border: 2px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, color .15s, border-color .15s;
	min-height: 42px;
}

.ebrc-btn:focus-visible {
	outline: 2px solid var(--ebrc-primary);
	outline-offset: 2px;
}

.ebrc-btn--primary {
	background: var(--ebrc-primary);
	border-color: var(--ebrc-primary);
	color: #fff;
}

.ebrc-btn--primary:hover:not(:disabled) {
	background: var(--ebrc-primary-dark);
	border-color: var(--ebrc-primary-dark);
}

.ebrc-btn--ghost {
	background: #fff;
	border-color: var(--ebrc-primary);
	color: var(--ebrc-primary);
}

.ebrc-btn--ghost:hover {
	background: var(--ebrc-primary-soft);
}

.ebrc-btn--block {
	width: 100%;
	margin-top: 6px;
}

.ebrc-btn:disabled {
	opacity: .65;
	cursor: not-allowed;
}

.ebrc-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
	margin: 18px 0 22px;
}

/* ------------------------------------------------------------------ */
/* Notices                                                             */
/* ------------------------------------------------------------------ */

.ebrc-notice {
	max-width: 700px;
	margin: 16px auto 0;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: .88rem;
}

.ebrc-notice--error {
	background: var(--ebrc-danger-soft);
	border: 1px solid #fecdc9;
	color: var(--ebrc-danger);
}

.ebrc-notice--info {
	background: var(--ebrc-primary-soft);
	border: 1px solid #b9dcee;
	color: var(--ebrc-primary-dark);
}

/* ------------------------------------------------------------------ */
/* Result                                                              */
/* ------------------------------------------------------------------ */

.ebrc-section {
	margin: 26px 0 0;
}

.ebrc-section__title {
	margin: 0 0 10px;
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
}

.ebrc-section__title.is-left {
	text-align: left;
}

.ebrc-tablewrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ebrc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9rem;
}

.ebrc-table th,
.ebrc-table td {
	padding: 9px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--ebrc-border);
}

.ebrc-table .is-center { text-align: center; }
.ebrc-table .is-right  { text-align: right; }

.ebrc-table--summary th {
	width: 20%;
	font-weight: 500;
	color: #475467;
	white-space: nowrap;
}

.ebrc-table--summary td {
	font-weight: 600;
}

.ebrc-table--summary tbody tr:nth-child(even) {
	background: var(--ebrc-row-alt);
}

.ebrc-table--subjects thead th {
	font-weight: 700;
	border-bottom: 2px solid var(--ebrc-border);
	white-space: nowrap;
}

.ebrc-table--subjects tbody tr:nth-child(even) {
	background: var(--ebrc-row-alt);
}

.ebrc-foot {
	margin: 24px 0 0;
	text-align: center;
	font-size: .8rem;
	color: var(--ebrc-muted);
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {

	.eduboard-rc {
		font-size: 15px;
	}

	.ebrc-card {
		padding: 20px 14px 24px;
		border-radius: 10px;
	}

	.ebrc-panel {
		padding: 16px 12px 18px;
		border: 0;
	}

	.ebrc-header {
		padding: 8px 2px 12px;
	}

	.ebrc-header__sub {
		display: none;
	}

	.ebrc-captcha__row {
		gap: 8px;
	}

	.ebrc-captcha__input {
		flex: 1 1 100%;
	}

	.ebrc-actions .ebrc-btn {
		flex: 1 1 140px;
	}

	/* Summary table collapses to stacked label/value pairs. */
	.ebrc-table--summary,
	.ebrc-table--summary tbody,
	.ebrc-table--summary tr {
		display: block;
		width: 100%;
	}

	.ebrc-table--summary tr {
		border-bottom: 1px solid var(--ebrc-border);
		padding: 6px 0;
	}

	.ebrc-table--summary th,
	.ebrc-table--summary td {
		display: block;
		width: 100%;
		border: 0;
		padding: 2px 4px;
	}

	.ebrc-table--summary th {
		font-size: .78rem;
		color: var(--ebrc-muted);
	}

	.ebrc-table--summary th:empty,
	.ebrc-table--summary td:empty {
		display: none;
	}

	/* Subject tables become cards. */
	.ebrc-table--subjects thead {
		display: none;
	}

	.ebrc-table--subjects,
	.ebrc-table--subjects tbody,
	.ebrc-table--subjects tr,
	.ebrc-table--subjects td {
		display: block;
		width: 100%;
	}

	.ebrc-table--subjects tr {
		border: 1px solid var(--ebrc-border);
		border-radius: 8px;
		margin-bottom: 8px;
		padding: 8px 10px;
		background: #fff;
	}

	.ebrc-table--subjects tbody tr:nth-child(even) {
		background: var(--ebrc-row-alt);
	}

	.ebrc-table--subjects td {
		border: 0;
		padding: 3px 0;
		text-align: left !important;
		display: flex;
		justify-content: space-between;
		gap: 12px;
	}

	.ebrc-table--subjects td::before {
		content: attr(data-label);
		font-size: .78rem;
		color: var(--ebrc-muted);
		flex: 0 0 auto;
	}
}

/* ------------------------------------------------------------------ */
/* Print                                                               */
/* ------------------------------------------------------------------ */

@media print {

	.ebrc-header,
	.ebrc-actions,
	.ebrc-foot,
	.ebrc-notice {
		display: none !important;
	}

	.eduboard-rc {
		max-width: none;
		font-size: 12pt;
	}

	.ebrc-card {
		border: 0;
		box-shadow: none;
		padding: 0;
	}

	.ebrc-table {
		font-size: 10.5pt;
	}

	.ebrc-table th,
	.ebrc-table td {
		padding: 5px 8px;
	}

	.ebrc-section,
	.ebrc-table tr {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.ebrc-table--summary tbody tr:nth-child(even),
	.ebrc-table--subjects tbody tr:nth-child(even) {
		background: #f5f7fa !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}
