/**
 * Booking calendar.
 *
 * Divi's own button and input rules are specific and land late, so anything that
 * fights them is prefixed with `body`. Sizes are capped in ch/rem rather than
 * percentages: a name box that runs the full width of a desktop screen was the
 * thing that made these forms feel like paperwork.
 */

.ngs-book {
	--ngs-navy:    #13305F;   /* primary buttons & key CTAs                 */
	--ngs-accent:  #6BB1AD;   /* hover states & accents — never behind white */
	--ngs-mist:    #A7BCBD;   /* borders & dividers ONLY — 1.99:1, not text  */
	--ngs-cream:   #DDECEC;   /* page backgrounds & light sections           */
	--ngs-surface: #D7E1E0;   /* cards, modules & input fields               */
	--ngs-band:    #A6BDBD;   /* section bands — body text only, 4.51:1      */
	--ngs-ink:     #324A72;   /* body text & headings                        */
	--ngs-muted:   #546A8A;   /* subtle text, still AA on cream and on white */

	max-width: 760px;
	margin: 0 auto;
	text-align: left;
}

/* --------------------------------------------------------------- progress */

.ngs-steps {
	display: flex;
	gap: 6px;
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	counter-reset: none;
}

.ngs-steps li {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ngs-muted);
	padding: 0 0 10px;
	border-bottom: 3px solid var(--ngs-cream);
	transition: color .2s, border-color .2s;
}

.ngs-steps li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	border-radius: 50%;
	background: var(--ngs-cream);
	color: var(--ngs-muted);
	font-size: 13px;
}

.ngs-steps li.is-current { color: var(--ngs-ink); border-bottom-color: var(--ngs-navy); }
.ngs-steps li.is-current span { background: var(--ngs-navy); color: #fff; }
.ngs-steps li.is-done { color: var(--ngs-ink); border-bottom-color: var(--ngs-surface); }
.ngs-steps li.is-done span { background: var(--ngs-surface); color: var(--ngs-ink); }

/* ------------------------------------------------------------------ steps */

.ngs-step {
	margin: 0 0 34px;
	transition: opacity .2s;
}

/* Locked steps stay in the flow so the page does not jump as they open. The `inert`
   attribute is what actually disables them (set in booking.js) — `pointer-events` alone
   stops the mouse but leaves every control in the keyboard tab order. .35 was faint
   enough to read as an artefact rather than a disabled control. */
.ngs-step.is-locked {
	opacity: .45;
	pointer-events: none;
	filter: grayscale(1);
}

.ngs-step-h {
	font-size: 21px;
	line-height: 1.3;
	margin: 0 0 12px;
	color: var(--ngs-ink);
}

.ngs-book h4 {
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ngs-navy);
	margin: 20px 0 10px;
}

.ngs-book .ngs-sub {
	margin-top: 30px;
	padding-top: 22px;
	border-top: 1px solid var(--ngs-cream);
}

.ngs-hint {
	font-size: 14px;
	line-height: 1.5;
	color: var(--ngs-muted);
	margin: 6px 0 0;
}

/* ------------------------------------------------------------ the fields */

body .ngs-book .ngs-select,
body .ngs-book input[type="text"],
body .ngs-book input[type="email"],
body .ngs-book input[type="tel"],
body .ngs-book select,
body .ngs-book textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-size: 16px;               /* below 16 and iOS zooms on focus */
	line-height: 1.4;
	padding: 11px 13px;
	border: 1px solid var(--ngs-mist);
	border-radius: 8px;
	background: #fff;
	color: var(--ngs-ink);
	height: auto;
	min-height: 46px;
}

body .ngs-book textarea { min-height: 90px; }

body .ngs-book .ngs-select { max-width: 30rem; }

body .ngs-book input:focus,
body .ngs-book select:focus,
body .ngs-book textarea:focus {
	border-color: var(--ngs-navy);
	box-shadow: 0 0 0 3px rgba(90, 116, 139, .18);
}
/* The soft glow above is a *hover-weight* cue and is not enough on its own for keyboard
   users, so keyboard focus additionally gets the real ring (see the :focus-visible block
   in ngs-core). Mouse users never see it. */
body .ngs-book input:focus:not(:focus-visible),
body .ngs-book select:focus:not(:focus-visible),
body .ngs-book textarea:focus:not(:focus-visible) {
	outline: none;
}

body .ngs-book .is-bad { border-color: #c0392b; background: #fdf6f5; }

/* Two per row on desktop, one on mobile — and never wider than is readable. */
.ngs-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px 20px;
	max-width: 620px;
}

.ngs-field { margin: 0; }
.ngs-field-wide { max-width: 620px; margin-top: 14px; }

.ngs-field label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--ngs-ink);
	margin: 0 0 5px;
}

