/* ==========================================================================
 * WhatsApp Staff Rotator — public.css
 *
 * Styles for the public-facing loading / cooldown / blocked / empty pages.
 * All colour values are static; runtime overrides (e.g. brand background)
 * are applied via inline `background-color` rendered server-side from a
 * value that has been validated against /^#[0-9a-fA-F]{6}$/.
 * ========================================================================== */

html, body.wsr-loading {
	height: 100%;
}

body.wsr-loading {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
	color: #fff;
	background-color: #25D366; /* overridden inline server-side */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	-webkit-font-smoothing: antialiased;
}

.wsr-card {
	background: rgba( 255, 255, 255, 0.10 );
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border-radius: 14px;
	padding: 32px 28px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.18 );
}

.wsr-logo {
	max-width: 80px;
	max-height: 80px;
	width: auto;
	height: auto;
	margin: 0 auto 16px;
	display: block;
	border-radius: 12px;
}

.wsr-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	margin: 0 auto 12px;
	display: block;
	border: 3px solid rgba( 255, 255, 255, 0.8 );
	object-fit: cover;
	background: rgba( 255, 255, 255, 0.2 );
}

.wsr-text {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 6px;
	line-height: 1.3;
}

.wsr-staff {
	font-size: 14px;
	opacity: 0.85;
	margin: 0 0 22px;
}

.wsr-spinner {
	width: 36px;
	height: 36px;
	margin: 14px auto 4px;
	border: 3px solid rgba( 255, 255, 255, 0.35 );
	border-top-color: #fff;
	border-radius: 50%;
	animation: wsr-spin 0.9s linear infinite;
}

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

.wsr-fallback {
	margin-top: 18px;
	font-size: 13px;
}

.wsr-fallback a {
	color: #fff;
	text-decoration: underline;
}

/* ----- Variants for non-200 states --------------------------------------- */

