/*
 * User Dashboard Pro — styles front-end (page de connexion + tableau de bord)
 * Design "soft UI" : coins arrondis, ombres douces, dégradés discrets.
 * Tout est scopé sous .udp-scope pour éviter les conflits avec le thème actif.
 */

.udp-scope {
	--udp-primary: #6C5CE7;
	--udp-secondary: #00C2A8;
	--udp-accent: #FF7A59;
	--udp-bg: #F4F6FB;
	--udp-surface: #FFFFFF;
	--udp-text: #1F2333;
	--udp-text-muted: #7B8199;
	--udp-border: #E7EAF3;
	--udp-radius-lg: 24px;
	--udp-radius-md: 16px;
	--udp-radius-sm: 10px;
	--udp-shadow-soft: 0 10px 30px rgba(31, 35, 51, 0.08);
	--udp-shadow-softer: 0 4px 14px rgba(31, 35, 51, 0.06);
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--udp-text);
	line-height: 1.5;
}

.udp-scope *,
.udp-scope *::before,
.udp-scope *::after {
	box-sizing: inherit;
}

.udp-scope img { max-width: 100%; display: block; }
.udp-scope a { text-decoration: none; }

/* ---------- Boutons & champs communs ---------- */

.udp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: var(--udp-radius-sm);
	font-weight: 600;
	font-size: 14px;
	border: none;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.udp-btn:hover { transform: translateY(-1px); }
.udp-btn:active { transform: translateY(0); }
.udp-btn-block { width: 100%; }
.udp-btn-sm { padding: 8px 14px; font-size: 13px; }

.udp-btn-primary {
	background: linear-gradient(135deg, var(--udp-primary), var(--udp-secondary));
	color: #fff;
	box-shadow:
		0 8px 20px color-mix(in srgb, var(--udp-primary) 40%, transparent),
		0 0 16px color-mix(in srgb, var(--udp-secondary) 30%, transparent);
}
.udp-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.udp-btn-ghost {
	background: var(--udp-surface);
	color: var(--udp-text);
	border: 1px solid var(--udp-border);
}

.udp-field { margin-bottom: 18px; position: relative; }
.udp-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--udp-text-muted);
}
.udp-field input[type="text"],
.udp-field input[type="email"],
.udp-field input[type="password"],
.udp-field input[type="url"],
.udp-field textarea {
	width: 100%;
	padding: 13px 16px;
	border-radius: var(--udp-radius-sm);
	border: 1.5px solid var(--udp-border);
	background: #FBFCFE;
	font-size: 14px;
	color: var(--udp-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.udp-field input:focus,
.udp-field textarea:focus {
	outline: none;
	border-color: var(--udp-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--udp-primary) 15%, transparent);
	background: #fff;
}
.udp-field-password .udp-toggle-password {
	position: absolute;
	right: 12px;
	top: 38px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--udp-text-muted);
}
.udp-field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 13px; }
.udp-checkbox { display: flex; align-items: center; gap: 8px; color: var(--udp-text-muted); cursor: pointer; }
.udp-forgot-link { color: var(--udp-primary); font-weight: 600; }
.udp-hint { font-size: 12px; color: var(--udp-text-muted); margin: 6px 0 0; }

.udp-alert { padding: 12px 16px; border-radius: var(--udp-radius-sm); font-size: 13px; margin-bottom: 18px; }
.udp-alert-error { background: #FDEEEE; color: #C0392B; border: 1px solid #F6D0CE; }
.udp-alert-success { background: #EAFBF3; color: #1E8E5A; border: 1px solid #C9F0DC; }

/* ---------- Page de connexion ---------- */

.udp-login-wrap {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	background:
		radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--udp-primary) 18%, transparent), transparent 45%),
		radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--udp-secondary) 18%, transparent), transparent 45%),
		var(--udp-bg);
}

.udp-login-card {
	display: flex;
	width: 100%;
	max-width: 960px;
	min-height: 560px;
	background: var(--udp-surface);
	border-radius: var(--udp-radius-lg);
	box-shadow: var(--udp-shadow-soft);
	overflow: hidden;
}

