/**
 * PsychConsultants Booking - Frontend Styles
 */

:root {
	--psych-primary: #16a34a;
	--psych-primary-dark: #15803d;
	--psych-primary-soft: #dcfce7;
	--psych-primary-muted: rgba(22, 163, 74, 0.12);
	--psych-text: #1a2e1f;
	--psych-text-light: #5a6b60;
	--psych-text-muted: #8a9a8f;
	--psych-bg: #f0f5f2;
	--psych-bg-soft: #e8f0eb;
	--psych-white: #ffffff;
	--psych-border: #d8e4dc;
	--psych-border-focus: #16a34a;
	--psych-error: #dc2626;
	--psych-success: #16a34a;
	--psych-shadow: 0 4px 20px rgba(26, 46, 31, 0.06);
	--psych-shadow-card: 0 16px 48px rgba(26, 46, 31, 0.1), 0 2px 8px rgba(26, 46, 31, 0.04);
	--psych-radius: 16px;
	--psych-radius-sm: 10px;
	--psych-transition: all 0.25s ease;
}

/* Outer page area */
.psychconsult-booking-wrapper {
	max-width: 660px;
	margin: 32px auto;
	padding: 28px 20px;
	font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	-webkit-font-smoothing: antialiased;
	background: linear-gradient(165deg, #e8f2ec 0%, #f3f7f4 45%, #eef4f0 100%);
	border-radius: 24px;
	box-sizing: border-box;
}

/* Elevated card */
.psychconsult-booking-card {
	background: var(--psych-white);
	border-radius: var(--psych-radius);
	box-shadow: var(--psych-shadow-card);
	border: 1px solid rgba(22, 163, 74, 0.1);
	overflow: hidden;
	animation: psychFadeIn 0.5s ease-out;
}

@keyframes psychFadeIn {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Header */
.psychconsult-booking-header {
	padding: 36px 32px 28px;
	text-align: center;
	background: var(--psych-white);
	border-bottom: 1px solid var(--psych-border);
}

.psychconsult-header-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 14px;
	color: var(--psych-primary);
	background: var(--psych-primary-soft);
	border-radius: 50%;
}

.psychconsult-header-icon svg {
	display: block;
}

.psychconsult-booking-title {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -0.3px;
	color: var(--psych-primary);
	line-height: 1.25;
}

.psychconsult-booking-subtitle {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--psych-text-light);
	font-weight: 400;
	max-width: 380px;
	margin-left: auto;
	margin-right: auto;
}

/* Notices */
.psychconsult-notice {
	margin: 20px 28px 0;
	padding: 14px 18px;
	border-radius: var(--psych-radius-sm);
	font-size: 14px;
	line-height: 1.5;
	animation: psychSlideDown 0.3s ease-out;
}

@keyframes psychSlideDown {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

.psychconsult-notice-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.psychconsult-notice-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Form */
.psychconsult-form {
	padding: 28px 32px 32px;
}

.psychconsult-form-row {
	margin-bottom: 18px;
}

.psychconsult-form-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.psychconsult-form-row-name-age {
	display: grid;
	grid-template-columns: 1fr 110px;
	gap: 16px;
}

.psychconsult-form-group {
	position: relative;
}

.psychconsult-form-group label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 600;
	color: var(--psych-text);
	letter-spacing: 0.01em;
}

.psychconsult-field-icon {
	color: var(--psych-primary);
	flex-shrink: 0;
	opacity: 0.9;
}

.psychconsult-required {
	color: var(--psych-error);
	font-weight: 700;
}

/* Inputs */
.psychconsult-input {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	font-size: 15px;
	color: var(--psych-text);
	background: #f7faf8;
	border: 1.5px solid var(--psych-border);
	border-radius: var(--psych-radius-sm);
	transition: var(--psych-transition);
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
	line-height: 1.5;
}

.psychconsult-input::placeholder {
	color: var(--psych-text-muted);
}

