/* Enquiry form.
   Colours inherit from the theme's custom properties where they exist, with
   plain fallbacks so the form still looks right in any other theme. */

.nimb-enq {
	background: var(--surface, #fff);
	border: 1px solid var(--line, #dde4ed);
	border-radius: var(--radius-lg, 16px);
	padding: 26px;
	box-shadow: var(--shadow-sm, 0 1px 3px rgba(16, 35, 59, .08));
}

.nimb-enq__title {
	font-size: 1.15rem;
	margin: 0 0 .4em;
	color: var(--brand-dark, #0c2a4e);
}

.nimb-enq__intro {
	margin: 0 0 1.2em;
	font-size: .93rem;
	color: var(--ink-soft, #4a5a70);
}

.nimb-enq__field {
	margin-bottom: 14px;
}

.nimb-enq__label {
	display: block;
	font-size: .88rem;
	font-weight: 600;
	margin-bottom: 5px;
	color: var(--ink, #10233b);
}

.nimb-enq__req {
	color: #b32d2e;
	margin-left: 2px;
}

.nimb-enq input[type="text"],
.nimb-enq input[type="tel"],
.nimb-enq input[type="email"],
.nimb-enq select,
.nimb-enq textarea {
	width: 100%;
	padding: 11px 13px;
	font: inherit;
	font-size: .95rem;
	color: var(--ink, #10233b);
	background: #fff;
	border: 1px solid var(--line, #dde4ed);
	border-radius: var(--radius, 10px);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.nimb-enq input:focus,
.nimb-enq select:focus,
.nimb-enq textarea:focus {
	outline: none;
	border-color: var(--brand, #123a6b);
	box-shadow: 0 0 0 3px rgba(18, 58, 107, .13);
}

.nimb-enq textarea {
	resize: vertical;
	min-height: 76px;
}

/* Validation */
.nimb-enq__error {
	display: none;
	margin-top: 5px;
	font-size: .82rem;
	color: #b32d2e;
}

.nimb-enq__field.is-invalid .nimb-enq__error {
	display: block;
}

.nimb-enq__field.is-invalid input,
.nimb-enq__field.is-invalid select,
.nimb-enq__field.is-invalid textarea {
	border-color: #b32d2e;
	background: #fff8f8;
}

/* Honeypot: off-screen rather than display:none, since some bots skip
   fields that are explicitly hidden. */
.nimb-enq__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nimb-enq__submit {
	width: 100%;
	padding: 14px 22px;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	background: var(--accent, #c8770f);
	border: 0;
	border-radius: var(--radius, 10px);
	cursor: pointer;
	transition: background-color .15s ease, opacity .15s ease;
}

.nimb-enq__submit:hover {
	background: #ab6509;
}

.nimb-enq__submit:disabled {
	opacity: .6;
	cursor: default;
}

.nimb-enq__submit.is-busy::after {
	content: "…";
}

.nimb-enq__consent {
	margin: 12px 0 0;
	font-size: .78rem;
	color: var(--ink-faint, #6b7a8f);
	text-align: center;
}

/* Result message */
.nimb-enq__message {
	padding: 16px 18px;
	border-radius: var(--radius, 10px);
	margin-bottom: 16px;
	font-size: .95rem;
}

.nimb-enq__message.is-success {
	background: #eaf6ef;
	border-left: 4px solid #1f7a4d;
	color: #14512f;
}

.nimb-enq__message.is-error {
	background: #fdf0f0;
	border-left: 4px solid #b32d2e;
	color: #7d2021;
}

/* Compact variant, for narrow sidebars */
.nimb-enq--compact {
	padding: 20px;
}

.nimb-enq--compact .nimb-enq__field {
	margin-bottom: 11px;
}

.nimb-enq--compact .nimb-enq__intro {
	font-size: .87rem;
	margin-bottom: 1em;
}

@media (max-width: 620px) {
	.nimb-enq {
		padding: 20px;
	}
}

/* --------------------------------------------------------------------------
   Optional fields, behind a disclosure
   -----------------------------------------------------------------------

   The toggle is styled as a quiet inline control rather than a button. It is
   an escape hatch for the minority who want to say more, and a button would
   compete with the one thing this form wants the reader to press. */
.nimb-enq__more {
	margin: 4px 0 18px;
}

.nimb-enq__more-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	/* Comfortably past the 44px minimum, because this is a small target that
	   sits between two large ones and a mis-tap opens or closes the panel. */
	min-height: 44px;
	padding: 4px 2px;
	color: var(--brand, #123a6b);
	font-size: .92rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

/* Safari still paints the default triangle through ::-webkit-details-marker
   even when list-style is none, so both have to be suppressed. */
.nimb-enq__more-toggle::-webkit-details-marker { display: none; }

.nimb-enq__more-toggle::before {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform .18s ease;
}

.nimb-enq__more[open] > .nimb-enq__more-toggle::before {
	transform: rotate(-135deg) translate(-2px, -2px);
}

.nimb-enq__more-toggle:hover,
.nimb-enq__more-toggle:focus-visible {
	text-decoration: underline;
}

.nimb-enq__more-body {
	padding-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
	.nimb-enq__more-toggle::before { transition: none; }
}

/* --------------------------------------------------------------------------
   The dialog
   -----------------------------------------------------------------------

   <dialog> arrives with browser defaults that have to be cleared: a border, a
   fixed max-width and max-height, and auto margins that sit it slightly above
   centre. */
.nimb-enq-modal {
	width: min(560px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(8, 24, 45, .30);
	overflow: hidden;
}

/* ::backdrop is not inherited and cannot be styled through the dialog, so the
   scrim is declared here or not at all. */
.nimb-enq-modal::backdrop {
	background: rgba(8, 24, 45, .58);
	backdrop-filter: blur(2px);
}

.nimb-enq-modal__inner {
	position: relative;
	padding: 28px 26px 24px;
	/* The form is taller than a phone in landscape, so the panel scrolls
	   rather than the page behind it. */
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.nimb-enq-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	/* 44px: the close control is the one thing a frustrated person stabs at,
	   and a miss that lands on the form is worse than a miss that lands on
	   nothing. */
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #4a5a70;
	cursor: pointer;
}
.nimb-enq-modal__close:hover,
.nimb-enq-modal__close:focus-visible {
	background: #eef2f8;
	color: #10233b;
}

.nimb-enq-modal .nimb-enq__title {
	margin: 0 44px 6px 0;
	font-size: 1.25rem;
}

/* The animation is small on purpose. A modal that slides a long way reads as
   slow the second time somebody opens it. */
@media (prefers-reduced-motion: no-preference) {
	.nimb-enq-modal[open] {
		animation: nimb-enq-in .18s ease-out;
	}
	@keyframes nimb-enq-in {
		from { opacity: 0; transform: translateY(8px) scale(.99); }
		to   { opacity: 1; transform: none; }
	}
}

/* On a phone the dialog becomes a sheet: full width, anchored to the bottom,
   where a thumb already is. */
@media (max-width: 560px) {
	.nimb-enq-modal {
		width: 100vw;
		margin: 0;
		margin-top: auto;
		border-radius: 16px 16px 0 0;
		max-height: 92vh;
		max-height: 92dvh;
	}
	.nimb-enq-modal__inner {
		max-height: 92vh;
		max-height: 92dvh;
		padding: 24px 18px 20px;
	}
}
