/**
 * RootHR Booking - modal styles.
 * Namespaced under .rhb-* and reset locally so themes cannot bleed in.
 */

.rhb-overlay {
	--rhb-accent: #111111;
	--rhb-tint: #0f766e;
	--rhb-ink: #0f172a;
	--rhb-muted: #64748b;
	--rhb-line: #e2e8f0;
	--rhb-surface: #ffffff;
	--rhb-radius: 18px;
	--rhb-ease: cubic-bezier(0.16, 1, 0.3, 1);

	position: fixed;
	inset: 0;
	/* A wide element elsewhere on the page must never stretch this: clamp to
	   the viewport rather than trusting the containing block. */
	width: 100%;
	max-width: 100vw;
	max-height: 100vh;
	overflow: hidden;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 260ms var(--rhb-ease), visibility 0s linear 300ms;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.rhb-overlay.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition: opacity 260ms var(--rhb-ease), visibility 0s;
}

.rhb-overlay,
.rhb-overlay *,
.rhb-overlay *::before,
.rhb-overlay *::after {
	box-sizing: border-box;
}

.rhb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.rhb-dialog {
	position: relative;
	width: 100%;
	max-width: 940px;
	min-width: 0;
	max-height: calc(100vh - 48px);
	overflow: auto;
	background: var(--rhb-surface);
	color: var(--rhb-ink);
	border-radius: var(--rhb-radius);
	box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.05);
	transform: translateY(28px) scale(0.97);
	opacity: 0;
	transition: transform 420ms var(--rhb-ease), opacity 260ms var(--rhb-ease);
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.rhb-overlay.is-open .rhb-dialog {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* Themes love to restyle bare <button>s, so this one is pinned down hard:
   a solid dark disc reads on both the white form and the tinted panel. */
.rhb-overlay .rhb-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 0;
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #0f172a;
	color: #fff;
	font-size: 0;
	line-height: 1;
	opacity: 1;
	visibility: visible;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.28);
	transition: background 180ms ease, transform 180ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.rhb-overlay .rhb-close:hover,
.rhb-overlay .rhb-close:focus {
	background: #000;
	color: #fff;
	transform: rotate(90deg);
}

.rhb-overlay .rhb-close svg {
	display: block;
	width: 14px;
	height: 14px;
}

.rhb-overlay .rhb-close svg path {
	stroke: currentColor;
}

/* The hidden attribute must beat our own display rules. */
.rhb-overlay [hidden] {
	display: none !important;
}

.rhb-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}

.rhb-main {
	padding: 38px 34px 34px;
	min-width: 0;
}

.rhb-title {
	display: flex;
	align-items: center;
	gap: 11px;
	margin: 0 0 22px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--rhb-line);
	font-size: 25px;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--rhb-ink);
}

.rhb-title__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: rgba(15, 23, 42, 0.06);
	font-size: 20px;
	line-height: 1;
	color: #111111;
}

.rhb-overlay .rhb-submit i {
	font-size: 1.05em;
	line-height: 1;
}

.rhb-sub {
	margin: 0 0 22px;
	font-size: 14.5px;
	color: var(--rhb-muted);
}

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

.rhb-form {
	margin: 0;
}

.rhb-row {
	display: grid;
	gap: 14px;
}

.rhb-row--2 {
	grid-template-columns: 1fr 1fr;
}

.rhb-field {
	margin: 0 0 14px;
	min-width: 0;
}

.rhb-row .rhb-field {
	margin-bottom: 14px;
}

.rhb-field label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
}

.rhb-field label span[aria-hidden="true"] {
	color: var(--rhb-accent);
}

.rhb-field input[type="text"],
.rhb-field input[type="email"],
.rhb-field input[type="tel"],
.rhb-field input[type="date"],
.rhb-field input[type="time"],
.rhb-field select,
.rhb-field textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 11px 13px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--rhb-ink);
	background: #fff;
	border: 1px solid var(--rhb-line);
	border-radius: 10px;
	box-shadow: none;
	transition: border-color 160ms ease, box-shadow 160ms ease;
	appearance: none;
	-webkit-appearance: none;
}

.rhb-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 34px;
}