.ngs-field label span { color: #b0553f; }
.ngs-field .ngs-hint { display: block; margin-top: 4px; }

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

.ngs-summary {
	background: var(--ngs-cream);
	border-left: 4px solid var(--ngs-navy);
	border-radius: 6px;
	padding: 14px 16px;
	margin: 0 0 22px;
	font-size: 16px;
	line-height: 1.5;
	color: var(--ngs-ink);
}

.ngs-book-error {
	background: #fdf1ef;
	border-left: 4px solid #c0392b;
	border-radius: 6px;
	padding: 12px 15px;
	margin: 18px 0;
	color: #8f2f22;
	font-size: 15px;
}

/* --------------------------------------------------------------- calendar */

.ngs-cal {
	max-width: 460px;
	border: 1px solid var(--ngs-cream);
	border-radius: 14px;
	padding: 16px;
	background: #fff;
}

.ngs-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 12px;
}

.ngs-cal-title {
	font-size: 17px;
	color: var(--ngs-ink);
}

body .ngs-cal-nav {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--ngs-mist);
	border-radius: 50%;
	background: #fff;
	color: var(--ngs-navy);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

body .ngs-cal-nav:hover:not(:disabled) { background: var(--ngs-cream); }
body .ngs-cal-nav:disabled { opacity: .3; cursor: default; }

.ngs-cal-dow,
.ngs-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.ngs-cal-dow {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--ngs-muted);
	text-align: center;
	text-transform: uppercase;
}

body .ngs-day {
	position: relative;
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 9px;
	background: var(--ngs-cream);
	color: var(--ngs-ink);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s, color .15s;
}

body .ngs-day:hover:not(:disabled) { background: var(--ngs-surface); }

body .ngs-day.is-off {
	background: transparent;
	color: #c3ccd2;
	cursor: default;
}

body .ngs-day.is-today { border-color: var(--ngs-mist); }

body .ngs-day.is-picked,
body .ngs-day.is-picked:hover {
	background: var(--ngs-navy);
	color: #fff;
}

.ngs-dots { display: flex; gap: 3px; height: 5px; }

.ngs-dots i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--ngs-navy);
}

body .ngs-day.is-picked .ngs-dots i { background: #fff; }

.ngs-cal-key {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 14px 0 0;
	font-size: 13px;
	color: var(--ngs-muted);
}

.ngs-cal-key .ngs-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ngs-navy);
	display: inline-block;
}

/* ------------------------------------------------------------------ chips */

.ngs-windows { margin: 0 0 4px; }
.ngs-windows .ngs-hint { margin: 0 0 10px; }
.ngs-chips { display: flex; flex-wrap: wrap; gap: 8px; }

body .ngs-chip {
	display: inline-block;
	margin: 0 8px 8px 0;
	padding: 10px 16px;
	border: 1px solid var(--ngs-mist);
	border-radius: 999px;
	background: #fff;
	color: var(--ngs-ink);
	font-size: 15px;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}

body .ngs-chips .ngs-chip { margin: 0; }
body .ngs-chip:hover { border-color: var(--ngs-navy); background: var(--ngs-cream); }

body .ngs-chip.is-on {
	background: var(--ngs-navy);
	border-color: var(--ngs-navy);
	color: #fff;
}

/* ----------------------------------------------------------------- submit */

body .ngs-book .ngs-submit {
	margin-top: 26px;
	padding: .7em 2em;
	font-size: 17px;
	border-radius: 999px;
	border: 2px solid var(--ngs-navy);
	background: var(--ngs-navy);
	color: #fff;
	cursor: pointer;
}

body .ngs-book .ngs-submit:hover { background: var(--ngs-accent); border-color: var(--ngs-accent); color: var(--ngs-navy); }
body .ngs-book .ngs-submit:disabled { opacity: .6; cursor: default; }

.ngs-book-done {
	background: var(--ngs-surface);
	border-radius: 14px;
	padding: 28px 30px;
	color: var(--ngs-ink);
}

.ngs-book-done h3 { margin: 0 0 10px; color: var(--ngs-ink); }
.ngs-book-done p { margin: 0 0 12px; line-height: 1.6; }
.ngs-book-done p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
	.ngs-steps li { font-size: 0; gap: 0; justify-content: center; }
	.ngs-steps li span { font-size: 13px; }
	.ngs-cal { padding: 12px; }
	.ngs-step-h { font-size: 19px; }
}


/* --------------------------------------------------------------- touch targets
   Month arrows are 40px on a mouse, which is fine, but a thumb wants 44. Bump them
   (and the day cells, if a narrow screen has squeezed them) wherever the pointer is
   coarse rather than at a width breakpoint — a touchscreen laptop needs this too. */
@media (pointer: coarse) {
	body .ngs-cal-nav { width: 44px; height: 44px; }
	body .ngs-day     { min-height: 44px; }
	body .ngs-chip    { min-height: 44px; }
}
