/* Peretele Faptelor Bune — v1.2.0
   Culorile se pot schimba din variabilele de mai jos. */

.idfb-perete {
	--idfb-blue: #1d3c9e;
	--idfb-blue-dark: #142b75;
	--idfb-orange: #f7941d;
	--idfb-orange-dark: #e07b00;
	--idfb-ink: #1b2340;
	--idfb-muted: #5b6382;
	--idfb-board: #f5f7ff;
	--idfb-note-font: inherit;

	--idfb-galben: #fff3b8;
	--idfb-portocaliu: #ffdcb5;
	--idfb-albastru: #d9e4ff;
	--idfb-verde: #d8f2dd;

	position: relative;
	box-sizing: border-box;
	color: var(--idfb-ink);
	background-color: var(--idfb-board);
	background-image: radial-gradient(rgba(29, 60, 158, 0.09) 1.2px, transparent 1.2px);
	background-size: 20px 20px;
	border-radius: 28px;
	padding: clamp(20px, 4vw, 52px);
	overflow: hidden;
	line-height: 1.5;
}
.idfb-perete *, .idfb-perete *::before, .idfb-perete *::after { box-sizing: border-box; }

/* ---------- Antet ---------- */
.idfb-p-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 40px;
	margin-bottom: 28px;
}
.idfb-p-intro { flex: 1 1 340px; max-width: 640px; }
.idfb-p-eyebrow {
	display: inline-block;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--idfb-orange-dark);
	margin-bottom: 8px;
}
.idfb-p-title {
	margin: 0 0 10px;
	font-size: clamp(1.8rem, 4.2vw, 2.9rem);
	line-height: 1.1;
	color: var(--idfb-blue);
	letter-spacing: -0.01em;
}
.idfb-p-sub { margin: 0; color: var(--idfb-muted); font-size: 1.05rem; }

.idfb-p-side {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px 24px;
}
.idfb-p-counter { display: flex; flex-direction: column; line-height: 1; }
.idfb-p-num {
	font-size: clamp(2.2rem, 5vw, 3.2rem);
	font-weight: 800;
	color: var(--idfb-orange);
	font-variant-numeric: tabular-nums;
}
.idfb-p-numlabel { margin-top: 6px; font-size: 0.85rem; color: var(--idfb-muted); }

/* ---------- Butoane ---------- */
.idfb-p-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 0;
	border-radius: 999px;
	padding: 14px 24px;
	font: inherit;
	font-weight: 700;
	font-size: 1rem;
	color: #fff;
	background: var(--idfb-orange);
	box-shadow: 0 6px 0 var(--idfb-orange-dark), 0 10px 24px rgba(247, 148, 29, 0.35);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.idfb-p-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--idfb-orange-dark), 0 14px 28px rgba(247, 148, 29, 0.4); }
.idfb-p-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--idfb-orange-dark), 0 4px 10px rgba(247, 148, 29, 0.3); }
.idfb-p-btn:focus-visible, .idfb-clap:focus-visible, .idfb-p-more:focus-visible { outline: 3px solid var(--idfb-blue); outline-offset: 3px; }
.idfb-p-btn svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.idfb-p-btn[aria-expanded="true"] svg { transform: rotate(45deg); }
.idfb-p-btn[disabled] { opacity: 0.7; cursor: wait; }

