/* Roof Rescue Booking — scoped to .rrb, inherits theme tokens when available. */
.rrb {
	--rrb-base: var(--roofsie-base, #873031);
	--rrb-ink: var(--roofsie-black, #201f1f);
	--rrb-muted: #5f5e62;           /* 6.4:1 on white */
	--rrb-line: #e3e3e3;
	--rrb-field: #8a8a8a;           /* 3.4:1 on white — WCAG 1.4.11 */
	--rrb-soft: var(--roofsie-primary, #f4f1ee);
	--rrb-radius: 10px;
	--rrb-focus: 0 0 0 3px #fff, 0 0 0 5px var(--rrb-ink);

	box-sizing: border-box;
	width: min(900px, calc(100% - 24px));
	max-width: none;
	max-height: calc(100dvh - 24px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: #fff;
	color: var(--rrb-ink);
	font-family: var(--roofsie-font, "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
	overflow: auto;
	overscroll-behavior: contain;
}
.rrb *, .rrb *::before, .rrb *::after { box-sizing: border-box; }
.rrb::backdrop { background: rgba(20, 19, 19, .7); }
html.rrb-lock { overflow: hidden; }
.rrb [hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
	.rrb[open] { animation: rrb-in .22s ease-out; }
	@keyframes rrb-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

.rrb__inner { position: relative; padding: 44px 44px 40px; }
.rrb__close {
	position: absolute; top: 14px; right: 14px;
	width: 44px; height: 44px; min-width: 0; margin: 0; padding: 0; display: grid; place-items: center;
	border: 0; border-radius: 50%; background: var(--rrb-soft); color: var(--rrb-ink);
	font-size: 28px; line-height: 1; cursor: pointer; text-indent: 0;
}
.rrb__close:hover { background: var(--rrb-line); }

.rrb__eyebrow { margin: 0 0 6px; color: var(--rrb-base); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.rrb__title { margin: 0 0 8px; color: var(--rrb-ink); font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; line-height: 1.15; }
.rrb__sub { margin: 0 0 28px; color: var(--rrb-muted); max-width: 60ch; }

/* Step 1 */
.rrb__step--pick { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: start; }
.rrb__cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rrb__month { margin: 0; font-size: 18px; font-weight: 800; }
.rrb__nav {
	flex: none; display: grid; place-items: center;
	width: 42px; height: 42px; min-width: 0; margin: 0; padding: 0;
	border: 1.5px solid var(--rrb-base); border-radius: 50%;
	background: #fff; color: var(--rrb-base); line-height: 0; cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.rrb__nav svg { display: block; width: 18px; height: 18px; }
.rrb__nav:hover:not(:disabled) { background: var(--rrb-base); color: #fff; }
.rrb__nav:disabled { border-color: var(--rrb-line); background: #f6f6f6; color: #b5b5b5; cursor: not-allowed; }

.rrb__dow, .rrb__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rrb__dow { margin-bottom: 6px; color: var(--rrb-muted); font-size: 12px; font-weight: 700; text-align: center; text-transform: uppercase; }
.rrb__day {
	aspect-ratio: 1; min-height: 40px; width: 100%; padding: 0;
	border: 1px solid var(--rrb-line); border-radius: 8px;
	background: #fff; color: var(--rrb-ink); font: inherit; font-weight: 700; cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.rrb__day:hover:not(:disabled) { border-color: var(--rrb-base); color: var(--rrb-base); }
.rrb__day[aria-pressed="true"], .rrb__day[aria-pressed="true"]:hover { background: var(--rrb-base); border-color: var(--rrb-base); color: #fff; }
.rrb__day:disabled { border-color: transparent; background: #f6f6f6; color: #a3a3a3; font-weight: 500; cursor: not-allowed; }

.rrb__times { min-height: 100%; padding: 22px; border-radius: var(--rrb-radius); background: var(--rrb-soft); }
.rrb__times-label { margin: 0 0 14px; font-weight: 800; }
.rrb__slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rrb__slot {
	padding: 13px 10px; border: 1.5px solid var(--rrb-base); border-radius: 8px;
	background: #fff; color: var(--rrb-base); font: inherit; font-weight: 800; cursor: pointer;
	transition: background-color .15s, color .15s;
}
.rrb__slot:hover { background: var(--rrb-base); color: #fff; }
.rrb__status { margin: 14px 0 0; color: var(--rrb-muted); font-size: 14px; }
.rrb__status:empty { display: none; }

/* Step 2 */
.rrb__picked {
	display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 14px 18px;
	border-left: 4px solid var(--rrb-base); border-radius: 8px; background: var(--rrb-soft);
}
.rrb__picked-icon { font-size: 20px; }
.rrb__picked-text { margin: 0; flex: 1; font-weight: 800; }
.rrb__link { padding: 4px; border: 0; background: none; color: var(--rrb-base); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.rrb__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.rrb__field { margin: 0; }
.rrb__field--full { grid-column: 1 / -1; }
.rrb__field label { display: block; margin-bottom: 6px; color: var(--rrb-ink); font-size: 14px; font-weight: 700; }
.rrb__opt { color: var(--rrb-muted); font-weight: 500; }
.rrb__field input, .rrb__field textarea {
	width: 100%; margin: 0; padding: 12px 14px;
	border: 1px solid var(--rrb-field); border-radius: 6px;
	background: #fff; color: var(--rrb-ink); font: inherit; font-size: 16px; /* 16px = no iOS zoom */
	box-shadow: none; height: auto;
}
.rrb__field textarea { resize: vertical; min-height: 88px; }
.rrb__field input:focus, .rrb__field textarea:focus { border-color: var(--rrb-base); outline: none; box-shadow: 0 0 0 3px rgba(135, 48, 49, .25); }
.rrb__field input:user-invalid { border-color: #b3261e; }

.rrb__hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.rrb__consent { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 0; color: var(--rrb-muted); font-size: 13px; line-height: 1.5; }
.rrb__consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rrb-base); }

.rrb__error { margin: 14px 0 0; color: #b3261e; font-weight: 700; }
.rrb__error:empty { display: none; }

.rrb__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 24px; }
.rrb .rrb__submit, .rrb .rrb__finish {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 16px 38px; border: 0; border-radius: 5px;
	background: var(--rrb-base); color: #fff;
	font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
.rrb .rrb__submit:hover, .rrb .rrb__finish:hover { background: var(--rrb-ink); }
.rrb .rrb__submit:disabled { opacity: .6; cursor: progress; }
.rrb__privacy { margin: 0; color: var(--rrb-muted); font-size: 13px; }
.rrb__privacy a { color: var(--rrb-base); text-decoration: underline; }

/* Step 3 */
.rrb__done { padding: 12px 0 4px; text-align: center; }
.rrb__check {
	width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center;
	border-radius: 50%; background: var(--rrb-base); color: #fff; font-size: 36px; font-weight: 800;
}
.rrb__done-title { margin: 0 0 10px; font-size: 26px; font-weight: 800; color: var(--rrb-ink); }
.rrb__done-text { max-width: 52ch; margin: 0 auto 24px; color: var(--rrb-muted); }

/* Focus — visible for keyboard users only */
.rrb button:focus-visible, .rrb a:focus-visible, .rrb input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--rrb-focus); }
.rrb__done-title:focus { outline: none; }
.rrb__done-title:focus-visible { outline: 2px dashed var(--rrb-base); outline-offset: 4px; }

/* Optional trigger button from [roof_booking button="…"] */
.rrb-trigger { cursor: pointer; border: 0; }

@media (max-width: 760px) {
	.rrb { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
	.rrb__inner { padding: 28px 20px 32px; }
	.rrb__title { padding-right: 44px; }
	.rrb__step--pick { grid-template-columns: 1fr; gap: 24px; }
	.rrb__fields { grid-template-columns: 1fr; }
	.rrb__actions { flex-direction: column; align-items: stretch; }
	.rrb__slots { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) { .rrb__slots { grid-template-columns: repeat(2, 1fr); } }
