/* RouteBooker — front-end booking widget */

.rb-widget,
.rb-modal {
	--rb-accent: #1f5f4b;
	--rb-accent-ink: #ffffff;
	--rb-ink: #16191d;
	--rb-muted: #5d6670;
	--rb-line: #dfe3e8;
	--rb-surface: #ffffff;
	--rb-surface-2: #f6f7f9;
	--rb-radius: 12px;
}

.rb-widget {
	max-width: 640px;
	margin: 0 auto;
	padding: 24px;
	background: var(--rb-surface);
	color: var(--rb-ink);
	border: 1px solid var(--rb-line);
	border-radius: var(--rb-radius);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}

.rb-widget *,
.rb-widget *::before,
.rb-widget *::after {
	box-sizing: inherit;
}

.rb-head {
	margin-bottom: 20px;
}

.rb-title {
	margin: 0 0 4px;
	font-size: 1.5rem;
	line-height: 1.25;
	font-weight: 650;
	color: var(--rb-ink);
}

.rb-sub {
	margin: 0;
	color: var(--rb-muted);
	font-size: 0.95rem;
}

/* Step pips */
.rb-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	font-size: 0.78rem;
}

.rb-step {
	flex: 1 1 auto;
	min-width: 0;
	padding: 6px 2px 0;
	border-top: 3px solid var(--rb-line);
	color: var(--rb-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rb-step.is-active,
.rb-step.is-done {
	border-top-color: var(--rb-accent);
	color: var(--rb-ink);
	font-weight: 600;
}

/* Panels */
.rb-panel {
	display: none;
}

.rb-panel.is-active {
	display: block;
}

.rb-field {
	display: block;
	margin-bottom: 14px;
}

.rb-label {
	display: block;
	margin-bottom: 5px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--rb-ink);
}

.rb-widget input[type="text"],
.rb-widget input[type="tel"],
.rb-widget input[type="email"],
.rb-widget select,
.rb-widget textarea {
	width: 100%;
	padding: 11px 12px;
	font: inherit;
	font-size: 1rem;
	color: var(--rb-ink);
	background: var(--rb-surface);
	border: 1px solid var(--rb-line);
	border-radius: 8px;
	appearance: none;
	-webkit-appearance: none;
}

.rb-widget select {
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6670' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 18px;
	padding-right: 36px;
}

.rb-widget textarea {
	resize: vertical;
}

.rb-widget input:focus,
.rb-widget select:focus,
.rb-widget textarea:focus {
	outline: 2px solid var(--rb-accent);
	outline-offset: 1px;
	border-color: var(--rb-accent);
}

.rb-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.rb-field--grow {
	flex: 1 1 180px;
}

.rb-field--sm {
	flex: 0 1 96px;
}

/* Buttons */
.rb-btn {
	display: inline-block;
	padding: 12px 20px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: var(--rb-accent-ink);
	background: var(--rb-accent);
	border: 1px solid var(--rb-accent);
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.rb-btn:hover:not(:disabled) {
	opacity: 0.9;
}

.rb-btn:disabled {
	opacity: 0.55;
	cursor: default;
}

.rb-btn--ghost {
	color: var(--rb-muted);
	background: transparent;
	border-color: var(--rb-line);
}

.rb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: 18px;
}

/* Questions */
.rb-q {
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--rb-line);
}

.rb-q:last-child {
	border-bottom: 0;
}

.rb-q-label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
}

.rb-opt {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px 12px;
	margin-bottom: 6px;
	border: 1px solid var(--rb-line);
	border-radius: 8px;
	cursor: pointer;
}

.rb-opt:hover {
	background: var(--rb-surface-2);
}

.rb-opt input {
	margin: 3px 0 0;
	flex: 0 0 auto;
}

.rb-opt.is-picked {
	border-color: var(--rb-accent);
	background: var(--rb-surface-2);
}

