/* ==========================================================================
 * 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;
}

.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 {
	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 {
	outline: 2px solid rgba( 255, 255, 255, 0.7 );
	outline-offset: 1px;
}

.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;
}