/* ---------- Formular ---------- */
.idfb-p-formwrap {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.45s cubic-bezier(.2, .8, .2, 1);
}
.idfb-p-formwrap.is-open { grid-template-rows: 1fr; }
.idfb-p-formwrap > form { overflow: hidden; min-height: 0; }
.idfb-p-form-inner {
	position: relative;
	margin: 4px 0 32px;
	padding: clamp(18px, 3vw, 28px);
	background: #fff;
	border-radius: 20px;
	border: 2px solid rgba(29, 60, 158, 0.1);
	box-shadow: 0 18px 40px rgba(20, 43, 117, 0.08);
}
.idfb-p-label, .idfb-p-field label, .idfb-p-colors legend {
	display: block;
	font-weight: 700;
	font-size: 0.95rem;
	margin-bottom: 8px;
	color: var(--idfb-blue-dark);
}
.idfb-p-field label em { font-weight: 400; font-style: normal; color: var(--idfb-muted); }
.idfb-perete textarea, .idfb-perete input[type="text"] {
	width: 100%;
	font: inherit;
	font-size: 1rem;
	color: var(--idfb-ink);
	background: #f8f9fe;
	border: 2px solid #dfe4f5;
	border-radius: 14px;
	padding: 12px 14px;
	transition: border-color 0.2s ease, background 0.2s ease;
}
.idfb-perete textarea { resize: vertical; min-height: 96px; }
.idfb-perete textarea:focus, .idfb-perete input[type="text"]:focus {
	outline: none;
	border-color: var(--idfb-blue);
	background: #fff;
}
.idfb-p-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.idfb-p-colors { border: 0; padding: 0; margin: 16px 0 0; }
.idfb-p-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.idfb-p-swatch { position: relative; cursor: pointer; }
.idfb-p-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.idfb-p-swatch span {
	display: block;
	width: 40px;
	height: 40px;
	border-radius: 10px 10px 14px 10px;
	border: 2px solid rgba(0, 0, 0, 0.08);
	transform: rotate(-4deg);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.idfb-p-swatch input:checked + span { transform: rotate(0) scale(1.12); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--idfb-blue); }