body.wsr-cooldown { background-color: #f59e0b; }
body.wsr-blocked  { background-color: #6b7280; }
body.wsr-empty    { background-color: #374151; }

body.wsr-cooldown .wsr-card,
body.wsr-blocked  .wsr-card,
body.wsr-empty    .wsr-card {
	background: rgba( 0, 0, 0, 0.15 );
}

@media ( prefers-reduced-motion: reduce ) {
	.wsr-spinner { animation: none; opacity: 0.6; }
}

/* ----- Pre-chat form ----------------------------------------------------- */

body.wsr-prechat { align-items: flex-start; padding-top: 6vh; }

.wsr-prechat-card {
	max-width: 440px;
	text-align: left;
	padding: 28px 26px;
	/* Sit directly on the configured page background colour (no white tint),
	   so the form's background matches the Settings → background colour. */
	background: transparent;
	box-shadow: none;
}

.wsr-prechat-card .wsr-text {
	font-size: 22px;
	margin-bottom: 6px;
	text-align: center;
}

.wsr-prechat-card .wsr-staff {
	margin-bottom: 18px;
	text-align: center;
	opacity: 0.9;
}

.wsr-prechat-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 6px;
}

.wsr-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wsr-field > span {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.wsr-field input,
.wsr-field textarea,
.wsr-field select {
	font: inherit;
	color: #111827;
	background: rgba( 255, 255, 255, 0.95 );
	border: 1px solid rgba( 0, 0, 0, 0.08 );
	border-radius: 8px;
	padding: 10px 12px;
	width: 100%;
	box-sizing: border-box;
	resize: vertical;
}

.wsr-field input:focus,
.wsr-field textarea:focus,
.wsr-field select:focus {
	outline: 2px solid rgba( 255, 255, 255, 0.7 );
	outline-offset: 1px;
}

.wsr-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: rgba( 255, 255, 255, 0.95 );
	border: 1px solid rgba( 0, 0, 0, 0.08 );
	border-radius: 8px;
	padding: 10px 12px;
}

.wsr-choice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: #111827;
	font-size: 14px;
	line-height: 1.35;
	cursor: pointer;
}

.wsr-choice input {
	width: auto;
	margin: 2px 0 0;
	flex: 0 0 auto;
}

.wsr-help {
	color: rgba( 255, 255, 255, 0.85 );
	font-size: 12px;
	line-height: 1.35;
}

.wsr-optional {
	font-style: normal;
	font-weight: 400;
	opacity: 0.75;
	font-size: 12px;
	margin-left: 4px;
}

.wsr-submit {
	font: inherit;
	font-weight: 600;
	color: #111827;
	background: #ffffff;
	border: 0;
	border-radius: 999px;
	padding: 12px 22px;
	cursor: pointer;
	margin-top: 6px;
	transition: transform 0.1s ease;
}

.wsr-submit:hover { transform: translateY(-1px); }
.wsr-submit:active { transform: translateY(0); }

.wsr-form-errors {
	background: rgba( 254, 226, 226, 0.95 );
	color: #991b1b;
	border-radius: 8px;
	padding: 10px 14px;
	margin-bottom: 8px;
	font-size: 14px;
}

/* Honeypot: hidden from real users, present in DOM for bots. */
.wsr-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ----- Ètmelt edition ---------------------------------------------------- */

.wsr-prechat-card .wsr-text {
	font-family: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
	font-weight: 600;
	font-size: 28px;
	letter-spacing: 0.01em;
}

.wsr-field input[type="date"] {
	min-height: 42px;
	-webkit-appearance: none;
	appearance: none;
}

.wsr-lead-hint.wsr-lead-warn {
	color: #fde68a;
	font-weight: 600;
}

.wsr-field input::placeholder,
.wsr-field textarea::placeholder {
	color: #9ca3af;
}

/* Conditional fields (show_if) — the attribute must beat .wsr-field's flex. */
.wsr-field[hidden] { display: none !important; }

/* ----- Kitchen calendar picker ------------------------------------------- */
.wsr-cal { position: relative; }
.wsr-cal-trigger {
	font: inherit; width: 100%; text-align: left; cursor: pointer;
	color: #111827; background: rgba( 255, 255, 255, 0.95 ) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 12px center;
	border: 1px solid rgba( 0, 0, 0, 0.08 ); border-radius: 8px; padding: 10px 40px 10px 12px; min-height: 42px;
}
.wsr-cal-trigger.is-empty { color: #6b7280; }
.wsr-cal-trigger:focus-visible { outline: 2px solid rgba( 255, 255, 255, 0.7 ); outline-offset: 1px; }
.wsr-cal-panel {
	position: absolute; z-index: 20; left: 0; right: 0; top: calc( 100% + 6px );
	background: #fff; color: #111827; border-radius: 12px; padding: 12px;
	box-shadow: 0 16px 40px rgba( 0, 0, 0, 0.28 );
}
.wsr-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wsr-cal-head strong { font-size: 15px; }
.wsr-cal-nav {
	font: inherit; font-size: 20px; line-height: 1; width: 34px; height: 34px; border-radius: 50%;
	border: 0; background: #f3f4f6; color: #111827; cursor: pointer;
}
.wsr-cal-nav:disabled { opacity: 0.3; cursor: default; }
.wsr-cal-grid { display: grid; grid-template-columns: repeat( 7, 1fr ); gap: 4px; }
.wsr-cal-dow { font-size: 11px; font-weight: 600; text-align: center; color: #6b7280; padding: 4px 0; }
.wsr-cal-day {
	font: inherit; font-size: 14px; aspect-ratio: 1 / 1; border: 0; border-radius: 8px;
	background: #f9fafb; color: #111827; cursor: pointer; padding: 0;
}
.wsr-cal-day:hover:not(:disabled) { background: #3B2A24; color: #fff; }
.wsr-cal-day:disabled { background: transparent; color: #d1d5db; cursor: not-allowed; }
.wsr-cal-day.is-off, .wsr-cal-swatch {
	color: #9ca3af; text-decoration: line-through;
	background: repeating-linear-gradient( 135deg, #f3f4f6 0 4px, #e5e7eb 4px 8px );
}
.wsr-cal-day.is-selected { background: #3B2A24; color: #fff; font-weight: 700; }
.wsr-cal-legend { margin-top: 10px; font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.wsr-cal-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; }