.rhb-field textarea {
	resize: vertical;
	min-height: 76px;
}

.rhb-field input:focus,
.rhb-field select:focus,
.rhb-field textarea:focus {
	outline: none;
	border-color: var(--rhb-accent);
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rhb-accent) 18%, transparent);
}

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

.rhb-error {
	display: none;
	margin-top: 5px;
	font-size: 12.5px;
	color: #dc2626;
}

.rhb-field.has-error .rhb-error {
	display: block;
}

/* ---------- Phone with fixed +44 prefix ---------- */

.rhb-phone {
	display: flex;
	align-items: stretch;
}

.rhb-phone__cc {
	display: flex;
	align-items: center;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: #475569;
	background: #f1f5f9;
	border: 1px solid var(--rhb-line);
	border-right: 0;
	border-radius: 10px 0 0 10px;
	transition: border-color 160ms ease;
}

.rhb-phone input[type="tel"] {
	border-radius: 0 10px 10px 0;
}

.rhb-phone:focus-within .rhb-phone__cc {
	border-color: var(--rhb-accent);
}

.rhb-field.has-error .rhb-phone__cc {
	border-color: #dc2626;
}

.rhb-hint {
	display: block;
	margin-top: 5px;
	font-size: 12px;
	color: var(--rhb-muted);
}

/* One line of guidance at a time: the error replaces the hint. */
.rhb-field.has-error .rhb-hint {
	display: none;
}

.rhb-optional {
	font-weight: 400;
	color: var(--rhb-muted);
}

.rhb-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.rhb-captcha {
	margin-bottom: 14px;
}

.rhb-captcha__widget {
	transform-origin: 0 0;
}

/* The v2 widget is a fixed 304px, so shrink it rather than letting it overflow. */
@media (max-width: 420px) {
	.rhb-captcha__widget {
		transform: scale(0.85);
		height: 65px;
	}
}

.rhb-alert {
	margin: 0 0 14px;
	padding: 11px 13px;
	font-size: 13.5px;
	border-radius: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.rhb-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 4px 0 0;
	padding: 13px 20px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--rhb-accent);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: transform 160ms var(--rhb-ease), box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
	box-shadow: none;
}

.rhb-submit:hover:not(:disabled) {
	filter: brightness(0.93);
	transform: translateY(-1px);
}

.rhb-submit:disabled {
	opacity: 0.65;
	cursor: progress;
}

.rhb-submit--ghost {
	width: auto;
	background: transparent;
	color: var(--rhb-accent);
	box-shadow: inset 0 0 0 1px var(--rhb-line);
}

.rhb-submit--ghost:hover:not(:disabled) {
	background: rgba(15, 23, 42, 0.04);
	color: var(--rhb-accent);
}

/* Themes routinely strip backgrounds off bare <button>s - this one is not
   negotiable, so it is pinned by element+class and forced. */
.rhb-overlay .rhb-form button.rhb-submit,
.rhb-overlay button.rhb-submit,
.rhb-overlay a.rhb-submit {
	background: #111111 !important;
	background-image: none !important;
	color: #ffffff !important;
	border: 0 !important;
	text-decoration: none !important;
	text-shadow: none !important;
}

.rhb-overlay button.rhb-submit:hover:not(:disabled),
.rhb-overlay button.rhb-submit:focus:not(:disabled),
.rhb-overlay a.rhb-submit:hover,
.rhb-overlay a.rhb-submit:focus {
	background: #000000 !important;
	color: #ffffff !important;
}

.rhb-overlay button.rhb-submit:disabled {
	opacity: 0.65;
}

.rhb-done__actions {
	margin: 0 0 14px;
}

.rhb-overlay a.rhb-submit--book {
	width: auto;
	gap: 8px;
}

/* The success-screen "Close" button stays outlined, not filled. */
.rhb-overlay button.rhb-submit--ghost {
	background: transparent !important;
	color: #111111 !important;
	box-shadow: inset 0 0 0 1px var(--rhb-line);
}

.rhb-overlay button.rhb-submit--ghost:hover:not(:disabled) {
	background: rgba(15, 23, 42, 0.05) !important;
	color: #000000 !important;
}

/* ---------- Right-hand panel ---------- */

