/**
 * Frontend styles for the [gastro_reservation] multi-step form.
 * Self-contained and scoped under .rtr-reservation-widget so it does not
 * leak into (or get overridden by) the surrounding theme.
 */

.rtr-reservation-widget {
	--rtr-accent: #b8542f;
	--rtr-accent-dark: #9a4324;
	--rtr-text: #2b2622;
	--rtr-muted: #6b6259;
	--rtr-border: #e7ded4;
	--rtr-bg: #fffaf5;
	--rtr-error: #b3261e;
	--rtr-success: #2f7a4f;
	--rtr-radius: 14px;

	max-width: 560px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--rtr-text);
	box-sizing: border-box;
}

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

.rtr-form {
	background: var(--rtr-bg);
	border: 1px solid var(--rtr-border);
	border-radius: var(--rtr-radius);
	padding: 28px 26px 32px;
	box-shadow: 0 10px 40px rgba(43, 38, 34, 0.06);
	animation: rtr-fade-in 0.5s ease both;
}

@keyframes rtr-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.rtr-form-title {
	margin: 0 0 20px;
	font-size: 1.5rem;
	font-weight: 700;
	text-align: center;
}

/* --- Progress indicator ------------------------------------------------ */
.rtr-progress {
	display: flex;
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	gap: 4px;
}

.rtr-progress-step {
	flex: 1;
	text-align: center;
	position: relative;
}

.rtr-progress-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0 auto 6px;
	border-radius: 50%;
	background: #efe6db;
	color: var(--rtr-muted);
	font-size: 13px;
	font-weight: 700;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.rtr-progress-label {
	display: block;
	font-size: 12px;
	color: var(--rtr-muted);
	font-weight: 600;
}

.rtr-progress-step.is-active .rtr-progress-dot,
.rtr-progress-step.is-complete .rtr-progress-dot {
	background: var(--rtr-accent);
	color: #fff;
}

.rtr-progress-step.is-active .rtr-progress-label {
	color: var(--rtr-text);
}

/* --- Live region / errors ---------------------------------------------- */
.rtr-live-region:empty {
	display: none;
}

.rtr-live-region {
	background: #fbe1e0;
	color: var(--rtr-error);
	border: 1px solid #f3b8b5;
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 18px;
	font-size: 14px;
	animation: rtr-fade-in 0.3s ease both;
}

/* --- Steps / fields ------------------------------------------------------ */
.rtr-step {
	border: 0;
	padding: 0;
	margin: 0;
	animation: rtr-fade-in 0.35s ease both;
}

.rtr-step-heading {
	margin: 0 0 18px;
	font-size: 1.1rem;
	outline: none;
}

.rtr-field {
	margin-bottom: 18px;
}

.rtr-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 480px) {
	.rtr-field-row {
		grid-template-columns: 1fr;
	}
}

.rtr-reservation-widget label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
}

.rtr-required {
	color: var(--rtr-accent);
}

.rtr-reservation-widget input[type="text"],
.rtr-reservation-widget input[type="email"],
.rtr-reservation-widget input[type="tel"],
.rtr-reservation-widget input[type="date"],
.rtr-reservation-widget input[type="number"],
.rtr-reservation-widget select,
.rtr-reservation-widget textarea {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	border: 1.5px solid var(--rtr-border);
	border-radius: 9px;
	background: #fff;
	color: var(--rtr-text);
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rtr-reservation-widget textarea {
	resize: vertical;
	min-height: 90px;
}

/* Highly visible keyboard focus indicator (WCAG 2.4.7) */
.rtr-reservation-widget input:focus-visible,
.rtr-reservation-widget select:focus-visible,
.rtr-reservation-widget textarea:focus-visible,
.rtr-reservation-widget button:focus-visible,
.rtr-reservation-widget a:focus-visible {
	outline: 3px solid var(--rtr-accent);
	outline-offset: 2px;
	border-color: var(--rtr-accent);
}

/* Fallback for browsers without :focus-visible support */
.rtr-reservation-widget input:focus,
.rtr-reservation-widget select:focus,
.rtr-reservation-widget textarea:focus {
	border-color: var(--rtr-accent);
	box-shadow: 0 0 0 3px rgba(184, 84, 47, 0.18);
}

.rtr-reservation-widget input[aria-invalid="true"],
.rtr-reservation-widget select[aria-invalid="true"],
.rtr-reservation-widget textarea[aria-invalid="true"] {
	border-color: var(--rtr-error);
}

.rtr-error {
	color: var(--rtr-error);
	font-size: 13px;
	margin: 6px 0 0;
	min-height: 0;
}

.rtr-error:empty {
	display: none;
}

.rtr-hint {
	color: var(--rtr-muted);
	font-size: 12.5px;
	margin: 6px 0 0;
}

.rtr-field-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.rtr-field-checkbox input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	flex-shrink: 0;
	accent-color: var(--rtr-accent);
}

.rtr-field-checkbox label {
	margin: 0;
	font-weight: 500;
	font-size: 14px;
}

.rtr-field-checkbox a {
	color: var(--rtr-accent);
	font-weight: 700;
}

/* --- Buttons -------------------------------------------------------------- */
.rtr-step-actions {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 24px;
}

.rtr-step[data-step="1"] .rtr-step-actions {
	justify-content: flex-end;
}

.rtr-btn {
	appearance: none;
	border: none;
	border-radius: 9px;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.rtr-btn:active {
	transform: scale(0.97);
}

.rtr-btn-primary {
	background: var(--rtr-accent);
	color: #fff;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.rtr-btn-primary:hover {
	background: var(--rtr-accent-dark);
}

.rtr-btn-primary:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.rtr-btn-secondary {
	background: transparent;
	color: var(--rtr-text);
	border: 1.5px solid var(--rtr-border);
}

.rtr-btn-secondary:hover {
	background: #f2ebe2;
}

.rtr-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	display: inline-block;
	animation: rtr-spin 0.7s linear infinite;
}

.rtr-spinner[hidden] {
	display: none;
}

@keyframes rtr-spin {
	to { transform: rotate(360deg); }
}

/* --- Success state ---------------------------------------------------- */
.rtr-success {
	background: var(--rtr-bg);
	border: 1px solid var(--rtr-border);
	border-radius: var(--rtr-radius);
	padding: 40px 28px;
	text-align: center;
	animation: rtr-fade-in 0.4s ease both;
}

.rtr-success[hidden] {
	display: none;
}

.rtr-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #e3f3e8;
	color: var(--rtr-success);
	font-size: 26px;
	margin-bottom: 16px;
}

.rtr-success h3 {
	margin: 0 0 10px;
	font-size: 1.3rem;
}

.rtr-success-text {
	color: var(--rtr-muted);
	font-size: 15px;
	line-height: 1.5;
	margin: 0;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 480px) {
	.rtr-form {
		padding: 20px 16px 26px;
		border-radius: 10px;
	}

	.rtr-progress-label {
		font-size: 10.5px;
	}
}
