/* =========================================================
   Coursecado Result Portal — Frontend Styles
   Scoped entirely under .cerm-portal — will not affect
   any other part of the site.
   ========================================================= */

.cerm-portal {
	--cerm-accent-soft: color-mix(in srgb, var(--cerm-accent, #1e5aa8) 12%, #ffffff);
	--cerm-accent-softer: color-mix(in srgb, var(--cerm-accent, #1e5aa8) 6%, #ffffff);
	--cerm-accent-dark: color-mix(in srgb, var(--cerm-accent, #1e5aa8) 82%, #000000);
	--cerm-accent-ring: color-mix(in srgb, var(--cerm-accent, #1e5aa8) 22%, transparent);

	width: 100%;
	max-width: 720px;
	margin: clamp(20px, 4vw, 40px) auto;
	padding: clamp(20px, 4vw, 36px);
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 2px 8px rgba(20, 30, 50, .04), 0 16px 40px rgba(20, 30, 50, .09);
	border: 1px solid #eef0f3;
	font-family: inherit;
	color: #1d2327;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
}
.cerm-portal * { box-sizing: border-box; }

/* Decorative top accent bar */
.cerm-portal::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 5px;
	background: linear-gradient(90deg, var(--cerm-accent, #1e5aa8), var(--cerm-accent-dark, #123a6e));
}

/* ---------- Header ---------- */
.cerm-portal__header {
	text-align: center;
	margin-bottom: clamp(20px, 4vw, 30px);
	padding-top: 6px;
}
.cerm-portal__title {
	font-size: clamp(20px, 4.2vw, 27px);
	font-weight: 800;
	margin: 0 0 8px;
	color: #16191d;
	line-height: 1.25;
	overflow-wrap: break-word;
	letter-spacing: -.01em;
}
.cerm-portal__title::before {
	content: "🎓";
	display: inline-block;
	margin-right: 8px;
}
.cerm-portal__subtitle {
	color: #5c636c;
	margin: 0 auto;
	font-size: clamp(13.5px, 2.6vw, 15px);
	max-width: 480px;
	line-height: 1.5;
}

/* ---------- Search card ---------- */
.cerm-search-form {
	margin: 0 0 clamp(18px, 3.5vw, 24px);
	background: linear-gradient(180deg, var(--cerm-accent-softer), #fff 55%);
	border: 1px solid var(--cerm-accent-soft);
	border-radius: 14px;
	padding: clamp(16px, 3.5vw, 20px);
}
.cerm-label {
	display: block;
	font-weight: 700;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: 8px;
	color: var(--cerm-accent-dark, #1e5aa8);
}
.cerm-search-row {
	display: flex;
	gap: 10px;
	flex-wrap: nowrap;
	align-items: center;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	position: relative;
}

/* decorative search icon, purely visual, non-interactive */
.cerm-search-row::before {
	content: "🔍";
	position: absolute;
	left: 16px;
	top: 23px;
	font-size: 16px;
	line-height: 1;
	opacity: .5;
	pointer-events: none;
	z-index: 2;
}

.cerm-input {
	flex: 1 1 0;
	width: 0;
	min-width: 0;
	height: 50px !important;
	min-height: 50px !important;
	max-height: 50px !important;
	padding: 12px 16px 12px 42px !important;
	border: 1.5px solid #d7dce2 !important;
	border-radius: 10px !important;
	font-size: 15px !important;
	line-height: 20px !important;
	background: #fff !important;
	color: #1d2327 !important;
	box-shadow: 0 1px 2px rgba(20,30,50,.03);
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box !important;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.cerm-input::placeholder { color: #97a0aa; }
.cerm-input:hover { border-color: #c3cad2 !important; }
.cerm-input:focus {
	outline: none;
	border-color: var(--cerm-accent, #1e5aa8) !important;
	box-shadow: 0 0 0 4px var(--cerm-accent-ring, rgba(30,90,168,.15));
}

.cerm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 12px 24px;
	height: 50px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	border: 0;
	text-decoration: none;
	letter-spacing: .01em;
	transition: transform .08s ease, box-shadow .15s ease, opacity .15s ease, filter .15s ease;
}
.cerm-btn--primary {
	background: linear-gradient(180deg, var(--cerm-accent, #1e5aa8), var(--cerm-accent-dark, #16457f));
	color: #fff;
	box-shadow: 0 6px 16px var(--cerm-accent-ring, rgba(30,90,168,.28));
}
.cerm-btn--primary:hover { filter: brightness(1.05); box-shadow: 0 8px 20px var(--cerm-accent-ring, rgba(30,90,168,.34)); }
.cerm-btn--primary:active { transform: translateY(1px); box-shadow: 0 3px 10px var(--cerm-accent-ring, rgba(30,90,168,.25)); }
.cerm-btn--ghost { background: #fff; color: var(--cerm-accent, #1e5aa8); border: 1.5px solid var(--cerm-accent, #1e5aa8); }
.cerm-btn--ghost:hover { background: var(--cerm-accent-softer); }

/* ---------- Result area ---------- */
.cerm-result-area { margin-top: clamp(18px, 3.5vw, 22px); }

.cerm-loading {
	text-align: center;
	padding: 30px 20px;
	color: #5c636c;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}
.cerm-loading::before {
	content: "";
	width: 16px; height: 16px;
	border-radius: 50%;
	border: 2.5px solid var(--cerm-accent-soft, #dbe6f4);
	border-top-color: var(--cerm-accent, #1e5aa8);
	animation: cermSpin .7s linear infinite;
}
@keyframes cermSpin { to { transform: rotate(360deg); } }

.cerm-card {
	border: 1px solid #e6e9ed;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 10px 30px rgba(20,30,50,.06);
	animation: cermFadeIn .3s ease;
}
@keyframes cermFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cerm-card__header {
	background: linear-gradient(135deg, var(--cerm-accent, #1e5aa8), var(--cerm-accent-dark, #123a6e));
	color: #fff;
	padding: clamp(16px, 3vw, 20px) clamp(18px, 4vw, 24px);
}
.cerm-card__header h3 {
	margin: 0;
	font-size: clamp(16px, 3vw, 18px);
	color: #fff;
	font-weight: 700;
	letter-spacing: -.01em;
}

.cerm-card__body { padding: clamp(18px, 4vw, 24px); }

.cerm-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px dashed #e6e8eb;
}
.cerm-row:last-child { border-bottom: 0; }
.cerm-row__label { color: #6a7078; font-size: 13.5px; font-weight: 500; }
.cerm-row__value {
	font-weight: 700;
	text-align: right;
	color: #1d2327;
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.cerm-row__value code {
	background: #f2f4f7;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 13px;
}

.cerm-status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.cerm-status--passed { background: #dcf6e4; color: #17803a; }
.cerm-status--failed { background: #fbdcdc; color: #b32d2e; }
.cerm-status--pending { background: #fdf1c8; color: #8a6d00; }
.cerm-status--cancelled { background: #e7e8ea; color: #565c64; }
.cerm-status--withheld { background: #ffe3c6; color: #a04a00; }
.cerm-status--passed::before { content: "✓"; }
.cerm-status--failed::before { content: "✕"; }
.cerm-status--pending::before { content: "⏳"; }
.cerm-status--cancelled::before { content: "⊘"; }
.cerm-status--withheld::before { content: "⚠"; }

.cerm-msg {
	margin: 18px 0 0;
	padding: 14px 16px;
	border-radius: 10px;
	font-size: 14.5px;
	line-height: 1.55;
	background: var(--cerm-accent-softer, #f6f8fa);
	border-left: 4px solid var(--cerm-accent, #1e5aa8);
	color: #1d2327;
}

.cerm-note {
	margin-top: 14px;
	padding: 14px 16px;
	background: #fbfaf3;
	border-left: 4px solid #dba617;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.55;
	color: #1d2327;
}
.cerm-note strong { display: block; margin-bottom: 4px; color: #8a6d00; }

.cerm-cert {
	margin-top: 20px;
	padding: 20px;
	border: 1px solid #e6e9ed;
	border-radius: 12px;
	background: linear-gradient(180deg, #fafbfc, #fff);
}
.cerm-cert__title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 800;
	display: flex;
	align-items: center;
	gap: 6px;
}
.cerm-cert__title::before { content: "📜"; font-size: 14px; }
.cerm-cert__status { font-size: 13px; color: #5c636c; margin-bottom: 10px; }
.cerm-cert__status strong { color: #1d2327; }
.cerm-cert__msg { font-size: 14px; color: #1d2327; margin: 6px 0 14px; line-height: 1.55; }
.cerm-cert .cerm-btn { width: 100%; }

.cerm-error {
	background: #fdecec;
	border-left: 4px solid #b32d2e;
	color: #7a1f1f;
	padding: 16px 18px;
	border-radius: 12px;
	font-size: 14.5px;
	line-height: 1.55;
	animation: cermFadeIn .3s ease;
}
.cerm-error strong { display: block; margin-bottom: 4px; font-size: 15px; }

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* Tablet */
@media (max-width: 768px) {
	.cerm-portal { margin: 16px auto; }
}

/* Mobile */
@media (max-width: 560px) {
	.cerm-portal {
		width: calc(100% - 20px);
		max-width: 720px;
		margin: 14px auto;
		padding: 18px;
		border-radius: 16px;
		box-sizing: border-box;
	}
	.cerm-search-form { padding: 14px; border-radius: 12px; }
	.cerm-search-row {
		flex-direction: column;
		gap: 10px;
		width: 100%;
	}
	.cerm-search-row::before { top: 27px; }
	.cerm-search-row > * {
		width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}
	.cerm-input {
		width: 100%;
		min-width: 0;
		flex: 0 0 50px;
		height: 50px !important;
		min-height: 50px !important;
		max-height: 50px !important;
	}
	.cerm-btn {
		width: 100%;
		min-height: 50px !important;
		height: 50px !important;
		box-sizing: border-box;
		text-align: center;
	}
	.cerm-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		padding: 10px 0;
	}
	.cerm-row__value {
		width: 100%;
		text-align: left;
		min-width: 0;
		overflow-wrap: anywhere;
		word-break: break-word;
	}
	.cerm-card__header h3 { text-align: center; }
}

/* Small phones */
@media (max-width: 380px) {
	.cerm-portal { padding: 14px; }
	.cerm-portal__title { font-size: 19px; }
	.cerm-portal__title::before { display: block; margin: 0 0 4px; font-size: 26px; }
	.cerm-card__body { padding: 16px; }
	.cerm-cert { padding: 14px; }
}
