/* ============================================================
 *  CAP AVENIR JEUNES CI — Connexion & Tableaux de bord
 *  Orange #EC753A · Blanc #FFFFFF · Vert #036D00 / #037100
 * ============================================================ */
:root {
  --ci-orange: #EC753A;
  --ci-orange-dark: #d4612a;
  --ci-orange-soft: #fff1ea;
  --ci-green: #036D00;
  --ci-green-2: #037100;
  --ci-green-soft: #eaf6e9;
  --ci-ink: #13230f;
  --ci-muted: #6b7568;
  --ci-ease: cubic-bezier(.22, 1, .36, 1);
  --ci-flag: linear-gradient(90deg, var(--ci-orange) 0 33.33%, #fff 33.33% 66.66%, var(--ci-green) 66.66% 100%);
}

@keyframes ciFadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes ciBob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-10px, -16px); } }
@keyframes ciSpin { to { transform: rotate(360deg); } }
@keyframes ciKen { from { transform: scale(1.04); } to { transform: scale(1.18) translate(-2%, -1%); } }
@keyframes ciShine { 0% { left: -30%; } 60%, 100% { left: 115%; } }
@keyframes ciGrad { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ciShake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes ciWave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
@keyframes ciGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ciPulse { 0% { box-shadow: 0 0 0 0 rgba(3, 109, 0, .45); } 100% { box-shadow: 0 0 0 10px rgba(3, 109, 0, 0); } }

/* Bandeau tricolore */
.ci-flagband { position: fixed; top: 0; left: 0; right: 0; height: 8px; display: flex; z-index: 1100; overflow: hidden; }
.ci-flagband span { flex: 1; }
.ci-flagband .o { background: var(--ci-orange); } .ci-flagband .w { background: #fff; } .ci-flagband .g { background: var(--ci-green); }
.ci-flagband::after { content: ""; position: absolute; top: 0; bottom: 0; width: 20%; left: -30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .8), transparent); animation: ciShine 4.5s ease-in-out infinite; }
.ci-mini-flag { display: inline-flex; width: 20px; height: 13px; border-radius: 3px; overflow: hidden; vertical-align: -2px; box-shadow: 0 0 0 1px #e5e5e5; }
.ci-mini-flag b { flex: 1; } .ci-mini-flag b:nth-child(1) { background: var(--ci-orange); } .ci-mini-flag b:nth-child(2) { background: #fff; } .ci-mini-flag b:nth-child(3) { background: var(--ci-green); }

/* ============================================================ */
/*  PAGE DE CONNEXION                                           */
/* ============================================================ */
.ci-auth-body { background: #fff8f3; min-height: 100vh; }
.ci-auth { display: flex; min-height: 100vh; }
.ci-auth__visual { position: relative; flex: 1 1 58%; overflow: hidden; color: #fff; align-items: flex-end; padding: 60px; }
.ci-auth__bg { position: absolute; inset: -20px; }
.ci-auth__bg img { width: 100%; height: 100%; object-fit: cover; animation: ciKen 18s ease-in-out infinite alternate; transition: translate .4s ease-out; }
.ci-auth__overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(212, 97, 42, .55) 0%, rgba(10, 25, 8, .25) 45%, rgba(3, 109, 0, .92) 100%); }
.ci-auth__shape { position: absolute; border-radius: 50%; pointer-events: none; }
.ci-auth__shape.s1 { width: 380px; height: 380px; top: -140px; right: -120px; border: 48px solid rgba(255, 255, 255, .08); animation: ciSpin 40s linear infinite; }
.ci-auth__shape.s2 { width: 22px; height: 22px; top: 22%; left: 12%; background: var(--ci-orange); box-shadow: 0 0 0 10px rgba(236, 117, 58, .25); animation: ciBob 6s ease-in-out infinite; }
.ci-auth__shape.s3 { width: 14px; height: 14px; top: 38%; right: 18%; background: #fff; animation: ciBob 7s ease-in-out infinite reverse; }
.ci-auth__visual-content { position: relative; z-index: 2; max-width: 620px; animation: ciFadeUp 1s var(--ci-ease) both; }
.ci-auth__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(8px); font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.ci-auth__visual h1 { font-family: "Poppins", sans-serif; font-weight: 800; color: #fff; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.12; margin-bottom: 14px; text-shadow: 0 6px 30px rgba(0, 0, 0, .3); }
.ci-auth__visual h1 span { color: #ffd2bd; }
.ci-auth__visual p { color: rgba(255, 255, 255, .9); font-size: 16px; margin-bottom: 26px; }
.ci-auth__features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ci-auth__feature { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(8px); border-radius: 16px; padding: 14px 10px; text-align: center; font-size: 13px; font-weight: 600; transition: transform .3s var(--ci-ease), background .3s; animation: ciFadeUp .8s var(--ci-ease) both; }
.ci-auth__feature:nth-child(2) { animation-delay: .1s; } .ci-auth__feature:nth-child(3) { animation-delay: .2s; } .ci-auth__feature:nth-child(4) { animation-delay: .3s; }
.ci-auth__feature:hover { transform: translateY(-6px); background: rgba(255, 255, 255, .24); }
.ci-auth__feature i { display: block; font-size: 26px; margin-bottom: 6px; }

.ci-auth__form-side { flex: 1 1 42%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; position: relative; background: radial-gradient(circle at 100% 0%, rgba(236, 117, 58, .12), transparent 40%), radial-gradient(circle at 0% 100%, rgba(3, 109, 0, .1), transparent 45%); }
.ci-auth__card { width: 100%; max-width: 430px; background: #fff; border-radius: 26px; padding: 34px 34px 28px; box-shadow: 0 30px 70px rgba(19, 35, 15, .12); position: relative; overflow: hidden; animation: ciFadeUp .9s var(--ci-ease) both; }
.ci-auth__card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--ci-flag); }
.ci-auth__back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ci-muted); margin-bottom: 14px; transition: color .2s, gap .2s; }
.ci-auth__back:hover { color: var(--ci-orange); gap: 8px; }
.ci-auth__logo img { width: 84px; height: auto; border-radius: 16px; transition: transform .5s var(--ci-ease); }
.ci-auth__logo img:hover { transform: rotate(-6deg) scale(1.05); }
.ci-auth__title { font-family: "Poppins", sans-serif; font-weight: 800; color: var(--ci-ink); margin: 16px 0 4px; }
.ci-auth__title .wave { display: inline-block; transform-origin: 70% 70%; animation: ciWave 2.4s ease-in-out infinite; }
.ci-auth__subtitle { color: var(--ci-muted); margin-bottom: 22px; }
.ci-auth__link { color: var(--ci-orange); font-weight: 600; }
.ci-auth__link:hover { color: var(--ci-green); }
.ci-field .form-label { font-weight: 600; color: var(--ci-ink); font-size: 13px; text-transform: none; letter-spacing: 0; }
.ci-input { position: relative; }
.ci-input .ci-input__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--ci-orange); z-index: 5; pointer-events: none; }
.ci-input .form-control { padding-left: 42px !important; min-height: 48px; border-radius: 14px !important; border-color: #e4e8e2; transition: border-color .2s, box-shadow .2s; }
.ci-input.input-group .form-control { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.ci-input.input-group .input-group-text { border-radius: 0 14px 14px 0 !important; border-color: #e4e8e2; }
.ci-input .form-control:focus { border-color: var(--ci-orange) !important; box-shadow: 0 0 0 4px rgba(236, 117, 58, .15) !important; }
.ci-input.input-group:focus-within .input-group-text { border-color: var(--ci-orange) !important; }
.ci-auth__submit { position: relative; overflow: hidden; border: 0; border-radius: 14px; min-height: 50px; font-weight: 700; font-size: 15.5px; color: #fff !important; background: linear-gradient(120deg, var(--ci-orange), var(--ci-orange-dark), var(--ci-green-2), var(--ci-green)); background-size: 300% 100%; box-shadow: 0 14px 30px rgba(236, 117, 58, .35); transition: background-position .6s var(--ci-ease), transform .2s, box-shadow .2s; }
.ci-auth__submit:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 18px 36px rgba(3, 109, 0, .3); }
.ci-auth__submit:active { transform: scale(.98); }
.ci-auth__submit.is-loading span { opacity: 0; }
.ci-auth__submit.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: ciSpin .8s linear infinite; }
.ci-social { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #f4f6f3; color: var(--ci-muted); transition: all .25s var(--ci-ease); }
.ci-social:hover { background: var(--ci-orange); color: #fff; transform: translateY(-3px); }
.ci-auth__copy { margin-top: 18px; color: var(--ci-muted); font-size: 12.5px; text-align: center; }
.ci-shake { animation: ciShake .6s both; }
@media (max-width: 991px) {
  .ci-auth__form-side { min-height: 100vh; background: linear-gradient(180deg, rgba(236, 117, 58, .08), rgba(3, 109, 0, .06)); }
  .ci-auth__card { padding: 28px 22px 24px; }
}

/* ============================================================ */
/*  TABLEAUX DE BORD                                            */
/* ============================================================ */
.ci-dash-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 28px 30px; color: #fff; margin-bottom: 22px; background: linear-gradient(120deg, var(--ci-orange-dark), var(--ci-orange) 35%, #5f8f2b 70%, var(--ci-green)); background-size: 220% 220%; animation: ciGrad 14s ease infinite; box-shadow: 0 20px 44px rgba(236, 117, 58, .25); }
.ci-dash-hero::before { content: ""; position: absolute; width: 280px; height: 280px; right: -70px; top: -120px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .1); animation: ciSpin 40s linear infinite; }
.ci-dash-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1.4px); background-size: 20px 20px; opacity: .25; -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000); mask-image: linear-gradient(90deg, transparent 40%, #000); }
.ci-dash-hero > * { position: relative; z-index: 1; }
.ci-dash-hero h3 { color: #fff; font-weight: 800; margin-bottom: 6px; animation: ciFadeUp .7s var(--ci-ease) both; }
.ci-dash-hero p { color: rgba(255, 255, 255, .9); margin: 0; max-width: 640px; animation: ciFadeUp .7s var(--ci-ease) .1s both; }
.ci-dash-hero .wave { display: inline-block; transform-origin: 70% 70%; animation: ciWave 2.4s ease-in-out infinite; }
.ci-dash-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; animation: ciFadeUp .7s var(--ci-ease) .2s both; }
.ci-dash-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); }
a.ci-dash-pill:hover { background: #fff; color: var(--ci-green); }
.ci-dash-hero__illu { position: absolute; right: 26px; bottom: -6px; height: 150px; z-index: 1; animation: ciBob 6s ease-in-out infinite; }
@media (max-width: 991px) { .ci-dash-hero__illu { display: none; } }

.ci-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ci-period__btn { padding: 6px 14px; border-radius: 999px; border: 1px solid #e4e8e2; background: #fff; color: var(--ci-muted); font-weight: 600; font-size: 13px; transition: all .2s; }
.ci-period__btn:hover { border-color: var(--ci-orange); color: var(--ci-orange); }
.ci-period__btn.is-active { background: var(--ci-orange); border-color: var(--ci-orange); color: #fff; box-shadow: 0 8px 18px rgba(236, 117, 58, .3); }

.ci-kpi { position: relative; overflow: hidden; border: 0; border-radius: 20px; padding: 20px 20px 18px; color: #fff; height: 100%; box-shadow: 0 14px 30px rgba(19, 35, 15, .1); transition: transform .35s var(--ci-ease), box-shadow .35s var(--ci-ease); animation: ciFadeUp .7s var(--ci-ease) both; }
.ci-kpi:hover { transform: translateY(-6px); box-shadow: 0 22px 40px rgba(19, 35, 15, .18); }
.ci-kpi::after { content: ""; position: absolute; width: 130px; height: 130px; right: -40px; bottom: -50px; border-radius: 50%; background: rgba(255, 255, 255, .14); transition: transform .5s var(--ci-ease); }
.ci-kpi:hover::after { transform: scale(1.4); }
.ci-kpi--orange { background: linear-gradient(135deg, #f08a55, var(--ci-orange-dark)); }
.ci-kpi--green { background: linear-gradient(135deg, #1a8a14, var(--ci-green)); }
.ci-kpi--ink { background: linear-gradient(135deg, #2b3a28, var(--ci-ink)); }
.ci-kpi--sand { background: linear-gradient(135deg, #f2b38d, #d9824f); }
.ci-kpi--leaf { background: linear-gradient(135deg, #6aa83e, #3b7a1f); }
.ci-kpi__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ci-kpi__label { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .88); margin: 0; }
.ci-kpi__icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); font-size: 21px; flex: 0 0 auto; }
.ci-kpi__value { font-size: 32px; font-weight: 800; line-height: 1; margin: 12px 0 6px; color: #fff; font-family: "Poppins", "Public Sans", sans-serif; }
.ci-kpi__sub { font-size: 12px; color: rgba(255, 255, 255, .85); position: relative; z-index: 1; }

.ci-panel { border: 0; border-radius: 20px; box-shadow: 0 10px 30px rgba(19, 35, 15, .06); overflow: hidden; animation: ciFadeUp .7s var(--ci-ease) both; }
.ci-panel .card-header { background: #fff; border-bottom: 1px solid #f0f2ef; display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.ci-panel .card-header .ci-panel__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ci-orange-soft); color: var(--ci-orange); font-size: 18px; }
.ci-panel .card-header .ci-panel__icon.is-green { background: var(--ci-green-soft); color: var(--ci-green); }
.ci-panel .card-title { font-size: 15.5px; font-weight: 700; margin: 0; }
.ci-panel table tbody tr { transition: background .2s; }
.ci-panel table tbody tr:hover { background: #fffaf6; }
.ci-rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; font-size: 12px; font-weight: 800; margin-right: 8px; background: #f1f3f0; color: var(--ci-muted); }
tr:nth-child(1) .ci-rank { background: var(--ci-orange); color: #fff; }
tr:nth-child(2) .ci-rank { background: var(--ci-green); color: #fff; }
tr:nth-child(3) .ci-rank { background: #f2b38d; color: #fff; }
.ci-progress-line { height: 6px; border-radius: 99px; background: #f1f3f0; overflow: hidden; margin-top: 6px; }
.ci-progress-line span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--ci-orange), var(--ci-green)); transform-origin: left; animation: ciGrowX 1.2s var(--ci-ease) both; }
@keyframes ciGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.ci-chart-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ci-chart-kpi { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; }
.ci-chart-kpi.is-orange { background: var(--ci-orange-soft); color: var(--ci-orange-dark); }
.ci-chart-kpi.is-green { background: var(--ci-green-soft); color: var(--ci-green); }
.ci-chart-kpi.is-ink { background: #eef0ed; color: var(--ci-ink); }
.ci-bars { display: flex; align-items: flex-end; gap: 8px; min-height: 190px; overflow-x: auto; padding: 10px 2px 4px; }
.ci-bar-item { min-width: 30px; flex: 1 0 30px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ci-bar-value { font-size: 11px; color: var(--ci-muted); line-height: 1; font-weight: 600; }
.ci-bar, .ci-stack { width: 26px; border-radius: 9px 9px 3px 3px; min-height: 6px; transform-origin: bottom; animation: ciGrow 1s var(--ci-ease) both; transition: filter .2s, transform .2s; }
.ci-bar-item:hover .ci-bar, .ci-bar-item:hover .ci-stack { filter: brightness(1.1); }
.ci-stack { overflow: hidden; display: flex; flex-direction: column-reverse; }
.ci-stack span { width: 100%; }
.ci-bar-label { font-size: 10.5px; color: var(--ci-muted); white-space: nowrap; }
.ci-c-orange { background: linear-gradient(180deg, #f59a6c, var(--ci-orange)); }
.ci-c-green { background: linear-gradient(180deg, #2fa128, var(--ci-green)); }
.ci-c-sand { background: linear-gradient(180deg, #f6c7a8, #e39465); }
.ci-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ci-muted); }
.ci-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ci-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.ci-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }
.ci-shortcut { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid #f0f2ef; color: var(--ci-ink); font-weight: 600; font-size: 14px; transition: all .3s var(--ci-ease); }
.ci-shortcut i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--ci-orange-soft); color: var(--ci-orange); transition: all .3s var(--ci-ease); }
.ci-shortcut:nth-child(even) i { background: var(--ci-green-soft); color: var(--ci-green); }
.ci-shortcut:hover { transform: translateY(-4px); border-color: var(--ci-orange); box-shadow: 0 12px 26px rgba(236, 117, 58, .15); color: var(--ci-ink); }
.ci-shortcut:hover i { transform: rotate(-8deg) scale(1.08); }
.ci-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ddc35; animation: ciPulse 1.8s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
