/* ==========================================================================
   Certificate verification portal — search page and results
   (verdict, student profile, the ERP's original certificate PDF).
   Palette follows the institute's certificate (navy #14213D, gold #B8892B).
   The certificate itself is never restyled: it is the ERP's own PDF, drawn by PDF.js.
   ========================================================================== */

.cp {
	--cp-navy: #14213d;
	--cp-navy-2: #1d3157;
	--cp-gold: #b8892b;
	--cp-gold-dark: #86611a;
	--cp-gold-soft: #f3e7c9;
	--cp-ink: #1f2937;
	--cp-muted: #5a6478;
	--cp-line: #e5e1d6;
	--cp-ok: #127a43;
	--cp-bad: #b42318;
	--cp-warn: #9a6700;
	background: #ffffff;
	color: var(--cp-ink);
}

/* ---------- Hero ---------- */
.cp-hero {
	position: relative;
	padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px);
	text-align: center;
	background:
		radial-gradient(900px 260px at 50% 0%, rgb(184 137 43 / 9%), transparent 70%),
		linear-gradient(#ffffff, #fbfaf6);
	border-bottom: 1px solid var(--cp-line);
}
.cp-hero::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--cp-navy), var(--cp-gold), var(--cp-navy)); }
.cp-hero .crumbs { justify-content: center; color: var(--cp-muted); }
.cp-hero .crumbs a { color: var(--cp-gold-dark); }
.cp-kicker { display: inline-flex; align-items: center; gap: .55em; font-family: 'Cinzel', var(--f-head); font-weight: 600; font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--cp-gold-dark); }
html[data-lang="bn"] .cp-kicker, html[data-lang="ar"] .cp-kicker, html[data-lang="ja"] .cp-kicker { letter-spacing: .04em; font-family: var(--f-head); font-size: .95rem; }
.cp-title { margin: 14px 0 0; font-family: 'Cinzel', var(--f-head); font-weight: 700; font-size: clamp(1.9rem, 4.6vw, 3.1rem); letter-spacing: .08em; color: var(--cp-navy); }
html[data-lang="bn"] .cp-title, html[data-lang="ar"] .cp-title, html[data-lang="ja"] .cp-title { font-family: var(--f-head); letter-spacing: 0; }
.cp-rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px auto; width: min(280px, 70%); }
.cp-rule::before, .cp-rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--cp-gold)); }
.cp-rule::after { transform: scaleX(-1); }
.cp-rule span { width: 9px; height: 9px; transform: rotate(45deg); background: var(--cp-gold); }
.cp-sub { max-width: 720px; margin: 0 auto; font-size: 1.06rem; line-height: 1.7; color: var(--cp-muted); }

/* ---------- Body / form ---------- */
.cp-body { padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 88px); background: #fbfaf6; }
.cp-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 32px); align-items: start; }
@media (max-width: 900px) { .cp-grid { grid-template-columns: 1fr; } }