.psychconsult-input:hover:not(:disabled) {
	border-color: #b8cfc0;
	background: #f3f8f5;
}

.psychconsult-input:focus {
	outline: none;
	border-color: var(--psych-border-focus);
	background: var(--psych-white);
	box-shadow: 0 0 0 3px var(--psych-primary-muted);
}

.psychconsult-input:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	background: #eef2ef;
}

.psychconsult-input.psychconsult-input-error {
	border-color: var(--psych-error);
	background: #fef2f2;
}

select.psychconsult-input,
.psychconsult-select {
	min-height: 48px;
	height: 48px;
	padding: 0 44px 0 14px;
	line-height: 48px;
	background-color: #f7faf8;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6b60' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px;
	cursor: pointer;
	text-overflow: ellipsis;
	overflow: hidden;
	white-space: nowrap;
	vertical-align: middle;
}

select.psychconsult-input option,
.psychconsult-select option {
	line-height: 1.4;
	padding: 8px;
	white-space: normal;
}

.psychconsult-textarea {
	resize: vertical;
	min-height: 110px;
	height: auto;
	line-height: 1.55;
	padding: 13px 14px;
}

/* ==========================================================================
   Date picker — scoped + theme-safe (themes often style button/h3 globally)
   ========================================================================== */
#psychconsult-booking .psychconsult-date-picker-wrapper {
	position: relative !important;
}

#psychconsult-booking .psychconsult-date-trigger {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 10px !important;
	width: 100% !important;
	min-height: 48px !important;
	height: 48px !important;
	max-height: 48px !important;
	padding: 0 14px !important;
	margin: 0 !important;
	text-align: left !important;
	cursor: pointer !important;
	color: #8a9a8f !important;
	background: #f7faf8 !important;
	background-image: none !important;
	border: 1.5px solid #d8e4dc !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	font-family: inherit !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}

#psychconsult-booking .psychconsult-date-trigger:hover {
	border-color: #b8cfc0 !important;
	background: #f3f8f5 !important;
	color: #5a6b60 !important;
}

#psychconsult-booking .psychconsult-date-trigger[aria-expanded="true"],
#psychconsult-booking .psychconsult-date-trigger:focus {
	outline: none !important;
	border-color: #16a34a !important;
	background: #ffffff !important;
	box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12) !important;
	color: #1a2e1f !important;
}

#psychconsult-booking .psychconsult-date-trigger.has-value {
	color: #1a2e1f !important;
}

#psychconsult-booking .psychconsult-date-trigger.psychconsult-input-error {
	border-color: #dc2626 !important;
	background: #fef2f2 !important;
}

#psychconsult-booking .psychconsult-date-trigger-text {
	flex: 1 !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	white-space: nowrap !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	color: inherit !important;
}

#psychconsult-booking .psychconsult-date-trigger-icon {
	flex-shrink: 0 !important;
	width: 16px !important;
	height: 16px !important;
	color: #8a9a8f !important;
}

#psychconsult-booking .psychconsult-date-trigger.has-value .psychconsult-date-trigger-icon {
	color: #16a34a !important;
}

/* Compact calendar panel */
#psychconsult-booking .psychconsult-calendar {
	position: absolute !important;
	z-index: 9999 !important;
	top: calc(100% + 6px) !important;
	left: 0 !important;
	right: auto !important;
	width: 268px !important;
	max-width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	max-height: none !important;
	padding: 12px !important;
	margin: 0 !important;
	background: #ffffff !important;
	background-image: none !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 10px !important;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12) !important;
	box-sizing: border-box !important;
	overflow: hidden !important;
}

#psychconsult-booking .psychconsult-calendar-nav {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 6px !important;
	margin: 0 0 10px !important;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
}

#psychconsult-booking .psychconsult-calendar-title {
	display: block !important;
	flex: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: #1a2e1f !important;
	background: transparent !important;
	border: none !important;
	text-align: center !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

