/* ECM Event RSVP — front end
   Palette is limited to the site's own two colours: #c8a653 and #000000.
   Everything else is white or a transparency of black. */

.ecm-rsvp {
	--ecm-gold: #c8a653;
	--ecm-black: #000000;
	--ecm-gradient: linear-gradient(90deg, var(--ecm-gold) 0%, rgb(0, 0, 0) 100%);
	--ecm-surface: #f7f7f7;
	--ecm-line: rgba(0, 0, 0, .12);
	--ecm-muted: rgba(0, 0, 0, .62);
	font-size: 16px;
	line-height: 1.55;
}

.ecm-rsvp *,
.ecm-rsvp *::before,
.ecm-rsvp *::after {
	box-sizing: border-box;
}

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

.ecm-rsvp__card {
	background: var(--ecm-surface);
	border: 1px solid rgba(0, 0, 0, .06);
	border-radius: 2px;
	padding: 32px 34px;
}

.ecm-rsvp__heading {
	margin: 0 0 16px;
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.25;
	color: #1a1a1a;
}

.ecm-rsvp__intro {
	margin: 0 0 22px;
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.65;
	color: #3a3a3a;
}

.ecm-rsvp__intro p {
	margin: 0 0 4px;
}

.ecm-rsvp__intro p:last-child {
	margin-bottom: 0;
}

/* ---------- Seat meter ---------- */

.ecm-rsvp__meter {
	margin: 0 0 18px;
}

.ecm-rsvp__meter-bar {
	height: 6px;
	border-radius: 99px;
	background: rgba(0, 0, 0, .1);
	overflow: hidden;
}

.ecm-rsvp__meter-bar span {
	display: block;
	height: 100%;
	background: var(--ecm-gold);
	transition: width .4s ease;
}

.ecm-rsvp__meter-text {
	margin: 8px 0 0;
	font-size: .875rem;
	color: var(--ecm-muted);
	letter-spacing: .01em;
}

.ecm-rsvp__meter-text strong {
	color: var(--ecm-black);
}

/* ---------- Buttons ---------- */

.ecm-rsvp__btn,
.ecm-rsvp__submit {
	display: inline-block;
	appearance: none;
	border: 0;
	cursor: pointer;
	padding: 14px 30px;
	font: inherit;
	font-weight: 700;
	letter-spacing: .02em;
	color: #fff;
	text-decoration: none;
	background-image: var(--ecm-gradient);
	transition: filter .2s ease, transform .1s ease;
}

.ecm-rsvp__btn:hover,
.ecm-rsvp__submit:hover {
	filter: brightness(1.15);
	color: #fff;
}

.ecm-rsvp__btn:active,
.ecm-rsvp__submit:active {
	transform: translateY(1px);
}

.ecm-rsvp__btn:focus-visible,
.ecm-rsvp__submit:focus-visible,
.ecm-rsvp__close:focus-visible {
	outline: 3px solid var(--ecm-gold);
	outline-offset: 2px;
}

/* The submit sits over the black end of the modal gradient, so it inverts:
   cream face, black label. Both colours are set in Settings. */
.ecm-rsvp__submit {
	background-image: none;
	background-color: #f6eace;
	color: #000000;
	min-width: 160px;
	margin-top: 8px;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.ecm-rsvp__submit:hover {
	filter: brightness(.96);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .45);
}

.ecm-rsvp__submit[disabled] {
	opacity: .6;
	cursor: default;
	box-shadow: none;
}

/* ---------- Notices & current answer ---------- */

.ecm-rsvp__notice {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-left: 3px solid var(--ecm-gold);
	background: rgba(0, 0, 0, .04);
	font-size: .9375rem;
	color: var(--ecm-muted);
}

/* Registration full / closed — black bar, gold rule. No off-palette red. */
.ecm-rsvp__notice--stop {
	border-left-color: var(--ecm-gold);
	border-left-width: 4px;
	background: var(--ecm-black);
	color: #fff;
	font-weight: 600;
}

.ecm-rsvp__answer {
	margin: 0 0 14px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--ecm-line);
	border-left: 3px solid var(--ecm-gold);
	border-radius: 3px;
	font-size: .9375rem;
	color: var(--ecm-black);
}

/* Responses are told apart by fill, not by hue. */
.ecm-rsvp__answer-tick {
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 8px;
	border-radius: 50%;
	border: 2px solid var(--ecm-black);
	background: transparent;
	vertical-align: middle;
}

.ecm-rsvp__answer--yes .ecm-rsvp__answer-tick {
	background: var(--ecm-gold);
	border-color: var(--ecm-gold);
}

.ecm-rsvp__answer--no .ecm-rsvp__answer-tick {
	background: var(--ecm-black);
	border-color: var(--ecm-black);
}

.ecm-rsvp__answer--maybe .ecm-rsvp__answer-tick {
	background: transparent;
	border-color: var(--ecm-gold);
}

.ecm-rsvp__answer--waitlist .ecm-rsvp__answer-tick {
	background: transparent;
	border-color: var(--ecm-black);
}

/* ---------- Modal ---------- */

.ecm-rsvp__modal[hidden] {
	display: none;
}

.ecm-rsvp__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ecm-rsvp__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .6);
}

