/* ============================================================
   Gestion Stage Parapente — Comptes utilisateurs (frontend)
   ============================================================ */

.gsp-account {
	max-width: 760px;
	margin: 24px auto;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 24px;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
}

.gsp-account h2 {
	margin-top: 0;
	font-size: 22px;
	color: #111827;
}

.gsp-account h3 {
	margin-top: 32px;
	padding-bottom: 8px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 16px;
	color: #111827;
}

/* ----- Onglets connexion / inscription ----- */
.gsp-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 24px;
}

.gsp-tab {
	flex: 1;
	background: transparent;
	border: none;
	padding: 12px 18px;
	font-size: 15px;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s;
}
.gsp-tab:hover {
	color: #2271b1;
}
.gsp-tab.active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

.gsp-panel {
	display: none;
}
.gsp-panel.active {
	display: block;
}

/* ----- En-tête compte connecté ----- */
.gsp-account-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}
.gsp-account-header h2 {
	margin: 0;
}
.gsp-logout-form {
	margin: 0;
}

/* ----- Formulaires ----- */
.gsp-form {
	margin: 0;
}

.gsp-field {
	margin-bottom: 16px;
}

.gsp-field label {
	display: block;
	font-weight: 500;
	margin-bottom: 4px;
	color: #374151;
}

.gsp-field input[type="text"],
.gsp-field input[type="email"],
.gsp-field input[type="tel"],
.gsp-field input[type="password"],
.gsp-field input[type="date"],
.gsp-field input[type="number"],
.gsp-field textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #d1d5db;
	border-radius: 5px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.gsp-field textarea {
	resize: vertical;
}

.gsp-field input:focus,
.gsp-field textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.gsp-field input:disabled {
	background: #f3f4f6;
	color: #6b7280;
	cursor: not-allowed;
}

.gsp-field-inline label {
	display: inline;
	font-weight: normal;
}
.gsp-field-inline input[type="checkbox"] {
	margin-right: 6px;
	vertical-align: middle;
}

.gsp-help {
	margin: 4px 0 0;
	font-size: 12px;
	color: #6b7280;
}

.gsp-required {
	color: #dc2626;
}

/* ----- Grilles ----- */
.gsp-grid-2,
.gsp-grid-3 {
	display: grid;
	gap: 14px;
}
/* minmax(0, 1fr) et non 1fr (= minmax(auto, 1fr)) : une colonne peut descendre sous
   la largeur naturelle de son contenu — un <select> prend sinon la largeur de sa plus
   longue option et déborde du bloc (v1.60.2, colonne Elementor étroite). */
.gsp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gsp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gsp-grid-2 > *,
.gsp-grid-3 > * {
	min-width: 0;
}

/* Les <select> (voile personnelle, etc.) suivent la largeur du champ. */
.gsp-field select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Une colonne quand le BLOC est étroit (ex. colonne à 50 % sur ordinateur), pas
   seulement quand l'écran l'est : requête de conteneur, le @media ci-dessous reste
   pour les navigateurs qui ne la connaissent pas. */
@supports (container-type: inline-size) {
	.gsp-account {
		container-type: inline-size;
	}
	@container (max-width: 520px) {
		.gsp-grid-2,
		.gsp-grid-3 {
			grid-template-columns: minmax(0, 1fr);
		}
	}
}

@media (max-width: 600px) {
	.gsp-grid-2,
	.gsp-grid-3 {
		grid-template-columns: minmax(0, 1fr);
	}
	.gsp-account {
		padding: 16px;
		margin: 12px;
	}
}

/* ----- Boutons ----- */
.gsp-form-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 18px;
}

.gsp-btn {
	display: inline-block;
	padding: 10px 22px;
	border: none;
	border-radius: 5px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s, transform 0.05s;
	font-family: inherit;
}
.gsp-btn:active {
	transform: translateY(1px);
}
.gsp-btn-primary {
	background: #2271b1;
	color: #fff;
}
.gsp-btn-primary:hover {
	background: #135e96;
}
.gsp-btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
}
.gsp-btn-secondary:hover {
	background: #e5e7eb;
}

.gsp-link {
	color: #2271b1;
	text-decoration: none;
	font-size: 13px;
}
.gsp-link:hover {
	text-decoration: underline;
}