.rb-q.is-missing .rb-q-label {
	color: #a3241d;
}

/* Slots */
.rb-hint {
	margin: 0 0 14px;
	color: var(--rb-muted);
	font-size: 0.9rem;
}

.rb-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.rb-slot {
	display: block;
	width: 100%;
	padding: 12px;
	font: inherit;
	text-align: left;
	color: var(--rb-ink);
	background: var(--rb-surface);
	border: 1px solid var(--rb-line);
	border-radius: 8px;
	cursor: pointer;
}

.rb-slot:hover {
	border-color: var(--rb-accent);
	background: var(--rb-surface-2);
}

.rb-slot-date {
	display: block;
	font-size: 0.8rem;
	color: var(--rb-muted);
}

.rb-slot-time {
	display: block;
	font-size: 1.05rem;
	font-weight: 650;
	margin-top: 2px;
}

.rb-chosen {
	margin: 0 0 16px;
	padding: 12px 14px;
	background: var(--rb-surface-2);
	border-radius: 8px;
	font-weight: 600;
}

/* Notice */
.rb-notice {
	margin-bottom: 16px;
	padding: 12px 14px;
	border-radius: 8px;
	background: #fdf3e7;
	border: 1px solid #e9c99a;
	color: #6b4415;
	font-size: 0.93rem;
}

.rb-notice.is-error {
	background: #fdeceb;
	border-color: #e9a9a4;
	color: #8a231c;
}

.rb-notice.is-busy {
	background: var(--rb-surface-2);
	border-color: var(--rb-line);
	color: var(--rb-muted);
}

/* Honeypot */
.rb-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Done */
.rb-done {
	text-align: center;
	padding: 12px 0;
}

.rb-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-bottom: 12px;
	color: var(--rb-accent-ink);
	background: var(--rb-accent);
	border-radius: 50%;
}

.rb-done h3 {
	margin: 0 0 6px;
	font-size: 1.3rem;
}

.rb-done p {
	margin: 0;
	color: var(--rb-muted);
}

/* ------------------------------------------------------------------
 * Trigger button
 * --------------------------------------------------------------- */

.rb-cta {
	margin: 0 0 1em;
}

.rb-cta--center { text-align: center; }
.rb-cta--right  { text-align: right; }

.rb-cta .rb-btn {
	text-decoration: none;
}

/* ------------------------------------------------------------------
 * Modal
 * --------------------------------------------------------------- */

.rb-modal {
	position: relative;
	width: min(680px, calc(100vw - 32px));
	max-width: 100%;
	padding: 0;
	color: var(--rb-ink);
	background: transparent;
	border: 0;
	overflow: visible;
}

.rb-modal::backdrop {
	background: rgba(12, 18, 16, 0.6);
}

.rb-modal .rb-widget--modal {
	width: 100%;
	max-width: none;
	max-height: min(86vh, 780px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.rb-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--rb-muted);
	background: var(--rb-surface);
	border: 1px solid var(--rb-line);
	border-radius: 50%;
	cursor: pointer;
}

.rb-modal-close:hover {
	color: var(--rb-ink);
	background: var(--rb-surface-2);
}

.rb-modal-close:focus-visible {
	outline: 2px solid var(--rb-accent);
	outline-offset: 2px;
}

/* Leave room for the close button beside the heading. */
.rb-widget--modal .rb-head {
	padding-right: 40px;
}

/* Browsers without <dialog>: same look, positioned by hand. */
.rb-modal.rb-modal--fallback {
	display: none;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 99999;
}

.rb-modal.rb-modal--fallback[open] {
	display: block;
}

.rb-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(12, 18, 16, 0.6);
}

body.rb-modal-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.rb-widget {
		padding: 18px;
	}

	.rb-modal .rb-widget--modal {
		max-height: 92vh;
	}

	.rb-steps {
		font-size: 0.7rem;
	}

	.rb-slots {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	}
}
