/**
 * Meeting Slot Picker – Frontend CSS
 *
 * @package AccuaFormsMeetings
 */

/* ------------------------------------------------------------------ */
/*  Calendar – Step 1                                                  */
/* ------------------------------------------------------------------ */

.ams-calendar {
	max-width: 360px;
	font-family: inherit;
	font-size: 0.9375rem;
}

.ams-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5em 0;
	margin-bottom: 0.25em;
}

.ams-month-title {
	font-weight: 600;
	font-size: 1.05em;
}

.ams-nav-btn {
	background: none;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 0.3em 0.7em;
	font-size: 0.9em;
	cursor: pointer;
	color: inherit;
	line-height: 1;
}

.ams-nav-btn:hover:not(:disabled) {
	background: #f0f0f1;
}

.ams-nav-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.ams-nav-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

/* Day-of-week header row */
.ams-dow-row {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
	gap: 2px;
}

.ams-dow {
	font-weight: 600;
	font-size: 0.8em;
	padding: 0.4em 0;
	color: #50575e;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Day grid */
.ams-day-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 3px;
	min-height: 180px;
}

.ams-day {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border-radius: 4px;
	font-size: 0.9em;
	transition: background-color 0.15s, color 0.15s;
}

.ams-day-empty {
	visibility: hidden;
}

.ams-day-disabled {
	color: #c3c4c7;
}

.ams-day-full {
	color: #a7aaad;
	text-decoration: line-through;
}

.ams-day-available {
	background: #f0f7ff;
	color: #2271b1;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid #c5ddf5;
}

.ams-day-available:hover {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.ams-day-available:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* Loading / error */
.ams-loading {
	grid-column: 1 / -1;
	text-align: center;
	padding: 2em 0;
	color: #646970;
	font-style: italic;
}

.ams-error {
	grid-column: 1 / -1;
	text-align: center;
	padding: 1em;
	color: #d63638;
}

/* ------------------------------------------------------------------ */
/*  Time Slots – Step 2                                                */
/* ------------------------------------------------------------------ */

.ams-slots {
	max-width: 420px;
	font-family: inherit;
	font-size: 0.9375rem;
}

.ams-slots-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding-bottom: 0.75em;
	border-bottom: 1px solid #ddd;
	margin-bottom: 0.75em;
}

.ams-slots-date {
	font-weight: 600;
	font-size: 1.05em;
}

.ams-back-btn {
	background: none;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 0.3em 0.75em;
	font-size: 0.85em;
	cursor: pointer;
	color: #2271b1;
}

.ams-back-btn:hover {
	background: #f0f0f1;
}

.ams-back-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

/* Slot grid */
.ams-slot-grid {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ams-slot-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.65em 0.9em;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.9375rem;
	transition: border-color 0.15s, background-color 0.15s;
	text-align: left;
}

.ams-slot-btn.ams-slot-open:hover {
	border-color: #2271b1;
	background: #f0f7ff;
}

.ams-slot-btn.ams-slot-open:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

.ams-slot-btn.ams-slot-selected {
	border-color: #2271b1;
	background: #2271b1;
	color: #fff;
}

.ams-slot-btn.ams-slot-full {
	opacity: 0.5;
	cursor: default;
	text-decoration: line-through;
}

.ams-slot-time {
	font-weight: 600;
}

.ams-slot-avail {
	font-size: 0.8em;
	color: #646970;
}

.ams-slot-selected .ams-slot-avail {
	color: rgba(255, 255, 255, 0.8);
}

.ams-no-slots {
	text-align: center;
	padding: 1.5em 0;
	color: #646970;
}

/* ------------------------------------------------------------------ */
/*  Confirmation banner                                                */
/* ------------------------------------------------------------------ */

.ams-confirmation {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin-top: 0.75em;
	padding: 0.7em 1em;
	background: #edfaef;
	border: 1px solid #00a32a;
	border-radius: 4px;
	color: #00450b;
}

.ams-conf-icon {
	font-size: 1.2em;
	font-weight: 700;
	flex-shrink: 0;
}

.ams-conf-text {
	flex: 1;
	font-weight: 500;
}

.ams-change-btn {
	background: none;
	border: 1px solid #00a32a;
	border-radius: 3px;
	padding: 0.25em 0.6em;
	font-size: 0.8em;
	cursor: pointer;
	color: #00450b;
	white-space: nowrap;
}

.ams-change-btn:hover {
	background: rgba(0, 163, 42, 0.1);
}

.ams-change-btn:focus-visible {
	outline: 2px solid #00a32a;
	outline-offset: 1px;
}

/* ------------------------------------------------------------------ */
/*  Notices                                                            */
/* ------------------------------------------------------------------ */

.accua-meetings-notice {
	padding: 10px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	margin: 10px 0;
}

/* ------------------------------------------------------------------ */
/*  Reduced motion                                                     */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.ams-day,
	.ams-slot-btn {
		transition: none;
	}
}

/* ------------------------------------------------------------------ */
/*  Mobile                                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
	.ams-calendar,
	.ams-slots {
		max-width: 100%;
	}

	.ams-slots-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.4em;
	}
}