.ecm-rsvp__dialog {
	position: relative;
	width: 100%;
	max-width: 620px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 40px;
	border: 4px solid var(--ecm-black);
	background-image: linear-gradient(90deg, var(--ecm-gold) 0%, rgb(0, 0, 0) 100%);
	color: #fff;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
	animation: ecm-rsvp-in .22s ease-out;
}

/* White on #c8a653 alone is only ~2:1 contrast, so a flat scrim sits over the
   gradient. The gradient still reads gold-to-black; the text becomes legible. */
.ecm-rsvp__dialog::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .3);
	pointer-events: none;
}

.ecm-rsvp__dialog > * {
	position: relative;
	z-index: 1;
}

@keyframes ecm-rsvp-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ecm-rsvp__dialog { animation: none; }
	.ecm-rsvp__meter-bar span { transition: none; }
}

.ecm-rsvp__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	line-height: 0;
	cursor: pointer;
	opacity: .85;
	transition: opacity .15s ease;
}

.ecm-rsvp__close:hover {
	opacity: 1;
}

.ecm-rsvp__title {
	margin: 0 0 16px;
	padding-right: 30px;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	text-align: center;
}

.ecm-rsvp__lead {
	margin: 0 0 6px;
	font-size: 1.0625rem;
	line-height: 1.55;
	color: #fff;
	text-align: center;
}

.ecm-rsvp__required {
	margin-left: 2px;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1;
	color: #f6eace;
	vertical-align: super;
}

/* ---------- Choices ---------- */

.ecm-rsvp__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 22px 0 4px;
	padding: 0;
	border: 0;
}

.ecm-rsvp__choice {
	flex: 1 1 120px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	font-size: 1.0625rem;
	color: #fff;
	background: rgba(255, 255, 255, .12);
	border: 1px solid rgba(255, 255, 255, .35);
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.ecm-rsvp__choice:hover {
	background: rgba(255, 255, 255, .22);
}

.ecm-rsvp__choice:has(input:checked) {
	background: var(--ecm-gold);
	border-color: var(--ecm-black);
	color: var(--ecm-black);
	font-weight: 700;
}

.ecm-rsvp__choice input {
	margin: 0;
	width: 18px;
	height: 18px;
	accent-color: var(--ecm-black);
}

/* ---------- Fields ---------- */

.ecm-rsvp__field {
	margin-top: 16px;
}

.ecm-rsvp__field[hidden] {
	display: none;
}

.ecm-rsvp__field label {
	display: block;
	margin-bottom: 6px;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
}

.ecm-rsvp__field input,
.ecm-rsvp__field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, .5);
	background: #fff;
	color: var(--ecm-black);
	font: inherit;
	border-radius: 2px;
}

.ecm-rsvp__field input:focus,
.ecm-rsvp__field textarea:focus {
	outline: 2px solid var(--ecm-gold);
	outline-offset: 1px;
}

.ecm-rsvp__hint {
	margin: 6px 0 0;
	font-size: .875rem;
	color: #fff;
	opacity: .9;
}

.ecm-rsvp__error {
	margin: 18px 0 0;
	padding: 12px 14px;
	background: var(--ecm-black);
	border-left: 4px solid var(--ecm-gold);
	color: #fff;
	font-size: .9375rem;
	line-height: 1.5;
	font-weight: 600;
}

.ecm-rsvp__error[hidden],
.ecm-rsvp__done[hidden] {
	display: none;
}

.ecm-rsvp__form {
	text-align: center;
}

.ecm-rsvp__field,
.ecm-rsvp__error {
	text-align: left;
}

.ecm-rsvp__done {
	text-align: center;
	padding: 8px 0;
}

.ecm-rsvp__done .ecm-rsvp__title {
	color: #fff;
	text-align: center;
}

.ecm-rsvp__done-message {
	margin: 0 auto 26px;
	max-width: 44ch;
	font-size: 1.125rem;
	line-height: 1.6;
	color: #fff;
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
	.ecm-rsvp__card { padding: 22px 18px; }
	.ecm-rsvp__dialog { padding: 30px 20px; }
	.ecm-rsvp__choices { flex-direction: column; }
	.ecm-rsvp__btn,
	.ecm-rsvp__submit { width: 100%; }
}

.ecm-rsvp .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Cancel registration ---------- */

.ecm-rsvp__cancel-wrap {
	margin: 14px 0 0;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
}

.ecm-rsvp__cancel {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: .875rem;
	font-weight: 600;
	color: var(--ecm-black);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: var(--ecm-gold);
	text-decoration-thickness: 2px;
	cursor: pointer;
}

.ecm-rsvp__cancel:hover {
	color: var(--ecm-gold);
}

.ecm-rsvp__cancel[disabled] {
	opacity: .6;
	cursor: default;
	text-decoration: none;
}

.ecm-rsvp__cancel-hint {
	font-size: .8125rem;
	color: var(--ecm-muted);
}

.ecm-rsvp__flash {
	margin: 0 0 16px;
	padding: 12px 14px;
	background: var(--ecm-black);
	border-left: 4px solid var(--ecm-gold);
	color: #fff;
	font-size: .9375rem;
	font-weight: 600;
}

/* ---------- Honeypot ---------- */

.ecm-rsvp__trap {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}
