/* ==========================================================================
   AutoÉcole Pro — Public Stylesheet (Premium Design System)
   ========================================================================== */

:root {
	/* Couleurs par défaut (surchargées par le PHP inline css) */
	--aep-primary: #2563eb;
	--aep-secondary: #10b981;
	--aep-accent: #f59e0b;
	
	/* Nuances système neutres */
	--aep-body-bg: #f8fafc;
	--aep-text: #0f172a;
	--aep-text-muted: #64748b;
	--aep-border: #e2e8f0;
	--aep-card-bg: #ffffff;
	--aep-danger: #ef4444;
	
	/* Effets graphiques */
	--aep-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--aep-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
	--aep-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
	--aep-radius: 16px;
	--aep-radius-sm: 8px;
}

/* Base Wrapper */
.aep-dashboard, .aep-boutique, .aep-reservation-wrapper {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--aep-text);
	background: var(--aep-body-bg);
	padding: 24px;
	border-radius: var(--aep-radius);
	box-shadow: var(--aep-shadow);
	margin: 20px 0;
	line-height: 1.5;
}

/* Header & Welcome */
.aep-dashboard__header, .aep-boutique__header, .aep-reservation-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 28px;
}

.aep-dashboard__header h1, .aep-boutique__header h2, .aep-reservation-header h2 {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.025em;
}

.aep-dashboard__subtitle {
	margin: 4px 0 0 0;
	color: var(--aep-text-muted);
	font-size: 14px;
}

.aep-dashboard__actions {
	display: flex;
	gap: 10px;
}

/* Grids */
.aep-grid {
	display: grid;
	gap: 20px;
	margin-bottom: 28px;
}
.aep-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.aep-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.aep-grid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Card Element */
.aep-card {
	background: var(--aep-card-bg);
	border: 1px solid var(--aep-border);
	border-radius: var(--aep-radius);
	padding: 24px;
	box-shadow: var(--aep-shadow-sm);
	transition: transform 0.2s, box-shadow 0.2s;
}

.aep-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--aep-shadow);
}

.aep-card h3 {
	margin: 0 0 16px 0;
	font-size: 18px;
	font-weight: 700;
	border-bottom: 1px solid var(--aep-border);
	padding-bottom: 12px;
}

/* Stat Cards */
.aep-card--stat {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
}

.aep-card__icon {
	font-size: 32px;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: #f1f5f9;
}

.aep-card--primary .aep-card__icon { background: #dbeafe; color: var(--aep-primary); }
.aep-card--success .aep-card__icon { background: #d1fae5; color: var(--aep-secondary); }
.aep-card--info .aep-card__icon { background: #e0f2fe; color: #0284c7; }
.aep-card--warning .aep-card__icon { background: #ffedd5; color: var(--aep-accent); }

.aep-card__content {
	display: flex;
	flex-direction: column;
}

.aep-card__value {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
}

.aep-card__label {
	font-size: 12px;
	color: var(--aep-text-muted);
	font-weight: 500;
	margin-top: 2px;
}

/* Progress Bar */
.aep-progress {
	background: #e2e8f0;
	border-radius: 10px;
	height: 24px;
	overflow: hidden;
	position: relative;
	margin-top: 10px;
}

.aep-progress__bar {
	background: linear-gradient(90deg, var(--aep-primary) 0%, var(--aep-secondary) 100%);
	height: 100%;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: width 0.4s ease;
}

.aep-progress__text {
	color: white;
	font-size: 11px;
	font-weight: 700;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}

/* Buttons */
.aep-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 600;
	border-radius: var(--aep-radius-sm);
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none !important;
	transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.aep-btn:active { transform: scale(0.97); }

.aep-btn--primary {
	background: var(--aep-primary);
	color: white !important;
}
.aep-btn--primary:hover {
	background: #1d4ed8;
}

.aep-btn--secondary {
	background: var(--aep-secondary);
	color: white !important;
}
.aep-btn--secondary:hover {
	background: #059669;
}

.aep-btn--danger {
	background: var(--aep-danger);
	color: white !important;
}
.aep-btn--danger:hover {
	background: #dc2626;
}

.aep-btn--outline {
	background: transparent;
	border-color: var(--aep-border);
	color: var(--aep-text) !important;
}
.aep-btn--outline:hover {
	background: #f1f5f9;
}

.aep-btn--sm {
	padding: 6px 12px;
	font-size: 12px;
}
.aep-btn--lg {
	padding: 12px 24px;
	font-size: 15px;
}

/* Badges */
.aep-badge {
	display: inline-flex;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
}

.aep-badge--actif, .aep-badge--active, .aep-badge--confirmee, .aep-badge--terminee {
	background: #d1fae5;
	color: #065f46;
}

.aep-badge--expire, .aep-badge--annulee, .aep-badge--inactif, .aep-badge--noshow {
	background: #fee2e2;
	color: #991b1b;
}

/* Next Course Box */
.aep-next-cours {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f8fafc;
	border: 1px solid var(--aep-border);
	padding: 16px;
	border-radius: var(--aep-radius-sm);
	margin-top: 10px;
}

.aep-next-cours__day {
	display: block;
	font-weight: 700;
	font-size: 15px;
}
.aep-next-cours__time {
	font-size: 13px;
	color: var(--aep-text-muted);
}
.aep-next-cours__info p {
	margin: 2px 0;
	font-size: 13px;
}

/* Credits & Packs Lists */
.aep-credits-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.aep-credit-item {
	background: #f8fafc;
	border: 1px solid var(--aep-border);
	border-radius: var(--aep-radius-sm);
	padding: 12px;
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 6px;
}
.aep-credit-item--inactive { opacity: 0.6; }
.aep-credit-item__expiry {
	grid-column: span 2;
	font-size: 11px;
	color: var(--aep-text-muted);
}

/* Competences Progress */
.aep-competences-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}
.aep-competence {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border: 1px solid var(--aep-border);
	border-radius: var(--aep-radius-sm);
	background: #f8fafc;
	font-size: 13px;
}
.aep-competence--done {
	border-color: #bbf7d0;
	background: #f0fdf4;
	font-weight: 600;
}
.aep-competence__count {
	font-size: 11px;
	color: var(--aep-text-muted);
	margin-left: auto;
}

/* Responsive Tables */
.aep-table-wrap {
	overflow-x: auto;
	margin-top: 10px;
}
.aep-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.aep-table th, .aep-table td {
	padding: 12px;
	border-bottom: 1px solid var(--aep-border);
	text-align: left;
}
.aep-table th {
	background: #f8fafc;
	font-weight: 600;
	color: var(--aep-text-muted);
}

/* Modals */
.aep-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.aep-modal__overlay {
	position: absolute;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(4px);
}
.aep-modal__content {
	position: relative;
	background: white;
	border-radius: var(--aep-radius);
	width: 90%;
	max-width: 540px;
	padding: 28px;
	box-shadow: var(--aep-shadow-lg);
	z-index: 10;
	max-height: 90vh;
	overflow-y: auto;
}
.aep-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	font-size: 20px;
	cursor: pointer;
	color: var(--aep-text-muted);
}

/* Stars Rating */
.aep-rating-star {
	font-size: 24px;
	cursor: pointer;
	color: #d1d5db;
	transition: color 0.15s;
}
.aep-rating-star.selected {
	color: var(--aep-accent);
}
.aep-stars {
	color: var(--aep-accent);
	font-size: 14px;
}
.aep-stars__number {
	color: var(--aep-text-muted);
	font-size: 12px;
	margin-left: 4px;
	font-weight: 600;
}

/* Inputs & Forms */
.aep-form-group {
	margin-bottom: 16px;
}
.aep-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
}
.aep-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--aep-border);
	border-radius: var(--aep-radius-sm);
	font-size: 13px;
	box-sizing: border-box;
}
.aep-input:focus {
	outline: none;
	border-color: var(--aep-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Boutique Styles */
.aep-boutique-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
}

.aep-pack-card {
	background: white;
	border: 1px solid var(--aep-border);
	border-radius: var(--aep-radius);
	overflow: hidden;
	box-shadow: var(--aep-shadow-sm);
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	position: relative;
}

.aep-pack-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--aep-shadow-lg);
	border-color: var(--aep-primary);
}

