/* L-GO Booking — fenêtres et espace élève. S'appuie sur les variables du thème L-go
   (--blue, --bg, --text, --alt, --card, --line, --muted…) avec des valeurs de repli. */

.lgo-modal,
.lgo-portal {
	--lgo-blue: var(--blue, #1167ff);
	--lgo-bg: var(--bg, #fff);
	--lgo-text: var(--text, #1b1b1b);
	--lgo-alt: var(--alt, #f5f3f2);
	--lgo-line: var(--line, #ece8e6);
	--lgo-muted: var(--muted, #555);
	--lgo-link: var(--link, #1167ff);
	--lgo-chip-bg: var(--chip-bg, #e3edff);
	--lgo-chip-fg: var(--chip-fg, #0a4fcc);
	--lgo-field-line: var(--field-line, #8a857f);
	--lgo-bar-bg: var(--bar-bg, #d9d4d0);
	--lgo-red: #e5484d;
	--lgo-green: #3fbf6a;
	--lgo-green-text: #186a35;
	--lgo-orange-text: #8a5300;
	font-family: 'Poppins', sans-serif;
}

/* ---------- Boutons et champs ---------- */
.lgo-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border: 0; border-radius: 999px; padding: 14px 24px; cursor: pointer;
	background: var(--lgo-blue); color: #fff; font: inherit; font-weight: 700; font-size: 15px;
	text-decoration: none; transition: opacity .15s;
}
.lgo-btn:hover { opacity: .92; color: #fff; }
.lgo-btn:disabled { opacity: .8; cursor: wait; }
.lgo-btn--ghost { background: transparent; color: var(--lgo-text); border: 2px solid var(--lgo-field-line); }
.lgo-btn--ghost:hover { color: var(--lgo-text); border-color: var(--lgo-text); }
.lgo-btn:focus-visible, .lgo-field input:focus-visible, .lgo-field textarea:focus-visible, .lgo-modal__close:focus-visible {
	outline: 3px solid var(--lgo-blue); outline-offset: 2px;
}

.lgo-form { display: flex; flex-direction: column; gap: 14px; }
.lgo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .lgo-fields { grid-template-columns: 1fr; } }
.lgo-field { display: flex; flex-direction: column; gap: 6px; }
.lgo-field label { font-size: 13px; font-weight: 600; }
.lgo-field input, .lgo-field textarea, .lgo-field select {
	font: inherit; font-size: 16px; color: var(--lgo-text); background: var(--lgo-alt);
	border: 2px solid var(--lgo-field-line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
.lgo-field input::placeholder, .lgo-field textarea::placeholder { color: var(--lgo-muted); opacity: .8; }
/* Dans une carte (fond --lgo-alt), le champ prend le fond de la page pour rester visible. */
.lgo-card .lgo-field input, .lgo-card .lgo-field textarea,
.lgo-modal .lgo-field input, .lgo-modal .lgo-field textarea, .lgo-modal .lgo-field select { background: var(--lgo-bg); }
.lgo-field input:focus, .lgo-field textarea:focus, .lgo-field select:focus { border-color: var(--lgo-blue); }
/* Date de naissance : jour, mois, année. */
.lgo-birth { border: 0; margin: 0; padding: 0; min-width: 0; }
.lgo-birth legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.lgo-birth__row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }
.lgo-field select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px; min-width: 0;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.lgo-field select:disabled { opacity: .75; cursor: not-allowed; }
/* « Déjà un compte ? » en haut de la fenêtre d'inscription. */
.lgo-account { align-self: flex-start; font: inherit; font-size: 15px; font-weight: 700; color: #fff; background: var(--lgo-blue); border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer; transition: filter .2s; }
.lgo-account:hover, .lgo-account:focus-visible { filter: brightness(1.12); }
.lgo-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lgo-form-msg { margin: 0; color: var(--lgo-red); font-size: 14px; font-weight: 600; }
.lgo-form-msg:empty { display: none; }
.lgo-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--lgo-muted); }
.lgo-note.is-full { color: var(--lgo-text); font-weight: 600; }
.lgo-eyebrow { color: var(--lgo-link); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Fenêtre ---------- */
.lgo-modal {
	width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
	border: 0; border-radius: 24px; padding: 0; background: var(--lgo-bg); color: var(--lgo-text);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
	overscroll-behavior: contain; /* le défilement dans la fenêtre ne se propage pas à la page */
}
html.lgo-modal-open { scroll-behavior: auto; }
html.lgo-modal-open body { position: fixed; left: 0; right: 0; overflow: hidden; }
.lgo-modal::backdrop { background: rgba(10, 12, 20, .6); backdrop-filter: blur(3px); }
.lgo-modal__body { padding: 32px 28px 28px; display: flex; flex-direction: column; gap: 18px; }
/* Le contenu de la fenêtre est enveloppé dans un div : il garde le même espacement. */
.lgo-modal__body > div:not([class]) { display: flex; flex-direction: column; gap: 18px; }
.lgo-modal__close {
	position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 999px;
	border: 0; background: var(--lgo-alt); color: var(--lgo-text); font-size: 16px; cursor: pointer;
}
.lgo-modal__head { display: flex; flex-direction: column; gap: 6px; padding-right: 40px; }
.lgo-modal__head h2 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.lgo-modal__meta { margin: 0; color: var(--lgo-link); font-weight: 600; font-size: 14px; }
.lgo-days-list { list-style: none; margin: 0; padding: 4px 18px; background: var(--lgo-alt); border-radius: 16px; }
.lgo-days-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 14px; border-bottom: 1px solid var(--lgo-line); }
.lgo-days-list li:last-child { border-bottom: 0; }
.lgo-days-list span { color: var(--lgo-muted); }
.lgo-success { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 0; }
.lgo-success h2 { margin: 0; font-size: 26px; font-weight: 800; }
.lgo-success p { margin: 0; line-height: 1.55; }
.lgo-success__icon { width: 52px; height: 52px; border-radius: 999px; background: var(--lgo-green); color: #fff; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---------- Espace élève ---------- */
.lgo-portal { flex: 1 0 auto; width: 100%; max-width: 1200px; margin: 0 auto; padding: 56px 24px 88px; display: flex; flex-direction: column; gap: 32px; color: var(--lgo-text); }
.lgo-portal h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.lgo-portal h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.lgo-portal p { margin: 0; }
.lgo-portal__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.lgo-portal__head p { color: var(--lgo-muted); font-size: 17px; margin-top: 8px; }
.lgo-tabs { display: flex; gap: 6px; background: var(--lgo-alt); padding: 5px; border-radius: 999px; flex-wrap: wrap; }
.lgo-tabs a, .lgo-tabs button { padding: 9px 18px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 14px; color: var(--lgo-text); text-decoration: none; background: none; border: 0; cursor: pointer; }
.lgo-tabs a.is-active { background: var(--lgo-blue); color: #fff; }
.lgo-portal__head { position: relative; }
.lgo-portal__head > div { flex: 1 1 auto; }
.lgo-logout { margin: 0; }
.lgo-logout--bottom { display: none; }
.lgo-logout button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 14px; color: var(--lgo-muted); background: none; border: 1px solid var(--lgo-field-line); cursor: pointer; }
.lgo-logout button:hover, .lgo-logout button:focus-visible { color: var(--lgo-text); border-color: var(--lgo-text); }
.lgo-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lgo-card .lgo-actions:last-child { margin-top: auto; }
.lgo-score { display: flex; align-items: baseline; gap: 14px; }
.lgo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.lgo-card { background: var(--lgo-alt); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.lgo-card--strong { background: var(--lgo-blue); color: #fff; }
.lgo-card--strong .lgo-eyebrow, .lgo-card--strong .lgo-note { color: #fff; }
.lgo-card--strong .lgo-days-list { background: rgba(0, 0, 0, .18); }
.lgo-card--strong .lgo-btn--ghost, .lgo-card--strong .lgo-btn--ghost:hover { color: #fff; border-color: #fff; }
.lgo-card--strong .lgo-days-list li { border-color: rgba(255, 255, 255, .2); }
.lgo-card--strong .lgo-days-list span { color: #fff; }
.lgo-big { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.lgo-empty { color: var(--lgo-muted); }

.lgo-list { display: flex; flex-direction: column; }
.lgo-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--lgo-line); flex-wrap: wrap; }
.lgo-item:first-child { border-top: 0; }
.lgo-item__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lgo-item__title { font-weight: 800; font-size: 17px; }
.lgo-item__meta { font-size: 14px; color: var(--lgo-muted); }
.lgo-item__days { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.lgo-item__days span { display: inline-block; min-width: 92px; color: var(--lgo-muted); }
.lgo-chip { display: inline-block; background: var(--lgo-chip-bg); color: var(--lgo-chip-fg); font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.lgo-chip--ok { background: rgba(63, 191, 106, .16); color: var(--lgo-green-text); }
.lgo-chip--warn { background: rgba(255, 166, 0, .16); color: var(--lgo-orange-text); }

.lgo-skill { display: flex; flex-direction: column; gap: 6px; }
.lgo-skill__row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.lgo-bar { height: 8px; border-radius: 999px; background: var(--lgo-bar-bg); overflow: hidden; }
.lgo-bar > div { height: 100%; border-radius: 999px; background: var(--lgo-blue); }
.lgo-ring { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }

.lgo-login { max-width: 520px; margin: 0 auto; }
.lgo-login .lgo-card { gap: 20px; }

/* ---------- Grande fenêtre « Voir les sessions » (onglets par cours) ---------- */
.lgo-modal--wide { width: min(1100px, calc(100vw - 24px)); max-height: min(820px, calc(100vh - 24px)); }
.lgo-modal--wide .lgo-modal__body { min-height: 100%; }
.lgo-cat { display: flex; flex-direction: column; gap: 20px; }
.lgo-cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: thin; }
@media (max-width: 600px) { .lgo-cat-tabs { mask-image: linear-gradient(90deg, #000 85%, transparent); } }
.lgo-cat-tabs [role=tab] {
	flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
	font: inherit; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
	background: var(--lgo-alt); color: var(--lgo-text); border: 2px solid transparent;
}
.lgo-cat-tabs [role=tab]:hover { border-color: var(--lgo-line); }
.lgo-cat-tabs [role=tab].is-active { background: var(--lgo-blue); color: #fff; }
.lgo-cat-tabs [role=tab]:focus-visible { outline: 3px solid var(--lgo-blue); outline-offset: 2px; }
.lgo-cat-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; text-align: center; background: var(--lgo-bg); color: var(--lgo-text); }
.lgo-cat-tabs [role=tab].is-active .lgo-cat-count { background: rgba(255, 255, 255, .22); color: #fff; }
.lgo-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.lgo-cat-empty { margin: 0; padding: 32px 20px; text-align: center; color: var(--lgo-muted); background: var(--lgo-alt); border-radius: 16px; }

.lgo-scard { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 20px; background: var(--lgo-alt); }
.lgo-scard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lgo-scard__head h3 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; }
.lgo-scard__place { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--lgo-link); }
.lgo-scard__price { font-size: 18px; font-weight: 800; white-space: nowrap; }
.lgo-scard .lgo-days-list { background: var(--lgo-bg); padding: 2px 14px; flex: 1; }
.lgo-scard .lgo-days-list li { padding: 9px 0; font-size: 13px; }
.lgo-scard__left { margin: 0; font-size: 14px; font-weight: 700; }
.lgo-scard.is-low .lgo-scard__left { color: var(--lgo-link); }
.lgo-scard.is-full .lgo-scard__left { color: var(--lgo-muted); }
.lgo-btn--muted { background: var(--full, #6e6e72); }
.lgo-back { align-self: flex-start; font: inherit; font-size: 14px; font-weight: 700; color: var(--lgo-link); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.lgo-back:hover { text-decoration: underline; }

@media (max-width: 600px) {
	/* Mobile : toutes les fenêtres en plein écran. */
	.lgo-modal, .lgo-modal--wide { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; margin: 0; border-radius: 0; }
	.lgo-modal__body { padding: 24px 16px; }
	.lgo-modal--wide .lgo-modal__body { padding: 24px 16px; }
	.lgo-modal__head h2 { font-size: 24px; }
}

/* ---------- Ajustements (revue design) ---------- */
body.lgo-light .lgo-modal, body.lgo-light .lgo-portal { --lgo-red: #c62a2f; }
body.lgo-dark .lgo-modal, body.lgo-dark .lgo-portal { --lgo-green-text: #4fd884; --lgo-orange-text: #ffb84d; --lgo-red: #ff5f64; }
.lgo-card > .lgo-btn:last-child { margin-top: auto; align-self: flex-start; }
@media (max-width: 600px) {
	.lgo-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
	.lgo-tabs a, .lgo-tabs button { flex: 0 0 auto; padding: 12px 16px; }
	/* Déconnexion : grand bouton rouge en bas de page plutôt que dans l'en-tête. */
	.lgo-logout--top { display: none; }
	.lgo-logout--bottom { display: block; margin-top: 32px; }
	.lgo-logout--bottom button { width: 100%; justify-content: center; padding: 16px; font-size: 16px; color: #fff; background: #d32f35; border-color: #d32f35; }
	.lgo-logout--bottom button:hover, .lgo-logout--bottom button:focus-visible { color: #fff; background: #b8262c; border-color: #b8262c; }
	.lgo-tabs a { flex: 1 1 auto; text-align: center; padding: 12px 10px; }
}

/* Élève connecté : coordonnées préremplies et grisées dans la fenêtre d'inscription. */
.lgo-field input:disabled { opacity: .75; cursor: not-allowed; }
.lgo-who a { font-weight: 700; color: var(--lgo-link); }