.udp-login-side {
	flex: 1 1 45%;
	background: linear-gradient(155deg, var(--udp-primary), color-mix(in srgb, var(--udp-secondary) 55%, var(--udp-primary)));
	color: #fff;
	display: flex;
	align-items: center;
	padding: 48px;
	position: relative;
	overflow: hidden;
}
.udp-login-side::after {
	content: "";
	position: absolute;
	width: 280px;
	height: 280px;
	border-radius: 50%;
	background: rgba(255,255,255,.08);
	right: -80px;
	bottom: -100px;
}
.udp-login-side-inner { position: relative; z-index: 1; }
.udp-login-logo { max-height: 42px; margin-bottom: 28px; }
.udp-login-brand { font-size: 20px; font-weight: 700; margin-bottom: 28px; }
.udp-login-side h2 { font-size: 26px; line-height: 1.3; margin: 0 0 14px; }
.udp-login-side p { opacity: .85; font-size: 14.5px; margin: 0; }
.udp-login-dots { display: flex; gap: 8px; margin-top: 40px; }
.udp-login-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.udp-login-dots span:first-child { background: #fff; width: 22px; border-radius: 4px; }

.udp-login-form-col { flex: 1 1 55%; display: flex; align-items: center; padding: 48px; }
.udp-login-form-inner { width: 100%; max-width: 360px; margin: 0 auto; }
.udp-login-form-inner h1 { font-size: 26px; margin: 0 0 8px; }
.udp-login-subtitle { color: var(--udp-text-muted); font-size: 14px; margin: 0 0 28px; }

@media (max-width: 780px) {
	.udp-login-card { flex-direction: column; min-height: 0; }
	.udp-login-side { padding: 36px; }
	.udp-login-form-col { padding: 36px; }
}

.udp-already-in {
	background: var(--udp-surface);
	border-radius: var(--udp-radius-lg);
	box-shadow: var(--udp-shadow-soft);
	padding: 56px 40px;
	text-align: center;
	max-width: 420px;
}
.udp-already-in .dashicons { font-size: 44px; width: 44px; height: 44px; color: var(--udp-primary); margin-bottom: 16px; }
.udp-already-in h2 { margin: 0 0 22px; font-size: 20px; }
.udp-already-in-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tableau de bord ---------- */

.udp-dash {
	display: flex;
	min-height: 100vh;
	background: var(--udp-bg);
}

.udp-sidebar {
	width: 260px;
	flex-shrink: 0;
	background: linear-gradient(180deg, var(--udp-sidebar, #1B1830), color-mix(in srgb, var(--udp-sidebar, #1B1830) 65%, white 18%) 60%, color-mix(in srgb, var(--udp-primary) 60%, var(--udp-sidebar, #1B1830)));
	color: #fff;
	display: flex;
	flex-direction: column;
	padding: 28px 18px;
	position: sticky;
	top: 0;
	height: 100vh;
	transition: transform .25s ease;
}

.udp-sidebar-brand { padding: 8px 12px 28px; font-weight: 700; font-size: 18px; }
.udp-sidebar-brand img { max-height: 34px; }

.udp-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.udp-nav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 14px;
	border-radius: var(--udp-radius-sm);
	background: transparent;
	border: none;
	color: rgba(255,255,255,.72);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-align: left;
	transition: background .15s ease, color .15s ease;
	position: relative;
}
.udp-nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.udp-nav-item.is-active {
	background: rgba(255,255,255,.12);
	color: #fff;
	box-shadow:
		inset 0 0 0 1px rgba(255,255,255,.08),
		inset 2px 0 0 var(--udp-secondary),
		0 0 14px color-mix(in srgb, var(--udp-secondary) 25%, transparent);
}
.udp-nav-item .dashicons { font-size: 19px; width: 19px; height: 19px; }
.udp-nav-label { flex: 1; }
.udp-badge {
	background: var(--udp-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 1px 7px;
	border-radius: 20px;
}

.udp-logout {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	color: rgba(255,255,255,.72);
	font-size: 14px;
	border-top: 1px solid rgba(255,255,255,.08);
	margin-top: 12px;
	padding-top: 18px;
}
.udp-logout:hover { color: #fff; }

.udp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.udp-topbar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 22px 32px;
	background: var(--udp-surface);
	border-bottom: 1px solid var(--udp-border);
	position: sticky;
	top: 0;
	z-index: 5;
}
.udp-burger { display: none; background: none; border: none; cursor: pointer; }
.udp-topbar-title { flex: 1; }
.udp-topbar-title h1 { font-size: 19px; margin: 0; font-weight: 700; }
.udp-topbar-user { display: flex; align-items: center; gap: 12px; }
.udp-role-badge {
	background: color-mix(in srgb, var(--udp-primary) 12%, #fff);
	color: var(--udp-primary);
	font-size: 12px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 20px;
}
.udp-avatar-sm { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--udp-border); }

.udp-content { padding: 28px 32px 60px; }

.udp-panel { display: none; }
.udp-panel.is-active { display: block; animation: udpFadeIn .25s ease; }
@keyframes udpFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.udp-card {
	background: var(--udp-surface);
	border-radius: var(--udp-radius-md);
	box-shadow: var(--udp-shadow-softer);
	padding: 28px;
	margin-bottom: 24px;
}
.udp-card h2 { font-size: 17px; margin: 0 0 18px; }
.udp-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.udp-card-header h2 { margin: 0; }

.udp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 640px) { .udp-form-grid { grid-template-columns: 1fr; } }

.udp-form-feedback { margin-left: 12px; font-size: 13px; font-weight: 600; }
.udp-form-feedback.is-success { color: #1E8E5A; }
.udp-form-feedback.is-error { color: #C0392B; }

.udp-avatar-uploader { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.udp-avatar-lg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: var(--udp-shadow-softer); }

/* Tuiles de statistiques */
.udp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 24px; }
.udp-tile {
	background: var(--udp-surface);
	border-radius: var(--udp-radius-md);
	box-shadow: var(--udp-shadow-softer);
	padding: 22px;
}
.udp-tile-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px; height: 38px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--udp-primary) 12%, #fff);
	color: var(--udp-primary);
	margin-bottom: 14px;
}
.udp-tile-value {
	font-size: 26px;
	font-weight: 800;
	background: linear-gradient(90deg, var(--udp-primary), var(--udp-secondary));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.udp-tile-label { font-size: 13px; color: var(--udp-text-muted); margin-top: 2px; }

/* Graphique SVG */
.udp-chart { width: 100%; height: auto; }
.udp-bar { fill: var(--udp-primary); opacity: .85; transition: opacity .15s ease; }
.udp-bar:hover { opacity: 1; }
.udp-bar-label { font-size: 10px; fill: var(--udp-text-muted); text-anchor: middle; }

/* Tables */
.udp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.udp-table th, .udp-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--udp-border); }
.udp-table th { color: var(--udp-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.udp-link { color: var(--udp-primary); font-weight: 600; }
.udp-empty { color: var(--udp-text-muted); font-size: 14px; }

.udp-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: #EEF0F7; color: var(--udp-text-muted); }
.udp-status-publish, .udp-status-completed, .udp-status-processing, .udp-status-future { background: #EAFBF3; color: #1E8E5A; }
.udp-status-draft, .udp-status-pending { background: #FFF6E5; color: #B8860B; }
.udp-status-cancelled, .udp-status-failed, .udp-status-trash { background: #FDEEEE; color: #C0392B; }

/* Médiathèque */
.udp-media-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 14px;
}
.udp-media-item {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: var(--udp-radius-sm);
	overflow: hidden;
	background: #F1F2F8;
	box-shadow: var(--udp-shadow-softer);
}
.udp-media-item img { width: 100%; height: 100%; object-fit: cover; }
.udp-media-file-icon { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.udp-media-item-overlay {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.72));
	display: flex; flex-direction: column; justify-content: flex-end;
	padding: 10px;
	opacity: 0;
	transition: opacity .15s ease;
}
.udp-media-item:hover .udp-media-item-overlay,
.udp-media-item:focus-within .udp-media-item-overlay { opacity: 1; }
.udp-media-item-name {
	color: #fff; font-size: 11.5px; font-weight: 600;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	margin-bottom: 6px;
}
.udp-media-item-actions { display: flex; gap: 6px; }
.udp-media-action {
	background: rgba(255,255,255,.15);
	border: none;
	border-radius: 6px;
	width: 26px; height: 26px;
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer;
	font-size: 13px;
	text-decoration: none;
}
.udp-media-action:hover { background: rgba(255,255,255,.3); }

/* Notifications */
.udp-notif-list { list-style: none; margin: 0; padding: 0; }
.udp-notif { display: flex; gap: 12px; padding: 16px 6px; border-bottom: 1px solid var(--udp-border); cursor: pointer; }
.udp-notif:last-child { border-bottom: none; }
.udp-notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--udp-border); margin-top: 6px; flex-shrink: 0; }
.udp-notif.is-unread .udp-notif-dot { background: var(--udp-primary); }
.udp-notif.is-unread strong { color: var(--udp-text); }
.udp-notif strong { display: block; font-size: 14px; margin-bottom: 2px; }
.udp-notif p { margin: 0 0 6px; font-size: 13.5px; color: var(--udp-text-muted); }
.udp-notif time { font-size: 12px; color: var(--udp-text-muted); }
.udp-notif-warning .udp-notif-dot { background: #E1A100; }
.udp-notif-error .udp-notif-dot { background: #C0392B; }
.udp-notif-success .udp-notif-dot { background: #1E8E5A; }

/* Toasts */
.udp-toast-stack { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.udp-toast {
	background: #1F2333;
	color: #fff;
	padding: 13px 18px;
	border-radius: var(--udp-radius-sm);
	font-size: 13.5px;
	box-shadow: var(--udp-shadow-soft);
	animation: udpFadeIn .2s ease;
}
.udp-toast.is-error { background: #C0392B; }
.udp-toast.is-success { background: #1E8E5A; }

/* ---------- Responsive dashboard ---------- */

@media (max-width: 960px) {
	.udp-sidebar {
		position: fixed;
		left: 0; top: 0;
		z-index: 50;
		transform: translateX(-100%);
		box-shadow: var(--udp-shadow-soft);
	}
	.udp-dash.is-sidebar-open .udp-sidebar { transform: translateX(0); }
	.udp-burger { display: inline-flex; }
	.udp-content { padding: 20px 16px 60px; }
	.udp-topbar { padding: 16px; }
}

/* ---------- Éditeur d'articles ---------- */

.udp-editor-card .udp-card-header { flex-wrap: wrap; gap: 10px; }

.udp-editor-wrap { border-radius: var(--udp-radius-sm); overflow: hidden; }
.udp-editor-wrap .wp-editor-container { border: 1px solid var(--udp-border); border-radius: var(--udp-radius-sm); overflow: hidden; }
.udp-editor-wrap .mce-toolbar-grp,
.udp-editor-wrap .quicktags-toolbar { background: #F7F7FB; border-bottom: 1px solid var(--udp-border); }
.udp-editor-wrap .wp-media-buttons .button { border-radius: var(--udp-radius-sm); }

.udp-checklist {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	padding: 12px 14px;
	border: 1px solid var(--udp-border);
	border-radius: var(--udp-radius-sm);
	max-height: 150px;
	overflow-y: auto;
}

.udp-featured-image { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.udp-featured-image-preview {
	width: 140px;
	height: 90px;
	border-radius: var(--udp-radius-sm);
	overflow: hidden;
	border: 1px solid var(--udp-border);
	background: #F4F4FA;
}
.udp-featured-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.udp-featured-image-actions { display: flex; gap: 8px; }

.udp-article-form-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--udp-border);
	flex-wrap: wrap;
}
