/* ============================================================
   Results page (new). Loaded after scan-new.css and scan-status-new.css and reuses their split,
   frame lines, form card and fields. Its own parts: a charcoal panel holding the report sheet
   (blurred until the visitor leaves details), the consent checkbox, the result counts and the actions.
   Scoped under .sn--result.
   ============================================================ */

/* ---------- Sides: form on the right, report panel on the left (like scan-new, not the mirrored status page) ---------- */

@media (min-width: 992px) {
	.sn--result .sn-split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
	}


	/* The form column closes the frame on the right and meets the panel on the left */
	.sn--result .sn-scan {
		border-inline-start: 1px solid var(--sn-line); /* taste-skill-ignore: frame lines are the brand's checker-page language */
		border-inline-end: 0;
	}
}

/* ---------- Panel: the brand charcoal #2c2b36 ---------- */

.sn--result .rn-panel {
	background: #2c2b36;
}

.sn--result .rn-panel::before,
.sn--result .rn-panel::after {
	background: rgba(255, 255, 255, 0.14);
}

.sn--result .rn-panel .sn-panel__quote {
	max-width: none;
	font-size: clamp(1.25rem, 1.65vw, 2.25rem);
	white-space: nowrap;
}

.sn--result .rn-panel .sn-panel__text {
	border-bottom-color: rgba(255, 255, 255, 0.28);
}

.sn--result .rn-facts,
.sn--result .rn-facts li {
	border-color: rgba(255, 255, 255, 0.14);
}

/* ---------- The report sheet ---------- */

.rn-sheet {
	position: relative;
	z-index: 2;
	flex: 1 1 auto;
	min-height: 240px;
	margin: 0 12%;
	padding: 20px;
	overflow: hidden;
	background: #24232d;
}

.rn-sheet__doc {
	position: relative;
	height: 100%;
	min-height: 200px;
	background: #ffffff;
	box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6); /* taste-skill-ignore: the report page floats on the panel */
}

.rn-sheet__sample,
.rn-sheet__pdf {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border: 0;
	background: #ffffff;
}

.rn-sheet__sample {
	object-fit: cover;
	object-position: top center;
}

.rn-sheet.has-pdf .rn-sheet__sample {
	visibility: hidden;
}

/* Locked: blurred, dimmed and out of reach; the PDF viewer cannot be scrolled or clicked */
.rn-sheet.is-locked .rn-sheet__doc {
	filter: blur(7px) saturate(0.9);
	opacity: 0.85;
	pointer-events: none;
	user-select: none;
}

.rn-sheet__doc {
	transition: filter 0.6s ease, opacity 0.6s ease;
}

/* No in-page PDF (phones): the sample image is only a preview, so it stays softly blurred after opening;
   the label then says the report is ready to download */
.rn-sheet.no-embed .rn-sheet__doc {
	filter: blur(4px) saturate(0.9);
	pointer-events: none;
}

.rn-sheet__lock {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 14px 20px 14px 22px;
	background: #ffffff;
	color: var(--sn-ink);
	font-size: 0.9375rem;
	font-weight: 500;
	white-space: nowrap;
	transform: translate(-50%, -50%);
	box-shadow: 0 16px 32px -12px rgba(20, 12, 50, 0.5); /* taste-skill-ignore: lock label over the report */
}

/* The lock in a soft accent circle */
.rn-sheet__lock-icon {
	display: grid;
	flex: 0 0 40px;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f1ebfd;
	color: var(--sn-accent);
}

.rn-sheet__lock-text {
	display: grid;
	gap: 2px;
}

/* The failed-checks count, above the instruction */
.rn-sheet__lock-fails {
	color: #b42328;
	font-size: 1.0625rem;
	font-weight: 600;
}

.rn-sheet__lock-fails.is-clean {
	color: #1f7a45;
}

.rn-sheet__lock-fails[hidden] {
	display: none;
}

.rn-sheet__lock[hidden] {
	display: none;
}

/* Sending: the arrow turns into a spinner and a light sweep runs across the button while the report opens */
.sn--result .ss-submit {
	position: relative;
	overflow: hidden;
}

.sn--result .ss-submit.is-loading {
	cursor: progress;
	opacity: 1;
}

.sn--result .ss-submit.is-loading svg {
	display: none;
}

.sn--result .ss-submit.is-loading::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: rn-spin 0.8s linear infinite;
}

.sn--result .ss-submit.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
	transform: translateX(-100%);
	animation: rn-sweep 1.2s ease-in-out infinite;
	pointer-events: none;
}

@keyframes rn-spin {
	to { transform: rotate(360deg); }
}

