/* ============================================================
   Cerises Forum & Chat — styles (thème sombre Cerises Academy)
   ============================================================ */
.cfc-app {
	--cfc-bg: #0d0d1a;
	--cfc-card: #12122a;
	--cfc-card-2: #1a1a35;
	--cfc-line: rgba(255, 255, 255, 0.08);
	--cfc-text: #ffffff;
	--cfc-muted: rgba(255, 255, 255, 0.55);
	--cfc-faint: rgba(255, 255, 255, 0.35);
	--cfc-accent: #c0392b;
	--cfc-accent-2: #96281b;
	font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--cfc-text);
	max-width: 880px;
	margin: 0 auto;
	box-sizing: border-box;
}
.cfc-app *,
.cfc-app *::before,
.cfc-app *::after { box-sizing: border-box; }

.cfc-hidden { display: none !important; }

.cfc-title {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 700;
	font-size: 1.6rem;
	margin: 0;
	color: #fff;
	line-height: 1.2;
}
.cfc-sub { color: var(--cfc-muted); font-size: 0.92rem; margin: 6px 0 0; }

.cfc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: 50px;
	padding: 11px 22px;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: opacity .2s, transform .15s;
	white-space: nowrap;
}
.cfc-btn-primary {
	background: linear-gradient(135deg, var(--cfc-accent) 0%, var(--cfc-accent-2) 100%);
	color: #fff;
	box-shadow: 0 8px 22px rgba(192, 57, 43, 0.3);
}
.cfc-btn-primary:hover { opacity: .92; transform: translateY(-1px); color: #fff; }
.cfc-btn-primary:active { transform: translateY(0); }

.cfc-back {
	background: none;
	border: none;
	color: var(--cfc-muted);
	cursor: pointer;
	font-size: 0.88rem;
	font-family: inherit;
	padding: 0;
	margin-bottom: 18px;
	transition: color .2s;
}
.cfc-back:hover { color: #fff; }

.cfc-loading { color: var(--cfc-faint); padding: 30px; text-align: center; font-size: 0.9rem; }

/* ── Forum ────────────────────────────────────────────── */
.cfc-forum-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 22px;
}

.cfc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cfc-chip {
	background: var(--cfc-card);
	border: 1px solid var(--cfc-line);
	color: var(--cfc-muted);
	border-radius: 50px;
	padding: 7px 16px;
	font-size: 0.82rem;
	font-family: inherit;
	cursor: pointer;
	transition: all .2s;
}
.cfc-chip:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.cfc-chip.is-active {
	background: rgba(192, 57, 43, 0.15);
	border-color: var(--cfc-accent);
	color: #fff;
}

.cfc-topics { display: flex; flex-direction: column; gap: 12px; }
.cfc-topic {
	background: var(--cfc-card);
	border: 1px solid var(--cfc-line);
	border-radius: 14px;
	padding: 18px 20px;
	cursor: pointer;
	transition: border-color .2s, transform .15s, background .2s;
	display: flex;
	gap: 14px;
	align-items: flex-start;
}
.cfc-topic:hover { border-color: rgba(192,57,43,0.5); transform: translateY(-2px); }

.cfc-avatar {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 1rem;
	color: #fff;
	background: linear-gradient(135deg, var(--cfc-accent), var(--cfc-accent-2));
}
.cfc-topic-body { flex: 1; min-width: 0; }
.cfc-topic-title {
	font-size: 1.05rem;
	font-weight: 600;
	color: #fff;
	margin: 0 0 6px;
	font-family: "Playfair Display", Georgia, serif;
}
.cfc-topic-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	font-size: 0.8rem;
	color: var(--cfc-faint);
}
.cfc-tag {
	background: rgba(255,255,255,0.06);
	color: var(--cfc-muted);
	border-radius: 50px;
	padding: 3px 11px;
	font-size: 0.72rem;
}
.cfc-replies-count {
	flex: 0 0 auto;
	text-align: center;
	color: var(--cfc-muted);
	font-size: 0.78rem;
	min-width: 46px;
}
.cfc-replies-count b { display: block; font-size: 1.2rem; color: #fff; font-family: "Playfair Display", serif; }

.cfc-empty { color: var(--cfc-faint); text-align: center; padding: 40px 20px; }

/* ── Formulaires ──────────────────────────────────────── */
.cfc-form { background: var(--cfc-card); border: 1px solid var(--cfc-line); border-radius: 16px; padding: 26px; margin-top: 8px; }
.cfc-label {
	display: block;
	color: var(--cfc-muted);
	font-size: 0.76rem;
	font-weight: 500;
	letter-spacing: .4px;
	text-transform: uppercase;
	margin: 16px 0 7px;
}
.cfc-label:first-child { margin-top: 0; }
.cfc-input {
	width: 100%;
	padding: 13px 16px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 10px;
	color: #fff;
	font-size: 0.93rem;
	font-family: inherit;
	outline: none;
	transition: border-color .2s, background .2s;
}
.cfc-input::placeholder { color: rgba(255,255,255,0.25); }
.cfc-input:focus {
	border-color: var(--cfc-accent);
	background: rgba(255,255,255,0.08);
	box-shadow: 0 0 0 3px rgba(192,57,43,0.15);
}
select.cfc-input { appearance: none; -webkit-appearance: none; cursor: pointer; }
select.cfc-input option { background: var(--cfc-card-2); color: #fff; }
.cfc-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.cfc-form-actions { margin-top: 20px; }
.cfc-msg { font-size: 0.85rem; margin: 12px 0 0; min-height: 1em; }
.cfc-msg.is-error { color: #e74c3c; }
.cfc-msg.is-ok { color: #2ecc71; }

/* ── Détail sujet ─────────────────────────────────────── */
.cfc-detail-card {
	background: var(--cfc-card);
	border: 1px solid var(--cfc-line);
	border-radius: 16px;
	padding: 26px;
	margin-bottom: 22px;
}
.cfc-detail-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.cfc-detail-title { font-size: 1.5rem; margin: 0 0 6px; font-family: "Playfair Display", Georgia, serif; }
.cfc-detail-content { color: rgba(255,255,255,0.85); line-height: 1.7; font-size: 0.96rem; }
.cfc-detail-meta { font-size: 0.8rem; color: var(--cfc-faint); margin-top: 4px; }

.cfc-replies-title { font-size: 1rem; color: var(--cfc-muted); margin: 24px 0 14px; font-weight: 600; }
.cfc-reply {
	display: flex;
	gap: 12px;
	padding: 16px 0;
	border-top: 1px solid var(--cfc-line);
}
.cfc-reply .cfc-avatar { width: 36px; height: 36px; font-size: 0.85rem; }
.cfc-reply-body { flex: 1; }
.cfc-reply-author { font-weight: 600; font-size: 0.9rem; color: #fff; }
.cfc-reply-time { font-size: 0.75rem; color: var(--cfc-faint); margin-left: 8px; }
.cfc-reply-text { color: rgba(255,255,255,0.82); font-size: 0.92rem; line-height: 1.6; margin-top: 4px; }

.cfc-reply-form { margin-top: 20px; }
.cfc-login-prompt {
	background: rgba(192,57,43,0.08);
	border: 1px solid rgba(192,57,43,0.25);
	border-radius: 12px;
	padding: 18px;
	text-align: center;
	margin-top: 20px;
}
.cfc-login-prompt a { color: var(--cfc-accent); font-weight: 600; }

/* ── Chat ─────────────────────────────────────────────── */
.cfc-chat {
	background: var(--cfc-card);
	border: 1px solid var(--cfc-line);
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	max-width: 560px;
	box-shadow: 0 24px 70px rgba(0,0,0,0.4);
}
.cfc-chat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--cfc-line);
	background: rgba(255,255,255,0.02);
}
.cfc-chat-head .cfc-title { font-size: 1.1rem; }
.cfc-chat-dot { width: 9px; height: 9px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 4px rgba(46,204,113,0.15); }

.cfc-chat-messages {
	flex: 1;
	min-height: 280px;
	max-height: 440px;
	overflow-y: auto;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.cfc-chat-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 80%; }
.cfc-chat-msg .cfc-avatar { width: 32px; height: 32px; font-size: 0.78rem; }
.cfc-bubble {
	background: var(--cfc-card-2);
	border: 1px solid var(--cfc-line);
	border-radius: 14px 14px 14px 4px;
	padding: 9px 14px;
}
.cfc-bubble-author { font-size: 0.72rem; color: var(--cfc-accent); font-weight: 600; margin-bottom: 2px; }
.cfc-bubble-text { font-size: 0.92rem; color: #fff; line-height: 1.45; word-wrap: break-word; }
.cfc-bubble-time { font-size: 0.65rem; color: var(--cfc-faint); margin-top: 3px; text-align: right; }

.cfc-chat-msg.is-mine { margin-left: auto; flex-direction: row-reverse; }
.cfc-chat-msg.is-mine .cfc-bubble {
	background: linear-gradient(135deg, var(--cfc-accent), var(--cfc-accent-2));
	border-color: transparent;
	border-radius: 14px 14px 4px 14px;
}
.cfc-chat-msg.is-mine .cfc-bubble-author { display: none; }

.cfc-chat-form { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--cfc-line); }
.cfc-chat-input {
	flex: 1;
	padding: 12px 16px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 50px;
	color: #fff;
	font-size: 0.93rem;
	font-family: inherit;
	outline: none;
}
.cfc-chat-input:focus { border-color: var(--cfc-accent); background: rgba(255,255,255,0.08); }
.cfc-chat-send { width: 46px; height: 46px; padding: 0; border-radius: 50%; flex: 0 0 auto; font-size: 1rem; }
.cfc-chat-login { padding: 18px; text-align: center; border-top: 1px solid var(--cfc-line); }

/* Scrollbar */
.cfc-chat-messages::-webkit-scrollbar { width: 7px; }
.cfc-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
	.cfc-title { font-size: 1.35rem; }
	.cfc-forum-head { flex-direction: column; }
	.cfc-forum-head .cfc-btn { width: 100%; }
	.cfc-chat-msg { max-width: 92%; }
}
