/* =========================================================
   ESPACE CLIENT — CAP CREDIT (navy & or, complément de cap.css)
   ========================================================= */

body.cp { background: var(--ivory); }

/* ============ AUTH (connexion / activation) ============ */
.cp-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: linear-gradient(180deg, var(--navy-deep), var(--navy)); position: relative; overflow: hidden; }
.cp-auth::before { content: ""; position: absolute; left: -10%; bottom: -30%; width: 55%; height: 110%; background: radial-gradient(closest-side, rgba(201,162,74,.2), transparent); pointer-events: none; }
.cp-auth-card { position: relative; background: var(--white); border-radius: 26px; padding: 44px 40px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); text-align: center; }
.cp-mark { width: 74px; height: auto; margin: 0 auto 18px; display: block; }
.cp-auth-card h1 { font-size: 1.6rem; margin-bottom: 8px; }
.cp-sub { color: var(--muted); font-size: .96rem; margin-bottom: 22px; }
.cp-auth-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.cp-auth-card label { display: flex; flex-direction: column; gap: 7px; font-size: .84rem; font-weight: 700; color: var(--navy); }
.cp-auth-card input { padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; font-size: 1rem; font-weight: 400; width: 100%; transition: border-color .2s, box-shadow .2s; }
.cp-auth-card input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(11,43,91,.1); }
.cp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 26px; border-radius: 999px; border: 2px solid transparent; font-weight: 600; cursor: pointer; background: var(--navy); color: var(--white); transition: transform .25s var(--ease), box-shadow .25s, background .25s; box-shadow: 0 10px 24px rgba(11,43,91,.22); margin-top: 6px; }
.cp-btn:hover { transform: translateY(-2px); background: var(--navy-2); }
.cp-btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); box-shadow: none; }
.cp-btn-ghost:hover { background: var(--navy); color: var(--white); }
.cp-btn-sm { padding: 10px 18px; font-size: .9rem; margin: 0; }
.cp-err { background: var(--err-soft); color: var(--err); border-radius: 12px; padding: 12px 16px; font-size: .92rem; font-weight: 600; margin-bottom: 16px; }
.cp-ok { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 12px 16px; font-weight: 700; margin-bottom: 12px; }
.cp-info-msg { background: var(--gold-soft); color: var(--gold-2); border-radius: 12px; padding: 12px 16px; font-size: .92rem; font-weight: 600; margin-bottom: 16px; }
.cp-forgot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.cp-forgot summary { cursor: pointer; font-size: .9rem; color: var(--muted); font-weight: 600; list-style: none; }
.cp-forgot summary::-webkit-details-marker { display: none; }
.cp-forgot summary::before { content: "→ "; color: var(--gold); }
.cp-forgot form { margin-top: 14px; }