@keyframes rn-sweep {
	to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.sn--result .ss-submit.is-loading::before {
		animation-duration: 2.4s;
	}

	.sn--result .ss-submit.is-loading::after {
		display: none;
	}
}

.ss-fine a {
	color: var(--sn-accent);
}

/* ---------- Report open ---------- */

.rn-ready[hidden] {
	display: none;
}

.rn-ready:focus {
	outline: none;
}

/* Three result counts as framed cells. Like the form card, its top and bottom lines run on to the
   column's edges, so it sits in the page's frame grid; the cells are split by vertical lines */
.rn-sum {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin: 32px 0 0;
	border-inline: 1px solid var(--sn-line); /* taste-skill-ignore: frame lines are the brand's checker-page language */
}

.rn-sum::before,
.rn-sum::after {
	content: "";
	position: absolute;
	left: -100vw;
	right: -100vw;
	height: 1px;
	background: var(--sn-line);
	pointer-events: none;
}

.rn-sum::before {
	top: 0;
}

.rn-sum::after {
	bottom: 0;
}

.rn-sum__cell {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 18px;
	min-height: 120px;
	margin: 0;
	padding: 20px 20px 18px;
}

.rn-sum__cell + .rn-sum__cell {
	border-inline-start: 1px solid var(--sn-line); /* taste-skill-ignore: frame lines are the brand's checker-page language */
}

.rn-sum dt {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--sn-muted);
	font-size: 0.9375rem;
}

/* A small status dot before each label, in the result's colour */
.rn-sum dt::before {
	content: "";
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #b9b8c2;
}

.rn-sum__cell--pass dt::before {
	background: #1f7a45;
}

.rn-sum__cell--fail dt::before {
	background: #b42328;
}

/* Not checked: amber, like its yellow cell in the PDF; not relevant keeps the neutral grey */
.rn-sum__cell--unchecked dt::before {
	background: #c98a0b;
}

.rn-sum .rn-sum__cell--unchecked dd {
	color: #a16207;
}

.rn-sum dd {
	margin: 0;
	color: var(--sn-ink);
	font-size: clamp(2.25rem, 1.8rem + 1vw, 2.75rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.rn-sum__cell--pass dd {
	color: #1f7a45;
}

.rn-sum__cell--fail dd {
	color: #b42328;
}

/* The violations total, under the "לא תקין" count */
.rn-sum__note {
	display: block;
	margin-bottom: 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0;
}

.rn-sum__note[hidden] {
	display: none;
}

/* Talk to an expert: where each finding shows up on the site */
.rn-help {
	margin-top: 28px;
	padding-top: 22px;
	border-top: 1px dashed var(--sn-line); /* taste-skill-ignore: frame lines are the brand's checker-page language */
}

.rn-help__text {
	color: var(--sn-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.rn-help__text b {
	display: block;
	margin-bottom: 4px;
	color: var(--sn-ink);
	font-weight: 500;
}

.rn-help__link {
	margin-top: 12px;
}
.rn-actions {
	display: grid;
	gap: 12px;
	margin-top: 24px;
}

.rn-download {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
}

.rn-download[disabled] {
	opacity: 0.65;
	cursor: progress;
}

.rn-open {
	justify-self: center;
	padding-block: 8px;
	color: var(--sn-accent);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rn-open[aria-disabled="true"] {
	color: var(--sn-muted);
	pointer-events: none;
	text-decoration: none;
}

.rn-note {
	margin-top: 20px;
	color: var(--sn-muted);
	font-size: 0.875rem;
}

/* ---------- Stacked (tablet / phone) ---------- */

@media (max-width: 991px) {
	.rn-sheet {
		flex: 0 0 auto;
		height: 420px;
		margin-inline: 0;
	}
}

@media (max-width: 991px) {
	/* Stacked: the panel is full width, the title may wrap again */
	.sn--result .rn-panel .sn-panel__quote {
		font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
		white-space: normal;
	}
}

@media (max-width: 767px) {
	.rn-sheet {
		height: 340px;
		padding: 14px;
	}

	.rn-sheet__lock {
		white-space: normal;
		text-align: center;
	}

	.rn-sum dd {
		font-size: 1.875rem;
	}

	/* Two by two on phones */
	.rn-sum {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rn-sum__cell:nth-child(3) {
		border-inline-start: 0;
	}

	.rn-sum__cell:nth-child(n + 3) {
		border-top: 1px solid var(--sn-line); /* taste-skill-ignore: frame lines are the brand's checker-page language */
	}

	.rn-sum__cell {
		min-height: 96px;
		padding: 14px 12px;
	}
}
