/* SASSA Status Checker — scoped under .ssc so nothing leaks into the theme. */

.ssc {
	--ssc-yellow: #ffcc00;
	--ssc-yellow-dark: #e0b400;
	--ssc-ink: #1a1a1a;
	--ssc-muted: #666;
	--ssc-line: #e3e3e3;
	--ssc-approved: #1a7f37;
	--ssc-declined: #b42318;
	--ssc-pending: #9a6700;

	max-width: 680px;
	margin: 0 auto;
	padding: 1.5rem;
	background: #fff;
	border: 1px solid var(--ssc-line);
	border-top: 4px solid var(--ssc-yellow);
	border-radius: 10px;
	color: var(--ssc-ink);
	box-sizing: border-box;
}

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

.ssc .ssc__field {
	margin-bottom: 1rem;
}

.ssc .ssc__field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.95rem;
}

.ssc .ssc__field input {
	width: 100%;
	padding: 0.7rem 0.85rem;
	font-size: 1rem;
	border: 1px solid #c9c9c9;
	border-radius: 6px;
	background: #fff;
	color: inherit;
}

.ssc .ssc__field input:focus {
	outline: 2px solid var(--ssc-yellow-dark);
	outline-offset: 1px;
	border-color: var(--ssc-yellow-dark);
}

/* Consent notice and privacy line.
   Colours chosen for WCAG contrast at this text size (13.6px), measured:
   #333 on #f7f7f7 = 11.8:1, #1a1a1a on #f7f7f7 = 16.3:1,
   #4a4a4a on #fff = 8.9:1, #08427a on #fff = 10.1:1 — all above the 4.5:1
   AA threshold for small text, and above 7:1 for AAA. */
.ssc .ssc__consent {
	/* Clear separation from the button above it. */
	margin: 1.75rem 0 0;
	padding: 0.85rem 1rem;
	background: #f7f7f7;
	border-left: 3px solid var(--ssc-yellow-dark);
	border-radius: 4px;
	font-size: 0.85rem;
	line-height: 1.65;
	color: #333;
}

.ssc .ssc__consent-label {
	display: block;
	margin-bottom: 0.3rem;
	color: #1a1a1a;
	font-weight: 700;
}

.ssc .ssc__consent strong {
	color: #1a1a1a;
	font-weight: 700;
}

.ssc .ssc__submit {
	width: 100%;
	padding: 0.8rem 1rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--ssc-ink);
	background: var(--ssc-yellow);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.ssc .ssc__submit:hover:not(:disabled) {
	background: var(--ssc-yellow-dark);
}

.ssc .ssc__submit:disabled {
	opacity: 0.75;
	cursor: progress;
}

/* Spinner: hidden until the form is submitting. */
.ssc .ssc__spinner {
	display: none;
	width: 1em;
	height: 1em;
	margin-right: 0.55em;
	vertical-align: -0.15em;
	border: 2px solid rgba(0, 0, 0, 0.25);
	border-top-color: #1a1a1a;
	border-radius: 50%;
	animation: ssc-spin 0.7s linear infinite;
}

.ssc.is-busy .ssc__spinner {
	display: inline-block;
}

@keyframes ssc-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ssc .ssc__spinner {
		animation-duration: 2.5s;
	}
}

.ssc .ssc__results:focus {
	outline: none;
}

.ssc .ssc__alert {
	margin-top: 1rem;
	padding: 0.8rem 1rem;
	border-radius: 6px;
	background: #fdf1f0;
	border: 1px solid #f3c9c5;
	color: var(--ssc-declined);
	font-size: 0.93rem;
	line-height: 1.5;
}

.ssc .ssc__card {
	margin-top: 1.25rem;
	padding: 1rem;
	border: 1px solid var(--ssc-line);
	border-radius: 10px;
	background: #fcfcfc;
}

.ssc .ssc__appid {
	margin: 0 0 0.4rem;
	font-size: 0.92rem;
	color: var(--ssc-muted);
}

.ssc .ssc__appid strong {
	color: var(--ssc-ink);
}

.ssc .ssc__summary {
	margin: 0 0 0.9rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--ssc-line);
	font-size: 0.88rem;
	color: var(--ssc-muted);
}

.ssc .ssc__count.is-approved { color: var(--ssc-approved); font-weight: 600; }
.ssc .ssc__count.is-declined { color: var(--ssc-declined); font-weight: 600; }
.ssc .ssc__count.is-pending { color: var(--ssc-pending); font-weight: 600; }

.ssc .ssc__year {
	border: 1px solid var(--ssc-line);
	border-radius: 8px;
	margin-bottom: 0.5rem;
	background: #fff;
}

.ssc .ssc__year-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 0.85rem;
	cursor: pointer;
	font-weight: 700;
	list-style: none;
}

.ssc .ssc__year-head::-webkit-details-marker {
	display: none;
}

.ssc .ssc__year-head::before {
	content: '▸';
	margin-right: 0.4rem;
	font-size: 0.8em;
	color: var(--ssc-muted);
	display: inline-block;
	transition: transform 0.15s ease;
}

.ssc .ssc__year[open] > .ssc__year-head::before {
	transform: rotate(90deg);
}

.ssc .ssc__year[open] > .ssc__year-head {
	border-bottom: 1px solid var(--ssc-line);
}

.ssc .ssc__year-head:hover {
	background: #fafafa;
}

.ssc .ssc__year-count {
	margin-left: auto;
	font-weight: 400;
	font-size: 0.82rem;
	color: var(--ssc-muted);
}

/* Wide tables scroll inside the card, never the page. */
.ssc .ssc__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ssc .ssc__table {
	width: 100%;
	min-width: 30rem;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.ssc .ssc__table th,
.ssc .ssc__table td {
	padding: 0.6rem 0.7rem;
	text-align: left;
	border-bottom: 1px solid var(--ssc-line);
	vertical-align: top;
	white-space: nowrap;
}

.ssc .ssc__table td:last-child {
	white-space: normal;
	min-width: 12rem;
}

.ssc .ssc__table th {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ssc-muted);
	background: #f7f7f7;
}

.ssc .ssc__badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: capitalize;
}

.ssc .ssc__badge.is-approved {
	background: #e6f4ea;
	color: var(--ssc-approved);
}

.ssc .ssc__badge.is-declined {
	background: #fdeceb;
	color: var(--ssc-declined);
}

.ssc .ssc__badge.is-pending {
	background: #fff4d6;
	color: var(--ssc-pending);
}

.ssc .ssc__again {
	display: inline-block;
	text-decoration: none;
	margin-top: 1rem;
	padding: 0.55rem 0.9rem;
	font-size: 0.9rem;
	font-weight: 600;
	border: 1px solid var(--ssc-line);
	border-radius: 6px;
	background: #fff;
	color: var(--ssc-ink);
	cursor: pointer;
}

.ssc .ssc__again:hover {
	border-color: #bbb;
}

@media (max-width: 480px) {
	.ssc {
		padding: 1.1rem;
	}
}

/* Technical cause, shown to administrators only. */
.ssc .ssc__detail {
	display: block;
	margin-top: 0.4rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.78rem;
	opacity: 0.75;
}