#psychconsult-booking .psychconsult-cal-nav-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 26px !important;
	height: 26px !important;
	min-width: 26px !important;
	min-height: 26px !important;
	max-width: 26px !important;
	max-height: 26px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 6px !important;
	background: #ffffff !important;
	background-image: none !important;
	color: #64748b !important;
	cursor: pointer !important;
	font-size: 16px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	box-shadow: none !important;
	text-transform: none !important;
	user-select: none !important;
}

#psychconsult-booking .psychconsult-cal-nav-btn:hover {
	border-color: #16a34a !important;
	color: #16a34a !important;
	background: #f0fdf4 !important;
}

#psychconsult-booking .psychconsult-calendar-grid {
	display: grid !important;
	grid-template-columns: repeat(7, 1fr) !important;
	gap: 2px !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
}

#psychconsult-booking .psychconsult-cal-weekday {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	height: 22px !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 10px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	color: #94a3b8 !important;
	background: transparent !important;
	border: none !important;
	text-transform: uppercase !important;
	letter-spacing: 0.02em !important;
}

#psychconsult-booking .psychconsult-cal-day {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 30px !important;
	min-height: 30px !important;
	max-height: 30px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 6px !important;
	background: transparent !important;
	background-image: none !important;
	color: #334155 !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	font-family: inherit !important;
	line-height: 1 !important;
	cursor: default !important;
	box-shadow: none !important;
	text-transform: none !important;
	text-decoration: none !important;
	aspect-ratio: auto !important;
	user-select: none !important;
}

#psychconsult-booking .psychconsult-cal-day.is-empty {
	visibility: hidden !important;
	pointer-events: none !important;
	background: transparent !important;
}

#psychconsult-booking .psychconsult-cal-day.is-available {
	cursor: pointer !important;
	color: #1e293b !important;
	background: transparent !important;
}

#psychconsult-booking .psychconsult-cal-day.is-available:hover {
	background: #ecfdf5 !important;
	color: #15803d !important;
}

#psychconsult-booking .psychconsult-cal-day.is-today:not(.is-selected):not(.is-disabled) {
	box-shadow: inset 0 0 0 1px #16a34a !important;
	font-weight: 700 !important;
}

#psychconsult-booking .psychconsult-cal-day.is-selected {
	background: #16a34a !important;
	color: #ffffff !important;
	font-weight: 600 !important;
	box-shadow: none !important;
}

#psychconsult-booking .psychconsult-cal-day.is-booked {
	background: #fee2e2 !important;
	color: #b91c1c !important;
	opacity: 0.95 !important;
}

#psychconsult-booking .psychconsult-cal-day.is-booked.is-disabled {
	cursor: not-allowed !important;
	text-decoration: line-through !important;
}

#psychconsult-booking .psychconsult-cal-day.is-available.is-booked:not(.is-selected) {
	cursor: pointer !important;
	pointer-events: auto !important;
	text-decoration: none !important;
}

#psychconsult-booking .psychconsult-cal-day.is-leave,
#psychconsult-booking .psychconsult-cal-day.is-holiday {
	background: #fef3c7 !important;
	color: #b45309 !important;
	cursor: not-allowed !important;
	text-decoration: line-through !important;
	opacity: 0.9 !important;
}

#psychconsult-booking .psychconsult-cal-day.is-past {
	background: transparent !important;
	color: #cbd5e1 !important;
	cursor: not-allowed !important;
	text-decoration: none !important;
}

#psychconsult-booking .psychconsult-cal-day.is-disabled {
	pointer-events: none !important;
}

#psychconsult-booking .psychconsult-calendar-legend {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 6px 10px !important;
	margin: 10px 0 0 !important;
	padding: 8px 0 0 !important;
	border-top: 1px solid #f1f5f9 !important;
	background: transparent !important;
}

#psychconsult-booking .psychconsult-legend-item {
	display: inline-flex !important;
	align-items: center !important;
	gap: 4px !important;
	font-size: 10px !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	color: #64748b !important;
	background: transparent !important;
}

