:root {
	--accent: #f8c032;
	--accent-text: #1f1f1f;
	--page: #f4f4f2;
	--surface: #ffffff;
	--text: #1f1f1f;
	--muted: #63635e;
	--border: #deded9;
	--hover: #f1f1ee;
	--error: #b3261e;
	--radius: 12px;
	color-scheme: light;
}

/* Thème clair par défaut, pour s'intégrer à un site clair ; « auto » (variable THEME) suit l'appareil. */
@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] {
		color-scheme: dark;
		--page: #151515;
		--surface: #1f1f1f;
		--text: #f2f2f0;
		--muted: #a3a39d;
		--border: #3a3a37;
		--hover: #2a2a28;
		--error: #f2b8b5;
	}

	:root[data-theme="auto"] .logo.logo-light {
		display: none;
	}

	:root[data-theme="auto"] .logo.logo-dark {
		display: block;
	}
}

/* Plus précis que .logo, défini plus bas : sans cela les deux variantes s'afficheraient. */
.logo.logo-dark {
	display: none;
}

* {
	box-sizing: border-box;
}

body {
	display: flex;
	min-height: 100vh;
	margin: 0;
	padding: 24px 16px;
	align-items: center;
	justify-content: center;
	background: var(--page);
	color: var(--text);
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1,
h2,
p,
ul {
	margin: 0;
}

.card {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	width: 100%;
	max-width: 940px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	overflow: hidden;
}

.about {
	padding: 28px 24px;
	border-inline-end: 1px solid var(--border);
}

.logo {
	display: block;
	width: 132px;
	height: auto;
	margin-bottom: 28px;
}

.brand,
.muted {
	color: var(--muted);
}

.small {
	font-size: 13px;
}

.strong {
	font-weight: 600;
}

h1 {
	margin: 2px 0 16px;
	font-size: 24px;
	line-height: 1.25;
}

h2 {
	font-size: 16px;
}

.facts {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0;
	color: var(--muted);
	list-style: none;
}

.facts .chosen {
	color: var(--text);
	font-weight: 600;
}

.description {
	margin-top: 16px;
	white-space: pre-line;
}

.step {
	padding: 28px 24px;
}

.pick {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 190px;
	gap: 24px;
}

.month {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.month h2::first-letter {
	text-transform: uppercase;
}

.weekdays,
.days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.weekdays {
	margin-bottom: 4px;
	color: var(--muted);
	font-size: 12px;
	text-align: center;
	text-transform: uppercase;
}

button {
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: inherit;
	font: inherit;
	cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--text);
	outline-offset: 2px;
}

button:disabled {
	cursor: default;
}

.icon {
	width: 36px;
	height: 36px;
	font-size: 20px;
	line-height: 1;
}

.icon:disabled {
	opacity: 0.35;
}

.day {
	aspect-ratio: 1;
	border-color: transparent;
	background: var(--hover);
	font-weight: 600;
}

.day:disabled {
	background: transparent;
	color: var(--muted);
	font-weight: normal;
	opacity: 0.6;
}

.day.today {
	border-color: var(--border);
}

.day:not(:disabled):hover,
.slot:hover {
	border-color: var(--text);
}

.day.selected {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--accent-text);
}

#timezone {
	margin-top: 16px;
}

.slots h2 {
	min-height: 36px;
	margin-bottom: 16px;
}

.slot-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 340px;
	overflow-y: auto;
}

.slot {
	padding: 10px;
	font-weight: 600;
}

.link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--muted);
}

.link:hover {
	color: var(--text);
}

form {
	display: flex;
	flex-direction: column;
	max-width: 420px;
	margin-top: 20px;
}

label {
	margin: 12px 0 4px;
	font-weight: 600;
}

input,
select,
textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: inherit;
	font: inherit;
}

textarea {
	resize: vertical;
}

.field {
	display: flex;
	flex-direction: column;
}

.required {
	color: var(--muted);
}

/* Valeur fournie par le lien reçu : visible, mais plus modifiable. */
.locked {
	background: var(--hover);
	color: var(--muted);
	cursor: not-allowed;
	opacity: 1;
}

#locked-note,
#privacy {
	margin-top: 12px;
}

#privacy a {
	color: inherit;
}

.primary {
	margin-top: 20px;
	padding: 12px;
	border-color: var(--accent);
	background: var(--accent);
	color: var(--accent-text);
	font-weight: 600;
}

.primary:disabled {
	opacity: 0.6;
}

.error {
	margin-top: 12px;
	color: var(--error);
}

.done {
	display: flex;
	flex-direction: column;
	gap: 12px;
	justify-content: center;
}

.check {
	display: flex;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--accent);
	color: var(--accent-text);
	font-size: 22px;
	font-weight: 700;
}

[hidden] {
	display: none !important;
}

/* Dans un cadre, la page laisse le fond et les marges au site qui l'accueille. */
.embedded body {
	display: block;
	min-height: 0;
	padding: 0;
	background: transparent;
}

.embedded .card {
	margin: 0 auto;
}

@media (max-width: 820px) {
	.card {
		grid-template-columns: minmax(0, 1fr);
	}

	.about {
		border-inline-end: 0;
		border-bottom: 1px solid var(--border);
	}

	.logo {
		margin-bottom: 16px;
	}
}

@media (max-width: 560px) {
	body {
		padding: 0;
		align-items: stretch;
	}

	.card {
		border: 0;
		border-radius: 0;
	}

	.pick {
		grid-template-columns: minmax(0, 1fr);
	}

	.slot-list {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		max-height: none;
	}
}

/* Bouton sous forme de lien (page d'annulation : « Choisir un autre créneau »). */
.button-link {
	display: inline-block;
	border: 1px solid var(--accent);
	border-radius: 8px;
	color: var(--accent-text);
	text-align: center;
	text-decoration: none;
}

#step-confirm form {
	margin-top: 12px;
}
