/*
 * SACP Feedback — public form.
 *
 * Sizes and colours are taken from the Formfacade form this replaces (white
 * 740px card, 1px gold borders, 42px inputs, hairline grid rows, navy
 * uppercase Submit). Deliberate differences: the rating grid always fits the
 * screen, inputs are 16px on phones so iOS does not zoom on focus, and the
 * font falls back to the site's sans-serif where Lucida is not installed.
 *
 * Everything is scoped under .sacp-fb and sets its own box model, so the
 * theme's reset and its global p / table / button rules cannot leak in.
 */

.sacp-fb {
	--sacp-fb-ink: #202124;
	--sacp-fb-gold: #bf862d;
	--sacp-fb-navy: #061e35;
	--sacp-fb-line: rgba(0, 0, 0, 0.12);
	--sacp-fb-red: #dd524c;
	--sacp-fb-font: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
	box-sizing: border-box;
	width: 100%;
	max-width: 740px;
	margin: 0 auto;
	text-align: left;
}

.sacp-fb *,
.sacp-fb *::before,
.sacp-fb *::after {
	box-sizing: border-box;
}

.sacp-fb p {
	margin: 0;
}

/* Shown until form.js mounts the form. The second line only appears if that never happens. */
.sacp-fb .sacp-fb-loading,
.sacp-fb .sacp-fb-nojs {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 22px;
	text-align: center;
}

.sacp-fb .sacp-fb-nojs {
	opacity: 0;
	animation: sacp-fb-reveal 0.01s linear 5s forwards;
}

@keyframes sacp-fb-reveal {
	to {
		opacity: 1;
	}
}

/* ------------------------------------------------------------------ */
/* Card                                                                */
/* ------------------------------------------------------------------ */