.aep-pack-card--featured {
	border: 2px solid var(--aep-primary);
}

.aep-pack-card__badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: var(--aep-accent);
	color: white;
	font-size: 10px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	z-index: 2;
	text-transform: uppercase;
}

.aep-pack-card__image-container {
	height: 160px;
	overflow: hidden;
	background: #f1f5f9;
}

.aep-pack-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.aep-pack-card__content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.aep-pack-card__title {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 700;
}

.aep-pack-card__hours {
	font-weight: 700;
	color: var(--aep-primary);
	font-size: 14px;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.aep-pack-card__description {
	font-size: 13px;
	color: var(--aep-text-muted);
	margin: 0 0 16px 0;
	line-height: 1.4;
	flex-grow: 1;
}

.aep-pack-card__meta {
	display: flex;
	gap: 12px;
	font-size: 11px;
	color: var(--aep-text-muted);
	margin-bottom: 20px;
	background: #f8fafc;
	padding: 8px 12px;
	border-radius: 8px;
}

.aep-pack-card__meta span {
	margin-right: 2px;
}

.aep-pack-card__price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
}

.aep-pack-card__price {
	display: flex;
	align-items: baseline;
	gap: 2px;
}

.aep-price-amount {
	font-size: 22px;
	font-weight: 800;
}

.aep-price-tax {
	font-size: 10px;
	color: var(--aep-text-muted);
	font-weight: 600;
}

/* Reservation Wrapper / Filter & Calendar */
.aep-reservation-header__solde {
	background: white;
	padding: 8px 16px;
	border-radius: 20px;
	border: 1px solid var(--aep-border);
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.aep-solde--ok { color: var(--aep-secondary); font-weight:700; }
.aep-solde--empty { color: var(--aep-danger); font-weight:700; }

.aep-reservation-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	background: white;
	border: 1px solid var(--aep-border);
	padding: 16px;
	border-radius: var(--aep-radius-sm);
	margin-bottom: 24px;
}

.aep-filter-item label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--aep-text-muted);
	margin-bottom: 6px;
}

.aep-reservation-calendar-card {
	background: white;
	border: 1px solid var(--aep-border);
	border-radius: var(--aep-radius);
	padding: 16px;
	box-shadow: var(--aep-shadow-sm);
}

.aep-alert {
	padding: 16px 20px;
	border-radius: var(--aep-radius-sm);
	font-size: 13px;
	margin-bottom: 20px;
	border: 1px solid transparent;
}
.aep-alert--warning { background: #fffbeb; border-color: #fef3c7; color: #b45309; }
.aep-alert--danger { background: #fef2f2; border-color: #fee2e2; color: #b91c1c; }
.aep-alert--success { background: #f0fdf4; border-color: #dcfce7; color: #15803d; }
