/**
 * Front-end styles for the reservation form.
 * Scoped under .ccm-reservation so it cannot bleed into the theme.
 */

.ccm-reservation {
	--ccm-brand: #2f7bee;
	--ccm-brand-dark: #1f5fc4;
	--ccm-ink: #16191d;
	--ccm-muted: #5b636d;
	--ccm-line: #dde1e6;
	--ccm-bg: #ffffff;
	--ccm-field: #ffffff;
	--ccm-ok-bg: #e9f6ec;
	--ccm-ok-ink: #14602a;
	--ccm-err-bg: #fdeceb;
	--ccm-err-ink: #8a1c13;
	--ccm-radius: 10px;

	max-width: 640px;
	margin: 2.5rem auto;
	padding: 1.75rem;
	background: var(--ccm-bg);
	border: 1px solid var(--ccm-line);
	border-radius: var(--ccm-radius);
	color: var(--ccm-ink);
	font-size: 16px;
	line-height: 1.55;
	box-sizing: border-box;
}

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

/* --- Header ------------------------------------------------------------ */

.ccm-reservation__head {
	border-bottom: 1px solid var(--ccm-line);
	padding-bottom: 1rem;
	margin-bottom: 1.25rem;
}

.ccm-reservation__title {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	line-height: 1.25;
}

.ccm-reservation__status {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
}

.ccm-reservation__status.is-open {
	color: var(--ccm-brand);
}

.ccm-reservation__status.is-full {
	color: var(--ccm-muted);
}

.ccm-reservation__status strong {
	font-size: 1.15rem;
}

.ccm-reservation__sub {
	display: block;
	font-weight: 400;
	font-size: 0.85rem;
	color: var(--ccm-muted);
	margin-top: 2px;
}

.ccm-reservation__bar {
	margin-top: 0.75rem;
	height: 8px;
	background: #eef1f4;
	border-radius: 999px;
	overflow: hidden;
}

.ccm-reservation__bar > span {
	display: block;
	height: 100%;
	background: var(--ccm-brand);
	border-radius: 999px;
	transition: width 0.4s ease;
}

/* --- Facts ------------------------------------------------------------- */

.ccm-reservation__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin: 0 0 1.25rem;
	padding: 0;
}

.ccm-reservation__facts dt {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ccm-muted);
	margin: 0 0 2px;
}

.ccm-reservation__facts dd {
	margin: 0;
	font-weight: 600;
}

.ccm-reservation__lede,
.ccm-reservation__closed {
	margin: 0 0 1.25rem;
	color: var(--ccm-muted);
	font-size: 0.95rem;
}

.ccm-reservation__closed {
	padding: 1rem;
	background: #f5f7f9;
	border-radius: 8px;
	margin-bottom: 0;
}

/* --- Notices ----------------------------------------------------------- */

.ccm-notice {
	padding: 0.9rem 1rem;
	border-radius: 8px;
	margin: 0 0 1.25rem;
	font-size: 0.95rem;
	border-left: 4px solid transparent;
}

.ccm-notice:focus {
	outline: 2px solid var(--ccm-brand);
	outline-offset: 2px;
}

.ccm-notice--success {
	background: var(--ccm-ok-bg);
	color: var(--ccm-ok-ink);
	border-left-color: #2e8b4f;
}

.ccm-notice--error {
	background: var(--ccm-err-bg);
	color: var(--ccm-err-ink);
	border-left-color: #c0392b;
}

/* --- Form -------------------------------------------------------------- */

.ccm-form__row {
	margin-bottom: 1.1rem;
}

.ccm-form__row--narrow {
	max-width: 160px;
}

.ccm-form label {
	display: block;
	font-weight: 600;
	font-size: 0.92rem;
	margin-bottom: 0.35rem;
}

.ccm-req {
	color: #c0392b;
}

.ccm-form input[type="text"],
.ccm-form input[type="email"],
.ccm-form select,
.ccm-form textarea {
	width: 100%;
	padding: 0.7rem 0.85rem;
	font: inherit;
	font-size: 16px; /* Stops iOS zooming the page on focus. */
	color: var(--ccm-ink);
	background: var(--ccm-field);
	border: 1px solid var(--ccm-line);
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ccm-form input:focus,
.ccm-form select:focus,
.ccm-form textarea:focus {
	outline: none;
	border-color: var(--ccm-brand);
	box-shadow: 0 0 0 3px rgba(47, 123, 238, 0.18);
}

.ccm-form input[aria-invalid="true"] {
	border-color: #c0392b;
}

.ccm-form textarea {
	resize: vertical;
	min-height: 84px;
}

.ccm-help {
	margin: 0.35rem 0 0;
	font-size: 0.83rem;
	color: var(--ccm-muted);
}

.ccm-field-error {
	margin: 0.35rem 0 0;
	font-size: 0.83rem;
	color: #c0392b;
	font-weight: 600;
}

/* Checkbox row: the label wraps the control, so undo the block styling. */
.ccm-form__row--check label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-weight: 400;
	font-size: 0.9rem;
	color: var(--ccm-muted);
	cursor: pointer;
}

.ccm-form__row--check input {
	margin-top: 0.25rem;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	accent-color: var(--ccm-brand);
}

.ccm-form__submit {
	display: inline-block;
	width: 100%;
	padding: 0.95rem 1.5rem;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	color: #fff;
	background: var(--ccm-brand);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
}

.ccm-form__submit:hover {
	background: var(--ccm-brand-dark);
}

.ccm-form__submit:active {
	transform: translateY(1px);
}

.ccm-form__submit:focus-visible {
	outline: 3px solid var(--ccm-brand);
	outline-offset: 2px;
}

.ccm-form__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.ccm-form__fineprint {
	margin: 0.9rem 0 0;
	font-size: 0.82rem;
	color: var(--ccm-muted);
	text-align: center;
}

.ccm-form__fineprint a {
	color: var(--ccm-brand);
}

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.ccm-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Dark mode --------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.ccm-reservation {
		--ccm-ink: #e8eaed;
		--ccm-muted: #a4acb6;
		--ccm-line: #333940;
		--ccm-bg: #1b1f24;
		--ccm-field: #24292f;
		--ccm-ok-bg: #163a22;
		--ccm-ok-ink: #8fe0a8;
		--ccm-err-bg: #3d1b18;
		--ccm-err-ink: #f2a49c;
	}

	.ccm-reservation__bar {
		background: #2c323a;
	}

	.ccm-reservation__closed {
		background: #24292f;
	}
}

/* --- Small screens ----------------------------------------------------- */

@media (max-width: 600px) {
	.ccm-reservation {
		margin: 1.5rem 0;
		padding: 1.25rem;
		border-radius: 8px;
	}

	.ccm-reservation__title {
		font-size: 1.3rem;
	}

	.ccm-reservation__facts {
		gap: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccm-reservation *,
	.ccm-reservation *::before,
	.ccm-reservation *::after {
		transition-duration: 0.01ms !important;
	}
}