.cp-card { background: #fff; border: 1px solid var(--cp-line); border-top: 4px solid var(--cp-navy); border-radius: 12px; padding: clamp(20px, 3.4vw, 36px); box-shadow: 0 18px 40px -28px rgb(20 33 61 / 45%); }
.cp-card__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.cp-card__icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: var(--cp-gold); background: var(--cp-navy); box-shadow: 0 0 0 4px var(--cp-gold-soft); }
.cp-card__head h2 { margin: 0 0 4px; font-size: 1.3rem; color: var(--cp-navy); }
.cp-card__head p { margin: 0; color: var(--cp-muted); font-size: .94rem; }
.cp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .cp-fields { grid-template-columns: 1fr; } }
.cp-field label { display: block; margin-bottom: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cp-navy); }
html[data-lang="bn"] .cp-field label, html[data-lang="ar"] .cp-field label, html[data-lang="ja"] .cp-field label { letter-spacing: 0; text-transform: none; font-size: .92rem; }
.cp .cp-field input { width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid #d8d3c4; border-radius: 8px; background: #fff; color: var(--cp-ink); font-size: 1.02rem; letter-spacing: .04em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cp .cp-field input:focus { outline: none; border-color: var(--cp-navy); box-shadow: 0 0 0 4px rgb(20 33 61 / 10%); }
.cp .cp-field input.is-invalid { border-color: var(--cp-bad); }

.cp-btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 52px; padding: .8em 1.6em; border: 1.5px solid var(--cp-navy); border-radius: 8px; background: var(--cp-navy); color: #fff; font-family: var(--f-head); font-weight: 700; font-size: 1rem; letter-spacing: .03em; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s, transform .15s; }
.cp-btn i { color: var(--cp-gold); }
.cp-btn:hover { background: var(--cp-navy-2); box-shadow: 0 10px 24px -12px rgb(20 33 61 / 60%); transform: translateY(-1px); color: #fff; }
.cp-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.cp-form .cp-btn { width: 100%; margin-top: 18px; }
.cp-btn--ghost { background: #fff; color: var(--cp-navy); }
.cp-btn--ghost:hover { background: var(--cp-gold-soft); color: var(--cp-navy); }
.cp-btn--link { background: transparent; border-color: transparent; color: var(--cp-navy); }
.cp-btn--link:hover { background: transparent; box-shadow: none; text-decoration: underline; color: var(--cp-navy); }
.cp-secure { display: flex; gap: .55em; align-items: center; justify-content: center; margin: 12px 0 0; font-size: .84rem; color: var(--cp-muted); }
.cp-secure i { color: var(--cp-ok); }

.cp-alert { display: flex; gap: .7em; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: 8px; font-size: .92rem; }
.cp-alert--warn { background: #fff8e6; border: 1px solid #f0d58c; color: #6b4e00; }
.cp-alert a { font-weight: 700; color: inherit; }

.cp-status { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #f4f1e8; color: var(--cp-navy); font-weight: 600; }
.cp-status.is-error { background: #fdecea; color: var(--cp-bad); }

/* ---------- Side panels ---------- */
.cp-side { display: grid; gap: 18px; }
.cp-panel { background: #fff; border: 1px solid var(--cp-line); border-radius: 12px; padding: 22px; }
.cp-panel__title { display: flex; gap: .55em; align-items: center; margin: 0 0 14px; font-size: 1.05rem; color: var(--cp-navy); }
.cp-panel__title i { color: var(--cp-gold); }
.cp-panel--privacy { background: #f7f5ee; }
.cp-panel--privacy p { margin: 0; font-size: .92rem; line-height: 1.65; color: var(--cp-muted); }
.cp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cp-steps li { display: flex; gap: 12px; }
.cp-steps li > span { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: 'Cinzel', serif; font-weight: 700; color: var(--cp-navy); border: 1.5px solid var(--cp-gold); background: #fff; }
.cp-steps strong { color: var(--cp-navy); }
.cp-steps p { margin: 2px 0 0; font-size: .88rem; color: var(--cp-muted); }

/* ---------- Result: verdict ---------- */
.cp-result { margin-top: clamp(24px, 4vw, 40px); display: grid; gap: clamp(16px, 2.6vw, 24px); }
.cp-result[hidden] { display: none; }
.cp-result:focus { outline: none; }
.cp-verdict { display: flex; gap: 18px; align-items: center; padding: 20px 22px; border-radius: 12px; border: 1px solid; background: #fff; }
.cp-verdict__icon { flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; color: #fff; }
.cp-verdict__title { display: block; font-family: 'Cinzel', var(--f-head); font-weight: 700; font-size: clamp(1.1rem, 2.4vw, 1.45rem); letter-spacing: .06em; }
html[data-lang="bn"] .cp-verdict__title, html[data-lang="ar"] .cp-verdict__title, html[data-lang="ja"] .cp-verdict__title { font-family: var(--f-head); letter-spacing: 0; }
.cp-verdict__text { display: block; margin-top: 4px; color: var(--cp-ink); }
.cp-verdict__meta { display: block; margin-top: 6px; font-size: .84rem; color: var(--cp-muted); }
.cp-verdict__meta a { color: inherit; font-weight: 700; }
.cp-verdict--valid { border-color: #a7dcbf; background: #f1faf5; }
.cp-verdict--valid .cp-verdict__icon { background: var(--cp-ok); }
.cp-verdict--valid .cp-verdict__title { color: var(--cp-ok); }
.cp-verdict--revoked { border: 2px solid var(--cp-bad); background: #fff5f4; }
.cp-verdict--revoked .cp-verdict__icon { background: var(--cp-bad); }
.cp-verdict--revoked .cp-verdict__title { color: var(--cp-bad); font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: .18em; }
.cp-verdict--notfound { border-color: #d3d8e2; background: #f6f7fa; }
.cp-verdict--notfound .cp-verdict__icon { background: var(--cp-navy); }
.cp-verdict--notfound .cp-verdict__title { color: var(--cp-navy); }
.cp-verdict--unavailable { border-color: #f0d58c; background: #fffaeb; }
.cp-verdict--unavailable .cp-verdict__icon { background: var(--cp-warn); }
.cp-verdict--unavailable .cp-verdict__title { color: var(--cp-warn); }
@media (max-width: 520px) { .cp-verdict { flex-direction: column; text-align: center; } }

/* ---------- Result: student profile ---------- */
.cp-profile {
	position: relative;
	display: grid;
	grid-template-columns: clamp(150px, 18vw, 200px) minmax(0, 1fr);
	gap: clamp(18px, 3vw, 34px);
	align-items: start;
	padding: clamp(20px, 3vw, 32px);
	background: #fff;
	border: 1px solid var(--cp-line);
	border-radius: 14px;
	box-shadow: 0 22px 46px -30px rgb(20 33 61 / 50%);
	overflow: hidden;
}
.cp-profile[hidden] { display: none; }
.cp-profile::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--cp-navy) 0 62%, var(--cp-gold) 62% 100%); }
.cp-profile__photo { position: relative; aspect-ratio: 4 / 5; padding: 6px; border-radius: 10px; background: #fff; border: 2px solid var(--cp-gold); box-shadow: 0 0 0 5px var(--cp-gold-soft); }
.cp-profile__img { width: 100%; height: 100%; border-radius: 6px; background-color: #eef0f4; background-size: cover; background-position: center top; background-repeat: no-repeat; }
.cp-profile__nophoto { position: absolute; inset: 6px; display: grid; place-content: center; justify-items: center; gap: 8px; border-radius: 6px; background: #eef0f4; color: #8a93a6; font-size: .82rem; text-align: center; padding: 8px; }
.cp-profile__nophoto i { font-size: 2.6rem; color: #b5bccb; }
.cp-profile__photo.has-photo .cp-profile__nophoto { display: none; }
.cp-profile__kicker { display: inline-flex; align-items: center; gap: .5em; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cp-gold-dark); }
html[data-lang="bn"] .cp-profile__kicker, html[data-lang="ar"] .cp-profile__kicker, html[data-lang="ja"] .cp-profile__kicker { letter-spacing: 0; text-transform: none; font-size: .92rem; }
.cp-profile__name { margin: 6px 0 10px; font-family: 'Cinzel', var(--f-head); font-weight: 700; font-size: clamp(1.45rem, 3.2vw, 2.15rem); line-height: 1.2; letter-spacing: .04em; color: var(--cp-navy); text-transform: uppercase; overflow-wrap: anywhere; }
.cp-badge { display: inline-flex; align-items: center; gap: .45em; padding: .35em .85em; border-radius: 999px; background: #e7f6ee; color: var(--cp-ok); font-weight: 700; font-size: .86rem; border: 1px solid #b7e2c9; }
.cp-facts { margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--cp-line); }
.cp-facts > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--cp-line); }
.cp-facts > div[hidden] { display: none; }
.cp-facts > .is-wide { grid-column: 1 / -1; }
.cp-facts dt { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cp-gold-dark); }
html[data-lang="bn"] .cp-facts dt, html[data-lang="ar"] .cp-facts dt, html[data-lang="ja"] .cp-facts dt { letter-spacing: 0; text-transform: none; font-size: .86rem; }
.cp-facts dd { margin: 4px 0 0; font-size: 1.04rem; font-weight: 700; color: var(--cp-navy); overflow-wrap: anywhere; }
.cp-facts dd.is-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .02em; }
.cp-facts dd.is-ok { color: var(--cp-ok); }
html[dir="rtl"] .cp-facts > div { padding: 14px 0 14px 16px; }
/* ERP values carry dir="auto" (correct digit/Latin order); keep them aligned with the page. */
html[dir="rtl"] .cp-profile__name, html[dir="rtl"] .cp-facts dd { text-align: right; }
@media (max-width: 860px) { .cp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
	.cp-profile { grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.cp-profile__photo { width: min(190px, 62vw); }
	.cp-profile__main { width: 100%; }
	/* Phones: one label/value row per fact, so long numbers stay on one line. */
	.cp-facts { grid-template-columns: 1fr; text-align: start; }
	.cp-facts > div, html[dir="rtl"] .cp-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; }
	.cp-facts > div[hidden] { display: none; }
	.cp-facts dt { flex: 0 1 auto; max-width: 42%; }
	.cp-facts dd, html[dir="rtl"] .cp-facts dd { margin: 0; text-align: end; font-size: .98rem; }
	html[dir="rtl"] .cp-facts dd { text-align: left; }
	html[dir="rtl"] .cp-profile__name { text-align: center; }
	.cp-facts dd.is-code { white-space: nowrap; font-size: .9rem; letter-spacing: 0; overflow-wrap: normal; }
}

/* ---------- Result: original certificate (ERP PDF) ---------- */
.cp-original { background: #fff; border: 1px solid var(--cp-line); border-radius: 14px; overflow: hidden; box-shadow: 0 22px 46px -30px rgb(20 33 61 / 50%); }
.cp-original[hidden] { display: none; }
.cp-original__head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; padding: clamp(16px, 2.6vw, 24px) clamp(18px, 3vw, 30px); background: var(--cp-navy); color: #fff; border-bottom: 3px solid var(--cp-gold); }
.cp-original__head h2 { display: flex; align-items: center; gap: .55em; margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: #fff; }
.cp-original__head h2 i { color: #e8c766; }
.cp-original__head p { margin: 4px 0 0; font-size: .9rem; color: #c9d1e3; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cp-actions[hidden] { display: none; }
.cp-original .cp-btn { min-height: 46px; padding: .65em 1.3em; border-color: #e8c766; background: #e8c766; color: var(--cp-navy); }
.cp-original .cp-btn i { color: var(--cp-navy); }
.cp-original .cp-btn:hover { background: #f3d98a; color: var(--cp-navy); }
.cp-original .cp-btn--ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 55%); }
.cp-original .cp-btn--ghost i { color: #e8c766; }
.cp-original .cp-btn--ghost:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.cp-original .cp-actions .cp-btn { white-space: nowrap; }
@media (max-width: 600px) { .cp-original .cp-actions { width: 100%; } .cp-original .cp-actions .cp-btn { flex: 1 1 0; padding: .6em .8em; font-size: .94rem; } }

.cp-original__msg { display: flex; gap: 14px; align-items: flex-start; margin: clamp(16px, 3vw, 28px); padding: 16px 18px; border-radius: 10px; background: #f4f1e8; color: var(--cp-navy); }
.cp-original__msg[hidden] { display: none; }
.cp-original__msg > i { margin-top: .2em; font-size: 1.2rem; color: var(--cp-gold-dark); }
.cp-original__msg p { margin: 0; line-height: 1.6; }
.cp-original__msg .cp-btn { margin-top: 12px; min-height: 42px; padding: .5em 1.1em; font-size: .92rem; border-color: var(--cp-navy); background: #fff; color: var(--cp-navy); }
.cp-original__msg .cp-btn i { color: var(--cp-gold); }
.cp-original__msg.is-error { background: #fff8e6; color: #6b4e00; }
.cp-original__msg.is-error > i { color: var(--cp-warn); }
.cp-original__msg.is-loading { justify-content: center; align-items: center; padding: 48px 18px; background: #f7f5ee; }

/* The PDF pages are drawn at their own aspect ratio; only scaled to fit the width. */
.cp-pdf { display: grid; gap: 18px; padding: clamp(12px, 3vw, 32px); background: #e9edf3; }
.cp-pdf[hidden] { display: none; }
.cp-pdf__page { display: block; width: 100%; height: auto; max-width: 1123px; margin: 0 auto; background: #fff; box-shadow: 0 18px 40px -18px rgb(20 33 61 / 45%); }

.cp-again { margin: 0; text-align: center; }

@media print {
	/* Printing the web page itself: hide the site chrome around the result. */
	.cp-hero, .cp-grid, .cp-again, .cp-actions { display: none !important; }
	.cp-body { padding: 0; background: #fff; }
	.cp-profile, .cp-original { box-shadow: none; break-inside: avoid; }
}