.sacp-fb .sacp-fb-form,
.sacp-fb .sacp-fb-success {
	margin: 0;
	padding: 39px 30px;
	border: 0;
	border-radius: 5.25px;
	background: #fff;
	color: var(--sacp-fb-ink);
	font-family: var(--sacp-fb-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 22.4px;
	letter-spacing: 0.2px;
	text-align: left;
}

/*
 * form.js reads this from the mounted form to confirm these rules really apply.
 * It sits on a selector that only matches once the form is in the page, because
 * a CSS optimiser that drops "unused" rules judges the page before the form is
 * mounted: the rules above could survive while everything for the form is gone.
 * If it is missing, form.js loads this stylesheet itself.
 */
.sacp-fb .sacp-fb-form {
	--sacp-fb-form-css: 1;
}

.sacp-fb .sacp-fb-intro {
	padding: 0 0 6px;
	white-space: normal;
}

.sacp-fb .sacp-fb-item {
	min-width: 0;
	margin: 0;
	padding: 18.2px 0 22.4px;
	border: 0;
}

.sacp-fb .sacp-fb-item[hidden] {
	display: none;
}

.sacp-fb .sacp-fb-q {
	display: block;
	margin: 0;
	padding: 0;
	color: var(--sacp-fb-ink);
	font-family: var(--sacp-fb-font);
	font-size: 15.4px;
	font-weight: 500;
	line-height: 23.1px;
	letter-spacing: 0.2px;
	cursor: default;
}

.sacp-fb .sacp-fb-req {
	color: #ef4444;
	font-weight: 600;
}

.sacp-fb .sacp-fb-help {
	display: block;
	margin: 0 0 3px;
	color: var(--sacp-fb-ink);
	font-size: 12.25px;
	line-height: 17.15px;
}

/* Shown under the event list when the site, not the visitor, chose the event. */
.sacp-fb .sacp-fb-hint {
	display: block;
	margin: 6px 0 0;
	color: #5f6368;
	font-size: 12.25px;
	line-height: 17.15px;
}

.sacp-fb .sacp-fb-hint[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Inputs                                                              */
/* ------------------------------------------------------------------ */

.sacp-fb .sacp-fb-control {
	display: block;
	width: 100%;
	min-height: 42px;
	margin: 5.25px 0 0;
	padding: 7px;
	border: 1px solid var(--sacp-fb-gold);
	border-radius: 5.25px;
	background-color: transparent;
	box-shadow: none;
	color: var(--sacp-fb-ink);
	font-family: var(--sacp-fb-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: normal;
	text-transform: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.sacp-fb textarea.sacp-fb-control {
	min-height: 109.2px;
	overflow: auto;
	resize: vertical;
	vertical-align: top;
	white-space: pre-wrap;
}

.sacp-fb select.sacp-fb-control {
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23061e35' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 14px 14px;
	text-overflow: ellipsis;
	cursor: pointer;
}

.sacp-fb .sacp-fb-control::placeholder {
	color: #9ca3af;
}

.sacp-fb .sacp-fb-control:focus {
	outline: 0;
	box-shadow: 0 0 0 3px rgba(191, 134, 45, 0.3);
}

.sacp-fb .sacp-fb-error {
	display: none;
	margin: 8.4px 0 0;
	color: var(--sacp-fb-red);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	letter-spacing: 0.2px;
}

.sacp-fb .sacp-fb-item.is-invalid .sacp-fb-error {
	display: block;
}

.sacp-fb .sacp-fb-item.is-invalid .sacp-fb-control {
	border-color: var(--sacp-fb-red);
}

/* ------------------------------------------------------------------ */
/* Rating grid                                                         */
/* ------------------------------------------------------------------ */

.sacp-fb .sacp-fb-grid {
	width: 100%;
	margin: 4px 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: fixed;
	color: var(--sacp-fb-ink);
	font-family: var(--sacp-fb-font);
	font-size: 14px;
	line-height: 21px;
}

.sacp-fb .sacp-fb-grid col.sacp-fb-col {
	width: 14%;
}

.sacp-fb .sacp-fb-grid th,
.sacp-fb .sacp-fb-grid td {
	margin: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 400;
	letter-spacing: 0.2px;
	vertical-align: middle;
}

.sacp-fb .sacp-fb-grid thead th,
.sacp-fb .sacp-fb-grid thead td,
.sacp-fb .sacp-fb-grid tbody td {
	padding: 4.9px;
	text-align: center;
}

.sacp-fb .sacp-fb-grid tbody tr {
	border-top: 1px solid var(--sacp-fb-line);
}

.sacp-fb .sacp-fb-grid tbody tr:last-child {
	border-bottom: 1px solid var(--sacp-fb-line);
}

.sacp-fb .sacp-fb-grid tbody th {
	padding: 14px;
	text-align: left;
	word-break: break-word; /* older Safari, which lacks overflow-wrap: anywhere */
	overflow-wrap: anywhere;
}

.sacp-fb .sacp-fb-grid tbody td {
	cursor: pointer;
}

/* The break hints after "/" in long labels are only wanted on phones (switched on below). */
.sacp-fb .sacp-fb-grid wbr {
	display: none;
}

.sacp-fb .sacp-fb-grid input[type="radio"] {
	width: 16.8px;
	height: 16.8px;
	margin: 0;
	padding: 0;
	accent-color: #0f4f8a;
	vertical-align: middle;
	cursor: pointer;
}

.sacp-fb .sacp-fb-grid input[type="radio"]:focus-visible {
	outline: 2px solid var(--sacp-fb-gold);
	outline-offset: 2px;
}

.sacp-fb .sacp-fb-grid tr.is-missing th {
	color: var(--sacp-fb-red);
}

/* ------------------------------------------------------------------ */
/* Submit                                                              */
/* ------------------------------------------------------------------ */

.sacp-fb .sacp-fb-actions {
	margin: 0;
	padding: 48px 0 0;
}

.sacp-fb .sacp-fb-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-width: 110px;
	height: 44.8px;
	margin: 0;
	padding: 0 24px;
	border: 2px solid rgba(0, 0, 0, 0.07);
	border-radius: 5.25px;
	background: var(--sacp-fb-navy);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: normal;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity 0.2s;
}

.sacp-fb .sacp-fb-submit:hover {
	opacity: 0.9;
}

.sacp-fb .sacp-fb-submit:focus-visible {
	outline: 2px solid var(--sacp-fb-gold);
	outline-offset: 2px;
}

.sacp-fb .sacp-fb-submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

.sacp-fb .sacp-fb-submit-icon {
	display: block;
	flex: none;
	width: 17.5px;
	height: 17.5px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M2.01 21 23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sacp-fb .sacp-fb-submit-label {
	font-size: 12.7273px;
}

.sacp-fb .sacp-fb-status {
	margin: 12px 0 0;
	color: var(--sacp-fb-red);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
}

.sacp-fb .sacp-fb-status:empty {
	display: none;
}

/* Trap field for scripts — off-screen rather than display:none, which some scripts skip. */
.sacp-fb .sacp-fb-trap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Thank-you                                                           */
/* ------------------------------------------------------------------ */

.sacp-fb .sacp-fb-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 182px;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.5;
	text-align: center;
	white-space: pre-line;
}

.sacp-fb .sacp-fb-success:focus {
	outline: 0;
}

/* ------------------------------------------------------------------ */
/* Phones                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	/* 16px stops iOS Safari zooming the page when a field is focused. */
	.sacp-fb .sacp-fb-control {
		font-size: 16px;
	}
}

@media (max-width: 600px) {
	.sacp-fb .sacp-fb-form,
	.sacp-fb .sacp-fb-success {
		padding: 19px 7px 54px;
	}

	.sacp-fb .sacp-fb-success {
		padding-bottom: 19px;
	}

	/* Fixed score columns and a flexible label column: all five scores always fit. */
	.sacp-fb .sacp-fb-grid col.sacp-fb-col {
		width: 40px;
	}

	.sacp-fb .sacp-fb-grid wbr {
		display: inline;
	}

	.sacp-fb .sacp-fb-grid thead th,
	.sacp-fb .sacp-fb-grid thead td,
	.sacp-fb .sacp-fb-grid tbody td {
		padding: 4.9px 2px;
	}

	.sacp-fb .sacp-fb-grid tbody th {
		padding: 13px 6px 13px 8px;
	}
}

@media (max-width: 360px) {
	.sacp-fb .sacp-fb-grid {
		font-size: 13px;
	}

	.sacp-fb .sacp-fb-grid col.sacp-fb-col {
		width: 35px;
	}

	.sacp-fb .sacp-fb-grid tbody th {
		padding: 12px 4px;
	}
}
