/*
 * Icedive booking form. A calm, compact form on one dark panel that matches the site:
 * small text, thin dividers between sections, dark see-through inputs, short fields three to a row.
 */

/* Space above and below the form. Padding, because the theme resets the margins of page content. */
.icedive-booking-wrap {
	box-sizing: border-box;
	max-width: 40rem;
	margin-inline: auto;
	padding-block: clamp(1.75rem, 5vw, 3rem) clamp(2rem, 6vw, 3.5rem);
	font-size: 0.8125rem;
	line-height: 1.4;
}

/* The site's global styles give every paragraph the full body size; inside the form, follow the form. */
.icedive-booking-wrap :where(p) {
	font-size: inherit;
}

.icedive-booking {
	display: grid;
	gap: 0.8rem;
	padding: 0.9rem 1rem 1rem;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.55);
	color-scheme: dark;
	container-type: inline-size;
}

@media (min-width: 700px) {
	.icedive-booking {
		padding: 1rem 1.25rem 1.1rem;
	}
}

/* Sections and diver blocks: no boxes, just a thin line between them. */
.icedive-booking .icedive-section,
.icedive-booking .icedive-diver {
	margin: 0;
	min-width: 0;
	padding: 0.75rem 0 0;
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.icedive-booking .icedive-section:first-of-type {
	padding-top: 0;
	border-top: 0;
}

.icedive-booking .icedive-section > legend {
	float: left;
	width: 100%;
	margin: 0 0 0.45rem;
	padding: 0;
	font-size: 1em;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.icedive-booking .icedive-section > legend + * {
	clear: both;
}

/* Parts of the form that follow the booking type: no frame of their own. */
.icedive-cond {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* The people on a tour or course, one block after another. */
.icedive-booking .icedive-people {
	display: grid;
	gap: 0.8rem;
}

/* What would you like to book? Three buttons in a row; the chosen one is filled. */
.icedive-type-options {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.4rem;
}

.icedive-type-option {
	position: relative;
	display: flex;
	cursor: pointer;
}

.icedive-booking .icedive-type-option input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.icedive-type-option span {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	min-height: 2.1rem;
	padding: 0.35rem 0.4rem;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.3);
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
}

.icedive-type-option:hover span {
	border-color: rgba(255, 255, 255, 0.6);
}

.icedive-type-option input:checked + span {
	border-color: #fff;
	background: #fff;
	color: #10151a;
	font-weight: 600;
}

.icedive-type-option input:focus-visible + span {
	outline: 2px solid rgba(255, 255, 255, 0.85);
	outline-offset: 2px;
}

.icedive-type-links {
	margin: 0.45rem 0 0;
}

.icedive-type-links a {
	color: inherit;
}

/* Diver blocks fold open and closed; the heading keeps the browser's own arrow. */
.icedive-diver-details > summary {
	margin: 0 0 0.45rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
}

.icedive-diver-details:not([open]) > summary {
	margin-bottom: 0;
}

/* Keep the focus ring for keyboard users only. */
.icedive-diver-details > summary:focus:not(:focus-visible) {
	outline: none;
}

.icedive-diver-name {
	font-weight: 400;
	opacity: 0.75;
}

.icedive-booking [hidden] {
	display: none !important;
}

/*
 * Very narrow forms: one column. Phones: short fields two to a row, the rest full width.
 * Wider forms: six columns, so fields take half or a third of a row.
 */
.icedive-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.5rem 0.75rem;
}

@container (min-width: 280px) {
	.icedive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.icedive-grid > * {
		grid-column: 1 / -1;
	}
	.icedive-grid > .icedive-third {
		grid-column: span 1;
	}
}

@container (min-width: 520px) {
	.icedive-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
	.icedive-grid > * {
		grid-column: span 3;
	}
	.icedive-grid > .icedive-third {
		grid-column: span 2;
	}
	.icedive-grid > .icedive-two-thirds {
		grid-column: span 4;
	}
	.icedive-grid > .icedive-wide {
		grid-column: 1 / -1;
	}
}

.icedive-field > label,
.icedive-field .icedive-inline > legend {
	display: block;
	margin: 0 0 0.15rem;
	padding: 0;
	font-weight: 500;
	opacity: 0.9;
}

.icedive-field fieldset.icedive-inline {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.icedive-field fieldset.icedive-inline .icedive-choice {
	display: inline-flex;
	margin: 0.4rem 1rem 0 0;
}

.icedive-booking input[type="text"],
.icedive-booking input[type="email"],
.icedive-booking input[type="tel"],
.icedive-booking input[type="number"],
.icedive-booking select,
.icedive-booking textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 2rem;
	padding: 0.3rem 0.5rem;
	border: 1px solid rgba(255, 255, 255, 0.26);
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.35);
	color: inherit;
	font: inherit;
	line-height: 1.3;
}