.rhb-aside {
	display: flex;
	flex-direction: column;
	padding: 38px 30px 0;
	background: #e8f2f0; /* fallback where color-mix() is unsupported */
	background: linear-gradient(165deg, color-mix(in srgb, var(--rhb-tint) 10%, #fff) 0%, color-mix(in srgb, var(--rhb-tint) 22%, #fff) 100%);
	border-left: 1px solid #e2e8f0;
	border-left-color: color-mix(in srgb, var(--rhb-tint) 16%, #fff);
	overflow: hidden;
}

.rhb-aside__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: var(--rhb-ink);
}

.rhb-aside__text {
	margin: 0 0 14px;
	font-size: 13.5px;
	color: #475569;
}

.rhb-aside__list {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}

.rhb-aside__list li {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0 0 8px;
	font-size: 13px;
	color: #334155;
}

.rhb-aside__list svg {
	flex: 0 0 auto;
	margin-top: 3px;
	color: var(--rhb-tint);
}

.rhb-aside__contact {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
}

.rhb-aside__contact li {
	margin: 0 0 6px;
	color: #334155;
}

.rhb-aside__contact-label {
	font-weight: 600;
	margin-right: 4px;
}

.rhb-overlay .rhb-aside__contact a {
	color: var(--rhb-ink);
	text-decoration: none;
	border-bottom: 1px solid rgba(15, 23, 42, 0.25);
}

.rhb-overlay .rhb-aside__contact a:hover {
	border-bottom-color: currentColor;
}

.rhb-aside__media {
	margin: auto 0 0;
	padding: 0;
	transform: translateY(12px);
}

.rhb-aside__media img {
	display: block;
	width: 100%;
	height: auto;
	/* Short forms would otherwise slice the image through its middle, so cap
	   the bleed and crop from the top where the subject is. */
	max-height: 300px;
	object-fit: cover;
	object-position: top center;
	border-radius: 12px 12px 0 0;
	box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.5);
}

/* ---------- Success state ---------- */

.rhb-done {
	padding: 56px 34px;
	text-align: center;
}

.rhb-done__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 0 0 16px;
	border-radius: 50%;
	color: var(--rhb-accent);
	background: #f1f5f9;
	background: color-mix(in srgb, var(--rhb-accent) 14%, #fff);
	animation: rhb-pop 420ms var(--rhb-ease);
}

.rhb-done h3 {
	margin: 0 0 8px;
	font-size: 21px;
	font-weight: 700;
	color: var(--rhb-ink);
}

.rhb-done__message {
	margin: 0 auto 22px;
	max-width: 420px;
	font-size: 14.5px;
	color: var(--rhb-muted);
}

@keyframes rhb-pop {
	0% { transform: scale(0.6); opacity: 0; }
	60% { transform: scale(1.08); }
	100% { transform: scale(1); opacity: 1; }
}

/* ---------- Shortcode button ---------- */

.rhb-trigger-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--rhb-accent, #111111);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: transform 160ms ease, filter 160ms ease;
}

.rhb-trigger-btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.06);
}

/* ---------- Body lock ---------- */

html.rhb-locked,
body.rhb-locked {
	overflow: hidden !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.rhb-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.rhb-dialog {
		max-width: 100%;
		max-height: 92vh;
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
	}

	.rhb-grid {
		grid-template-columns: 1fr;
	}

	.rhb-aside {
		order: 2;
		border-left: 0;
		border-top: 1px solid #e2e8f0;
		border-top-color: color-mix(in srgb, var(--rhb-tint) 16%, #fff);
		padding: 24px 24px 0;
	}

	.rhb-main {
		order: 1;
		padding: 30px 24px 24px;
	}

	.rhb-title {
		font-size: 21px;
		padding-right: 40px;
	}
}

@media (max-width: 560px) {
	.rhb-row--2 {
		grid-template-columns: 1fr;
	}

	.rhb-aside__media {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rhb-overlay,
	.rhb-dialog,
	.rhb-submit,
	.rhb-close,
	.rhb-done__icon {
		transition-duration: 1ms !important;
		animation-duration: 1ms !important;
	}

	.rhb-dialog {
		transform: none !important;
	}
}
