/*
 * WTF Farms - Schedule Service
 * Palette is drawn from the farm's own world (pasture, weathered barn wood,
 * raw honey) rather than a generic template palette, and pushed toward the
 * pasture green as the dominant note rather than a cream+terracotta duo.
 * Fonts inherit from the surrounding theme so the widget sits naturally on
 * whatever page it's placed on.
 */

:root {
	--wtfs-cream: #faf7f0;
	--wtfs-cream-deep: #f0e9d8;
	--wtfs-green: #3f5a3d;
	--wtfs-green-light: #5c7a56;
	--wtfs-rust: #b15a3e;
	--wtfs-rust-light: #c56c4f;
	--wtfs-gold: #d4a24c;
	--wtfs-ink: #2b2a25;
	--wtfs-ink-soft: #706c60;
	--wtfs-line: #e3dcc8;
}

/* ---------------- Front-end form ---------------- */

.wtf-schedule-form {
	max-width: 560px;
	margin: 0 auto;
	background: var(--wtfs-cream);
	border: 1px solid var(--wtfs-line);
	border-radius: 16px;
	padding: 34px 30px;
	color: var(--wtfs-ink);
	font-family: inherit;
	box-sizing: border-box;
}
.wtf-schedule-form *,
.wtf-schedule-form *::before,
.wtf-schedule-form *::after {
	box-sizing: inherit;
}

/* Progress */
.wtf-schedule-progress {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 6px;
	margin-bottom: 30px;
}
.wtf-schedule-progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 88px;
	opacity: 0.45;
	transition: opacity 0.2s ease;
	font-size: 12px;
	color: var(--wtfs-ink-soft);
	text-align: center;
}
.wtf-schedule-progress-step.is-active,
.wtf-schedule-progress-step.is-complete {
	opacity: 1;
}
.wtf-schedule-progress-dot {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1.5px solid var(--wtfs-line);
	color: var(--wtfs-green);
}
.wtf-schedule-progress-dot svg {
	width: 16px;
	height: 16px;
}
.wtf-schedule-progress-step.is-active .wtf-schedule-progress-dot {
	background: var(--wtfs-rust);
	border-color: var(--wtfs-rust);
	color: #fff;
}
.wtf-schedule-progress-step.is-complete .wtf-schedule-progress-dot {
	background: var(--wtfs-green);
	border-color: var(--wtfs-green);
	color: #fff;
}
.wtf-schedule-progress-step.is-active span:last-child {
	color: var(--wtfs-ink);
	font-weight: 600;
}
.wtf-schedule-progress-line {
	width: 36px;
	height: 1.5px;
	background: var(--wtfs-line);
	margin-top: 16px;
}

/* Steps */
.wtf-schedule-step {
	display: none;
}
.wtf-schedule-step.is-active {
	display: block;
	animation: wtfsFadeIn 0.25s ease;
}
@keyframes wtfsFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
	.wtf-schedule-step.is-active { animation: none; }
}

.wtf-schedule-form h3 {
	margin: 0 0 6px;
	font-size: 21px;
	color: var(--wtfs-green);
}
.wtf-schedule-sub {
	margin: 0 0 20px;
	color: var(--wtfs-ink-soft);
	font-size: 14px;
	line-height: 1.5;
}

/* Fields */
.wtf-schedule-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
@media (max-width: 480px) {
	.wtf-schedule-row { grid-template-columns: 1fr; }
}
.wtf-schedule-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 14px;
	color: var(--wtfs-ink);
}
.wtf-schedule-form label span {
	color: var(--wtfs-rust);
}
.wtf-schedule-form input[type="text"],
.wtf-schedule-form input[type="email"],
.wtf-schedule-form input[type="tel"],
.wtf-schedule-form select {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 11px 13px;
	border: 1.5px solid var(--wtfs-line);
	border-radius: 9px;
	background: #fff;
	font-size: 15px;
	color: var(--wtfs-ink);
	font-family: inherit;
}
.wtf-schedule-form input:focus,
.wtf-schedule-form select:focus {
	outline: none;
	border-color: var(--wtfs-green-light);
	box-shadow: 0 0 0 3px rgba(63, 90, 61, 0.14);
}
.wtf-schedule-hp {
	position: absolute !important;
	left: -9999px !important;
	opacity: 0;
}

.wtf-schedule-error {
	color: var(--wtfs-rust);
	font-size: 13px;
	margin: 6px 0 0;
	min-height: 16px;
}
.wtf-schedule-error:empty {
	min-height: 0;
	margin: 0;
}