/* ============ NAV : compte ============ */
.cp-account { position: relative; }
.cp-account-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--navy-soft); border: 0; border-radius: 999px; padding: 6px 14px 6px 6px; cursor: pointer; font-weight: 600; color: var(--navy); }
.cp-account-ava { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--gold-l); display: grid; place-items: center; font-family: var(--font-display); font-size: .82rem; font-weight: 700; }
.cp-account-caret { font-size: .7rem; color: var(--muted); }
.cp-account-menu { position: absolute; right: 0; top: calc(100% + 10px); background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); min-width: 260px; overflow: hidden; z-index: 20; }
.cp-account-card { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.cp-account-cname { color: var(--navy); font-family: var(--font-display); font-size: .95rem; }
.cp-account-mail { word-break: break-all; }
.cp-account-logout { display: block; padding: 12px 18px; font-weight: 600; color: var(--err); font-size: .92rem; }
.cp-account-logout:hover { background: var(--err-soft); }

/* ============ PORTAIL ============ */
.cp-portal { max-width: 900px; margin: 0 auto; padding: 44px 20px 80px; }
.cp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.cp-h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cp-advisor-card { background: var(--navy); color: var(--white); border-radius: 18px; padding: 16px 18px; min-width: 280px; box-shadow: var(--shadow); }
.cp-advisor-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cp-advisor-pic { width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: var(--navy-deep); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .9rem; flex: none; }
.cp-advisor-label { display: block; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.cp-advisor-name { font-family: var(--font-display); font-size: 1rem; }
.cp-advisor-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-advisor-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600; background: rgba(255,255,255,.12); color: var(--white); transition: background .2s; }
.cp-advisor-btn:hover { background: rgba(255,255,255,.22); }
.cp-advisor-wa { background: #1B8A5A; }
.cp-advisor-wa:hover { background: #157048; }

.cp-tabs { display: flex; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 5px; width: max-content; margin-bottom: 22px; }
.cp-tab { border: 0; background: transparent; padding: 9px 20px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.cp-tab.active { background: var(--navy); color: var(--white); }

.cp-panel { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px; margin-bottom: 20px; box-shadow: var(--shadow); }
.cp-panel h2 { font-size: 1.2rem; }
.cp-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cp-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-2); font-size: .82rem; font-weight: 700; }
.cp-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cp-state-ok { background: var(--ok-soft); color: var(--ok); }
.cp-state-ko { background: var(--err-soft); color: var(--err); }
.cp-progress { height: 10px; background: var(--line); border-radius: 10px; overflow: hidden; }
.cp-progress-bar { height: 100%; background: linear-gradient(90deg, var(--gold-l), var(--gold-2)); border-radius: 10px; transition: width .6s var(--ease); }
.cp-progress-pct { text-align: right; font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: .9rem; margin: 8px 0 18px; }
.cp-timeline { display: grid; gap: 0; position: relative; padding-left: 6px; }
.cp-step { display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--muted); font-size: .96rem; position: relative; }
.cp-step::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.cp-step:first-child::before { top: 50%; }
.cp-step:last-child::before { bottom: 50%; }
.cp-dot { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); background: var(--white); flex: none; position: relative; z-index: 1; }
.cp-step-done { color: var(--ink); }
.cp-step-done .cp-dot { background: var(--navy); border-color: var(--navy); }
.cp-step-done .cp-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--gold-l); }
.cp-step-current { color: var(--navy); font-weight: 700; }
.cp-step-current .cp-dot { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 5px rgba(201,162,74,.2); }

.cp-docs { display: grid; gap: 8px; }
.cp-doc { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 16px; background: var(--ivory); border-radius: 12px; font-size: .95rem; flex-wrap: wrap; }
.cp-doc-name { font-weight: 600; color: var(--ink); }
.cp-doc-actions { display: flex; align-items: center; gap: 12px; }
.cp-doc-actions a { color: var(--navy); font-weight: 600; font-size: .88rem; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.cp-badge { padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.cp-badge-valide { background: var(--ok-soft); color: var(--ok); }
.cp-badge-refuse { background: var(--err-soft); color: var(--err); }
.cp-badge-attente { background: var(--navy-soft); color: var(--navy); }
.cp-badge-todo { background: var(--gold-soft); color: var(--gold-2); }
.cp-complete { display: flex; flex-direction: column; gap: 4px; background: var(--ok-soft); color: var(--ok); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.cp-complete span { color: var(--ink); font-size: .92rem; }
.cp-missing { display: flex; flex-direction: column; gap: 3px; background: var(--gold-soft); border-radius: 14px; padding: 14px 18px; margin-top: 14px; color: var(--gold-2); }
.cp-missing span { color: var(--muted); font-size: .9rem; }
.cp-muted { color: var(--muted); font-size: .95rem; margin: 0; }
.cp-info { display: grid; gap: 0; margin-top: 12px; }
.cp-info-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.cp-info-row:last-child { border: 0; }
.cp-info-row span { color: var(--muted); }
.cp-info-row strong { color: var(--ink); text-align: right; }

@media (max-width: 640px) {
    .cp-auth-card { padding: 32px 22px; }
    .cp-panel { padding: 22px 18px; }
    .cp-advisor-card { width: 100%; }
    .cp-account-txt { display: none; }
}