.idfb-p-swatch input:focus-visible + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--idfb-orange); }
.idfb-p-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.idfb-p-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 20px;
}
.idfb-p-count { font-size: 0.85rem; color: var(--idfb-muted); font-variant-numeric: tabular-nums; }
.idfb-p-count.is-near { color: var(--idfb-orange-dark); font-weight: 700; }
.idfb-p-msg { margin: 14px 0 0; font-weight: 600; min-height: 1.5em; }
.idfb-p-msg.is-ok { color: #1a7f37; }
.idfb-p-msg.is-err { color: #c62828; }

/* ---------- Peretele ---------- */
.idfb-p-wall { columns: 4 230px; column-gap: 24px; padding-top: 14px; }
.idfb-p-empty { text-align: center; color: var(--idfb-muted); padding: 40px 0; }

.idfb-note {
	--r: 0deg;
	position: relative;
	display: inline-block;
	width: 100%;
	break-inside: avoid;
	margin: 0 0 28px;
	padding: 26px 20px 14px;
	background: var(--idfb-galben);
	border-radius: 4px 4px 18px 4px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 10px 22px -8px rgba(20, 43, 117, 0.25);
	transform: translateY(24px) rotate(var(--r));
	opacity: 0;
	transition: transform 0.35s cubic-bezier(.2, .9, .3, 1.2), opacity 0.5s ease, box-shadow 0.3s ease;
}
.idfb-note.is-in { opacity: 1; transform: rotate(var(--r)); }
.idfb-note.is-in:hover { transform: rotate(0) translateY(-6px) scale(1.02); box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 22px 36px -12px rgba(20, 43, 117, 0.35); z-index: 2; }

/* Bandă adezivă */
.idfb-note::before {
	content: "";
	position: absolute;
	top: -11px;
	left: 50%;
	width: 84px;
	height: 24px;
	transform: translateX(-50%) rotate(calc(var(--r) * -1.6));
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid rgba(0, 0, 0, 0.05);
	backdrop-filter: blur(2px);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.idfb-note--portocaliu { background: var(--idfb-portocaliu); }
.idfb-note--albastru { background: var(--idfb-albastru); }
.idfb-note--verde { background: var(--idfb-verde); }

.idfb-note-text {
	margin: 0 0 16px;
	font-family: var(--idfb-note-font);
	font-size: 1.06rem;
	line-height: 1.5;
	color: var(--idfb-ink);
	overflow-wrap: anywhere;
}
.idfb-note-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.idfb-note-who { display: flex; flex-direction: column; min-width: 0; font-size: 0.85rem; }
.idfb-note-name { font-weight: 700; color: var(--idfb-blue-dark); overflow-wrap: anywhere; }
.idfb-note-time { color: var(--idfb-muted); font-size: 0.78rem; }

.idfb-note-badge {
	display: inline-block;
	margin-bottom: 10px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--idfb-blue-dark);
	background: rgba(255, 255, 255, 0.7);
}
.idfb-note.is-pending { outline: 2px dashed rgba(29, 60, 158, 0.35); outline-offset: 4px; }

.idfb-note.is-new { animation: idfb-drop 0.8s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes idfb-drop {
	0% { opacity: 0; transform: translateY(-140px) rotate(-14deg) scale(1.15); }
	70% { opacity: 1; transform: translateY(6px) rotate(calc(var(--r) + 2deg)) scale(0.98); }
	100% { opacity: 1; transform: rotate(var(--r)); }
}

/* ---------- Aplauze ---------- */
.idfb-clap {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 0;
	border-radius: 999px;
	padding: 7px 12px;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--idfb-blue-dark);
	background: rgba(255, 255, 255, 0.65);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.idfb-clap:hover { background: #fff; transform: scale(1.06); }
.idfb-clap svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; transition: fill 0.2s ease; }
.idfb-clap.is-on { color: #fff; background: var(--idfb-orange); }
.idfb-clap.is-on svg { fill: currentColor; }
.idfb-clap.is-pop svg { animation: idfb-pop 0.55s cubic-bezier(.2, .9, .3, 1.6); }
.idfb-clap.is-shake { animation: idfb-shake 0.4s ease; }
@keyframes idfb-pop { 0% { transform: scale(1); } 40% { transform: scale(1.7) rotate(-10deg); } 100% { transform: scale(1); } }
@keyframes idfb-shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- "Mai multe" ---------- */
.idfb-p-moreWrap { text-align: center; margin-top: 8px; }
.idfb-p-more {
	border: 2px solid var(--idfb-blue);
	border-radius: 999px;
	padding: 12px 24px;
	font: inherit;
	font-weight: 700;
	color: var(--idfb-blue);
	background: transparent;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.idfb-p-more:hover { background: var(--idfb-blue); color: #fff; }
.idfb-p-more[hidden] { display: none; }

a.idfb-p-btn, a.idfb-p-more { text-decoration: none; }
a.idfb-p-btn:hover { color: #fff; }
a.idfb-p-more { display: inline-block; }

/* ---------- Variantă compactă (homepage / 404) ---------- */
.idfb-perete.is-compact .idfb-p-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.idfb-perete.is-compact .idfb-p-wall { columns: 3 250px; }
.idfb-perete.is-few .idfb-p-head { flex-direction: column; align-items: center; text-align: center; }
.idfb-perete.is-few .idfb-p-intro { flex: none; }
.idfb-perete.is-few .idfb-p-side { justify-content: center; }
.idfb-perete.is-few .idfb-p-wall { columns: 1; max-width: 380px; margin: 0 auto; }

/* ---------- Particule ---------- */
.idfb-particle {
	position: fixed;
	z-index: 99999;
	pointer-events: none;
	font-size: var(--s, 16px);
	line-height: 1;
	color: var(--c, #f7941d);
	animation: idfb-fly var(--d, 900ms) cubic-bezier(.15, .7, .35, 1) forwards;
}
@keyframes idfb-fly {
	0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
	100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1); }
}

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
	.idfb-perete { border-radius: 20px; }
	.idfb-p-row { grid-template-columns: 1fr; }
	.idfb-p-side { width: 100%; justify-content: space-between; }
	.idfb-p-btn { padding: 13px 20px; }
	.idfb-p-wall { column-gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.idfb-perete *, .idfb-perete *::before { animation: none !important; transition: none !important; }
	.idfb-note { opacity: 1; transform: rotate(var(--r)); }
}