/* ----- Notices & erreurs ----- */
.gsp-notice {
	padding: 12px 14px;
	border-radius: 5px;
	margin-bottom: 18px;
	font-size: 14px;
}
.gsp-notice-success {
	background: #d6f4d8;
	color: #065f24;
	border-left: 4px solid #00a32a;
}
.gsp-notice-error {
	background: #fde7e9;
	color: #8a1d28;
	border-left: 4px solid #dc2626;
}

.gsp-form-errors {
	background: #fde7e9;
	color: #8a1d28;
	border-left: 4px solid #dc2626;
	padding: 12px 14px;
	border-radius: 5px;
	margin-bottom: 18px;
}
.gsp-form-errors ul {
	margin: 0;
	padding-left: 20px;
}
.gsp-form-errors li {
	margin: 2px 0;
}

/* ============================================================
   Mes réservations (vue logged-in)
   ============================================================ */
.gsp-reservations-table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0;
	font-size: 13px;
}
.gsp-reservations-table thead {
	background: #f9fafb;
}
.gsp-reservations-table th {
	text-align: left;
	padding: 10px 12px;
	font-weight: 600;
	color: #374151;
	border-bottom: 1px solid #e5e7eb;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}
.gsp-reservations-table td {
	padding: 12px;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: top;
}
.gsp-reservations-table tr:hover td {
	background: #fafbfc;
}
.gsp-resa-meta {
	color: #6b7280;
	font-weight: normal;
}
.gsp-resa-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 12px;
}
.gsp-resa-pending { background: #fef3c7; color: #92400e; }
.gsp-resa-confirmed { background: #d1fae5; color: #065f46; }
.gsp-resa-cancelled { background: #fee2e2; color: #991b1b; }
.gsp-resa-expired { background: #f3f4f6; color: #6b7280; }
.gsp-paid-ok {
	color: #065f46;
	font-weight: 600;
}
.gsp-paid-due {
	color: #92400e;
	font-weight: 600;
}
.gsp-paid-due small {
	color: #9ca3af;
	font-weight: normal;
}
.gsp-empty-reservations {
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 6px;
	padding: 18px;
	text-align: center;
	color: #6b7280;
	font-style: italic;
}

/* v1.35.5 — même bug que sur les tableaux admin (cf. CLAUDE.md, piège
   n°12 du repo) : forcer display:table séparément sur <thead> ET
   <tbody> crée deux contextes de tableau indépendants qui calculent
   chacun leurs largeurs de colonnes sans se concerter → l'en-tête
   ("Stage Dates Participants Statut") se désaligne des données en
   dessous. Fix : restaurer TOUS les niveaux à leur display table-family
   natif (jamais table:table sur thead ET tbody à la fois) et envelopper
   la table dans un <div class="gsp-table-scroll-wrap"> ajouté en JS
   (cf. le <script> juste après render_account_logged() dans
   class-gsp-account-shortcode.php) — c'est le <div>, pas la table, qui
   défile horizontalement. */
.gsp-table-scroll-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
}
@media (max-width: 600px) {
	.gsp-table-scroll-wrap {
		/* Ombre légère à droite : signal visuel qu'on peut scroller. */
		box-shadow: inset -8px 0 8px -8px rgba(0,0,0,0.15);
	}
	.gsp-table-scroll-wrap .gsp-reservations-table {
		display: table;
		font-size: 12px;
		width: max-content;
		min-width: 100%;
	}
	.gsp-table-scroll-wrap .gsp-reservations-table thead {
		display: table-header-group;
	}
	.gsp-table-scroll-wrap .gsp-reservations-table tbody {
		display: table-row-group;
	}
	.gsp-table-scroll-wrap .gsp-reservations-table tr {
		display: table-row;
	}
	.gsp-table-scroll-wrap .gsp-reservations-table th,
	.gsp-table-scroll-wrap .gsp-reservations-table td {
		display: table-cell;
		padding: 8px 6px;
		white-space: nowrap;
	}
	/* Pour la cellule paiement (multiligne), on autorise quand même le wrap
	   à l'intérieur avec un min-width raisonnable. */
	.gsp-table-scroll-wrap .gsp-reservations-table td.gsp-payment-cell {
		white-space: normal;
		min-width: 180px;
	}
}

/* ============================================================
   Cellule "Paiement" dans Mes réservations (v1.15.3)
   ============================================================ */
.gsp-payment-cell .gsp-paid-ok {
	color: #065f46;
	font-weight: 600;
}
.gsp-payment-cell .gsp-paid-due {
	color: #b32d2e;
	font-weight: 600;
}
.gsp-payment-cell .gsp-payment-total {
	color: #555;
	margin-top: 2px;
}
.gsp-payment-cell .gsp-payment-balance {
	color: #b32d2e;
	margin-top: 2px;
}
.gsp-payment-cell .gsp-payment-cleared {
	color: #065f46;
	font-weight: 600;
	margin-top: 2px;
}

/* ============================================================
   Onglets compte client (v1.18.0)
   ============================================================ */
.gsp-account-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #e5e7eb;
	margin: 24px 0 0;
	flex-wrap: wrap;
}
.gsp-account-tab {
	padding: 10px 18px;
	color: #555;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.gsp-account-tab:hover {
	color: #2271b1;
	background: rgba(34, 113, 177, 0.04);
}
.gsp-account-tab-active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}
.gsp-account-pane {
	display: none;
	padding: 24px 0 0;
}
.gsp-account-pane-active {
	display: block;
}

@media (max-width: 600px) {
	.gsp-account-tab {
		padding: 8px 12px;
		font-size: 13px;
		flex: 1;
		text-align: center;
	}
}

/* ----- Onglet "Mes packs" (v1.36.0) ----- */
.gsp-pack-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-left: 5px solid #0f5c66;
	border-radius: 8px;
	padding: 18px 20px;
	margin-bottom: 18px;
}
.gsp-pack-card-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}
.gsp-pack-card-title {
	margin: 0;
	font-size: 18px;
}
.gsp-pack-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 12px;
}
.gsp-pack-state-pending { background: #fef3c7; color: #92400e; }
.gsp-pack-state-active { background: #d1fae5; color: #065f46; }
.gsp-pack-state-completed { background: #e5e7eb; color: #374151; }
.gsp-pack-state-cancelled { background: #fee2e2; color: #991b1b; }
.gsp-pack-card-meta {
	color: #6b7280;
	font-size: 13px;
	margin: 0 0 6px;
}
.gsp-pack-card-desc {
	color: #4b5563;
	margin: 0 0 10px;
}
.gsp-pack-progress {
	font-weight: 600;
	margin: 10px 0 8px;
}
.gsp-pack-steps {
	list-style: none;
	margin: 0;
	padding: 0;
}
.gsp-pack-step {
	display: flex;
	gap: 10px;
	align-items: baseline;
	padding: 8px 0;
	border-top: 1px solid #f1f1f1;
}
.gsp-pack-step:first-child {
	border-top: 0;
}
.gsp-pack-step-icon {
	width: 20px;
	text-align: center;
	flex-shrink: 0;
}
.gsp-pack-step-used { color: #065f46; }
.gsp-pack-step-next { font-weight: 600; color: #0f5c66; }
.gsp-pack-step-todo { color: #9ca3af; }
/* Paiement échelonné du pack (v1.60.0) */
.gsp-pack-step small.gsp-pack-step-pay-paid { color: #065f46; }
.gsp-pack-step small.gsp-pack-step-pay-due { color: #b32d2e; font-weight: 600; }
.gsp-pack-step small.gsp-pack-step-pay-upcoming { color: #b45309; }
.gsp-pack-payment {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid #e5e7eb;
}
.gsp-pack-payment p { margin: 0 0 6px; }
.gsp-pack-payment-due { color: #b32d2e; font-weight: 600; }
.gsp-pack-rib summary { cursor: pointer; color: #0f5c66; }
.gsp-pack-step small {
	display: block;
	font-weight: normal;
	color: #6b7280;
}

/* Packs terminés : liste repliée sous les packs en cours (v1.38.1) */
.gsp-packs-completed {
	margin-top: 20px;
}
.gsp-packs-completed > summary {
	cursor: pointer;
	font-weight: 600;
	color: #374151;
	padding: 10px 14px;
	background: #f3f4f6;
	border-radius: 6px;
	margin-bottom: 14px;
}
.gsp-packs-completed > summary:hover {
	background: #e5e7eb;
}