#psychconsult-booking .psychconsult-legend-dot {
	display: inline-block !important;
	width: 7px !important;
	height: 7px !important;
	border-radius: 50% !important;
	flex-shrink: 0 !important;
}

#psychconsult-booking .psychconsult-legend-available { background: #16a34a !important; }
#psychconsult-booking .psychconsult-legend-booked { background: #ef4444 !important; }
#psychconsult-booking .psychconsult-legend-leave { background: #f59e0b !important; }
#psychconsult-booking .psychconsult-legend-selected { background: #0f766e !important; }

/* Days with existing bookings — red like before, still selectable */
#psychconsult-booking .psychconsult-cal-day.is-available.is-booked:not(.is-selected) {
	background: #fee2e2 !important;
	color: #b91c1c !important;
	cursor: pointer !important;
	pointer-events: auto !important;
	text-decoration: none !important;
}

#psychconsult-booking .psychconsult-cal-day.is-available.is-booked:not(.is-selected):hover {
	background: #fecaca !important;
	color: #991b1b !important;
}

#psychconsult-booking .psychconsult-cal-day.is-selected {
	background: #16a34a !important;
	color: #ffffff !important;
	font-weight: 600 !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

#psychconsult-booking .psychconsult-calendar-hint {
	margin-top: 6px !important;
	font-size: 12px !important;
	color: #94a3b8 !important;
	font-style: italic !important;
	line-height: 1.4 !important;
	background: transparent !important;
}

#psychconsult-booking .psychconsult-calendar-hint.psychconsult-hint-loading {
	color: #16a34a !important;
	font-style: normal !important;
}

@media (max-width: 640px) {
	#psychconsult-booking .psychconsult-calendar {
		width: 100% !important;
	}
}

/* Field errors */
.psychconsult-field-error {
	display: block;
	margin-top: 5px;
	font-size: 12px;
	color: var(--psych-error);
	min-height: 16px;
	line-height: 1.3;
}

/* Submit button */
.psychconsult-form-actions {
	margin-top: 24px;
	text-align: center;
}

.psychconsult-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 200px;
	width: 100%;
	max-width: 280px;
	padding: 15px 32px;
	font-size: 16px;
	font-weight: 600;
	font-family: inherit;
	color: var(--psych-white);
	background: var(--psych-primary);
	border: none;
	border-radius: var(--psych-radius-sm);
	cursor: pointer;
	transition: var(--psych-transition);
	position: relative;
	box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.psychconsult-submit-btn:hover {
	background: var(--psych-primary-dark);
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
}

.psychconsult-submit-btn:active {
	transform: translateY(0);
}

.psychconsult-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Spinner */
.psychconsult-spinner {
	animation: psychRotate 1.4s linear infinite;
	width: 22px;
	height: 22px;
}

.psychconsult-spinner .path {
	stroke: var(--psych-white);
	stroke-linecap: round;
	animation: psychDash 1.4s ease-in-out infinite;
}

@keyframes psychRotate {
	100% { transform: rotate(360deg); }
}

@keyframes psychDash {
	0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
	50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
	100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Empty state */
.psychconsult-empty {
	padding: 48px 32px;
	text-align: center;
	color: var(--psych-text-light);
}

/* Responsive */
@media (max-width: 640px) {
	.psychconsult-booking-wrapper {
		margin: 16px auto;
		padding: 12px;
		border-radius: 16px;
	}

	.psychconsult-booking-header {
		padding: 28px 20px 22px;
	}

	.psychconsult-booking-title {
		font-size: 22px;
	}

	.psychconsult-form {
		padding: 22px 18px 26px;
	}

	.psychconsult-form-row-2,
	.psychconsult-form-row-name-age {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.psychconsult-notice {
		margin: 16px 18px 0;
	}

	.psychconsult-submit-btn {
		max-width: none;
	}
}