.icedive-booking textarea {
	min-height: 3.25rem;
}

.icedive-booking input:focus,
.icedive-booking select:focus,
.icedive-booking textarea:focus {
	border-color: rgba(255, 255, 255, 0.7);
	outline: 2px solid rgba(255, 255, 255, 0.2);
	outline-offset: 1px;
}

.icedive-booking input[type="radio"],
.icedive-booking input[type="checkbox"] {
	accent-color: #fff;
}

.icedive-choice {
	display: flex;
	gap: 0.45rem;
	align-items: flex-start;
	margin: 0.15rem 0;
	font-weight: 400;
	cursor: pointer;
}

.icedive-choice input {
	flex: none;
	margin: 0.2em 0 0;
}

.icedive-optional,
.icedive-payment-note {
	opacity: 0.7;
	font-size: 0.92em;
}

/* The calendar of the date fields (assets/date-field.css), in the form's colours. */
.icedive-booking .icedive-cal {
	--icedive-cal-bg: #161b20;
	--icedive-cal-text: #fff;
	--icedive-cal-border: rgba(255, 255, 255, 0.22);
	--icedive-cal-muted: rgba(255, 255, 255, 0.6);
	--icedive-cal-hover: rgba(255, 255, 255, 0.1);
	--icedive-cal-chosen-bg: #fff;
	--icedive-cal-chosen-text: #10151a;
	--icedive-cal-focus: rgba(255, 255, 255, 0.85);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}

.icedive-booking .icedive-cal select {
	min-height: 1.9rem;
	padding: 0.2rem 0.35rem;
	background-color: #0f1317;
}

/* Nitrox and own dry suit: next to the last field, wrapping as needed. */
.icedive-extras {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1rem;
	align-content: flex-start;
	padding-top: 0.1rem;
}

.icedive-extras .icedive-field {
	margin: 0;
}

.icedive-field.has-error input,
.icedive-field.has-error select,
.icedive-field.has-error textarea {
	border-color: #ff7b72;
}

.icedive-error {
	margin: 0.2rem 0 0;
	color: #ff9b94;
	font-size: 0.92em;
	font-weight: 500;
}

.icedive-notice {
	padding: 0.6rem 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-left-width: 4px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.45);
}

.icedive-notice p {
	margin: 0.2rem 0;
}

.icedive-notice--ok {
	border-left-color: #7fd18b;
}

.icedive-notice--error {
	border-left-color: #ff7b72;
}

.icedive-summary {
	padding-top: 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.icedive-estimate {
	margin: 0;
	font-size: 1.05em;
}

.icedive-payment-note {
	margin: 0.15rem 0 0.45rem;
}

.icedive-summary .icedive-check {
	margin-top: 0.25rem;
}

/* Liability release and other documents, lined up with the checkbox text above. */
.icedive-docs {
	margin: 0.1rem 0 0 1.45rem;
	font-size: 0.92em;
}

.icedive-docs a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.icedive-booking .icedive-submit {
	margin-top: 0.3rem;
	padding: 0.5rem 1.1rem;
	font-size: inherit;
}

.icedive-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