/* Buttons */
.wtf-schedule-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 22px;
}
.wtf-schedule-actions-end {
	justify-content: flex-end;
}
.wtf-schedule-btn {
	border: none;
	border-radius: 999px;
	padding: 12px 26px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}
.wtf-schedule-btn:active {
	transform: scale(0.97);
}
.wtf-schedule-btn-primary {
	background: var(--wtfs-rust);
	color: #fff;
}
.wtf-schedule-btn-primary:hover {
	background: var(--wtfs-rust-light);
}
.wtf-schedule-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}
.wtf-schedule-btn-ghost {
	background: transparent;
	color: var(--wtfs-ink-soft);
	border: 1.5px solid var(--wtfs-line);
}
.wtf-schedule-btn-ghost:hover {
	color: var(--wtfs-ink);
	border-color: var(--wtfs-ink-soft);
}
.wtf-schedule-btn:focus-visible {
	outline: 2px solid var(--wtfs-green-light);
	outline-offset: 2px;
}

/* Calendar (shared by front-end + admin) */
.wtf-schedule-calendar,
.wtf-schedule-admin-calendar {
	position: relative;
	border: 1.5px solid var(--wtfs-line);
	border-radius: 12px;
	padding: 18px;
	background: #fff;
}
.wtf-schedule-calendar {
	min-height: 300px;
}
.wtf-schedule-admin-calendar {
	max-width: 420px;
}
.wtf-schedule-cal-loading {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13.5px;
	color: var(--wtfs-ink-soft);
	border-radius: 12px;
}
.wtf-schedule-cal-loading[hidden] {
	display: none;
}
.wtf-schedule-cal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	font-weight: 700;
	color: var(--wtfs-green);
}
.wtf-schedule-cal-nav {
	background: var(--wtfs-cream-deep);
	border: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 15px;
	color: var(--wtfs-ink);
}
.wtf-schedule-cal-nav:hover {
	background: var(--wtfs-line);
}
.wtf-schedule-cal-nav:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}
.wtf-schedule-cal-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	font-size: 11px;
	color: var(--wtfs-ink-soft);
	margin-bottom: 6px;
}
.wtf-schedule-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}
.wtf-schedule-cal-day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 13px;
	background: transparent;
	border: none;
	color: var(--wtfs-line);
	cursor: default;
}
.wtf-schedule-cal-day.is-empty {
	visibility: hidden;
}
.wtf-schedule-cal-day.is-past {
	color: var(--wtfs-line);
}
.wtf-schedule-cal-day.is-available {
	background: var(--wtfs-cream-deep);
	color: var(--wtfs-green);
	font-weight: 700;
	cursor: pointer;
}
.wtf-schedule-cal-day.is-available:hover {
	background: var(--wtfs-gold);
	color: #fff;
}
.wtf-schedule-cal-day.is-selected {
	background: var(--wtfs-rust) !important;
	color: #fff !important;
}
.wtf-schedule-cal-day:focus-visible {
	outline: 2px solid var(--wtfs-green-light);
	outline-offset: 1px;
}

/* Admin calendar: every day is clickable (toggles open/closed) */
.wtf-schedule-admin-day {
	cursor: pointer;
	color: var(--wtfs-ink-soft);
}
.wtf-schedule-admin-day:hover {
	background: var(--wtfs-cream-deep);
}
.wtf-schedule-admin-day.is-available {
	background: var(--wtfs-green);
	color: #fff;
}
.wtf-schedule-admin-day.is-available:hover {
	background: var(--wtfs-green-light);
}

/* Complete step */
.wtf-schedule-complete {
	text-align: center;
}
.wtf-schedule-complete-icon {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--wtfs-green);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	margin: 0 auto 16px;
}
.wtf-schedule-complete p {
	color: var(--wtfs-ink-soft);
	line-height: 1.6;
	max-width: 380px;
	margin: 0 auto;
}

/* ---------------- Admin: entries table ---------------- */
.wtf-schedule-badge {
	padding: 3px 11px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}
.wtf-schedule-badge-pending {
	background: #fbeed9;
	color: #9a6a1f;
}
.wtf-schedule-badge-confirmed {
	background: #e3ecdf;
	color: #3f5a3d;
}

@media (max-width: 520px) {
	.wtf-schedule-form { padding: 24px 18px; }
}
