/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary:    #6d9b8a;
    --primary-dk: #4e7a6b;
    --accent:     #c9956c;
    --bg:         #f9f7f4;
    --surface:    #ffffff;
    --border:     #e2ddd7;
    --text:       #2c2c2c;
    --text-muted: #6b6b6b;
    --error:      #c0392b;
    --success:    #27ae60;
    --radius:     10px;
    --shadow:     0 2px 12px rgba(0,0,0,.08);
}
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary-dk); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0ede8; padding: 2px 6px; border-radius: 4px; font-size:.9em; }

/* ── Layout ──────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.main-content { padding: 2rem 1.5rem 4rem; }

/* ── Header ──────────────────────────────────────────────────── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.3rem; font-weight: 700; color: var(--primary-dk); }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.main-nav a { padding: .4rem .75rem; border-radius: 6px; font-size: .9rem; transition: background .2s; }
.main-nav a:hover { background: var(--bg); text-decoration: none; }
.nav-cta { background: var(--primary) !important; color: #fff !important; font-weight: 600; }
.nav-logout { color: var(--error) !important; }
.coming-soon { padding: .4rem .75rem; font-size: .85rem; color: var(--text-muted); cursor: default; border-radius: 6px; border: 1px dashed var(--border); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 1.5rem 0; text-align: center; color: var(--text-muted); font-size: .875rem; margin-top: 4rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { display: inline-block; padding: .65rem 1.4rem; border-radius: var(--radius); font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--primary-dk); border: 1.5px solid var(--primary); }
.btn-secondary:hover { background: #edf5f2; text-decoration: none; }
.btn-full { width: 100%; text-align: center; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: .9rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { background: linear-gradient(135deg, #4e7a6b 0%, #6d9b8a 60%, #c9956c 100%); color: #fff; padding: 5rem 2rem; border-radius: 16px; text-align: center; margin-bottom: 3rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.1rem; opacity: .9; max-width: 600px; margin: 0 auto 2rem; }
.hero .btn { margin: .4rem; }
.hero .btn-secondary { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.5); }

/* ── Features ────────────────────────────────────────────────── */
.features h2 { text-align: center; margin-bottom: 2rem; font-size: 1.6rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--surface); border-radius: var(--radius); padding: 1.75rem 1.5rem; box-shadow: var(--shadow); text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { margin-bottom: .5rem; color: var(--primary-dk); }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-page { max-width: 700px; margin: 0 auto; }
.form-page--narrow { max-width: 450px; }
.form-page h1 { margin-bottom: .5rem; }
.form-page > p { color: var(--text-muted); margin-bottom: 1.5rem; }
.form-card { background: var(--surface); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; margin-bottom: 1.2rem; }
.form-group label { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--text); }
.form-group input, .form-group select { padding: .65rem .9rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: 1rem; background: var(--bg); transition: border-color .2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); background: #fff; }
.form-group.has-error input, .form-group.has-error select { border-color: var(--error); }
.error-msg { color: var(--error); font-size: .82rem; margin-top: .3rem; }
.input-disabled { opacity: .6; cursor: not-allowed; }
.form-hint { color: var(--text-muted); font-size: .88rem; margin-bottom: 1rem; }
.form-section-title { font-size: 1rem; color: var(--primary-dk); text-transform: uppercase; letter-spacing: .05em; margin: 1.5rem 0 .75rem; border-top: 1px solid var(--border); padding-top: 1.2rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Password strength ───────────────────────────────────────── */
.password-strength { margin-top: .5rem; }
.strength-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
#strength-fill { height: 100%; width: 0; border-radius: 3px; transition: width .3s, background .3s; }
#strength-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; display: block; }
.password-rules { list-style: none; font-size: .82rem; margin-top: .5rem; color: var(--text-muted); }
.password-rules li { padding: .15rem 0; }
.password-rules li::before { content: '✗ '; color: var(--error); }
.password-rules li.valid::before { content: '✓ '; color: var(--success); }
.password-rules li.valid { color: var(--success); }

/* ── Info card ───────────────────────────────────────────────── */
.info-card { background: var(--surface); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 2rem; }
.info-card h2 { margin-bottom: 1.2rem; font-size: 1.1rem; color: var(--primary-dk); }
.info-list { display: flex; flex-direction: column; gap: .7rem; }
.info-row { display: flex; gap: 1rem; }
.info-row dt { font-weight: 600; min-width: 160px; color: var(--text-muted); font-size: .9rem; }
.info-row dd { color: var(--text); }

/* ── Profile page ────────────────────────────────────────────── */
.profile-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.profile-header h1 { font-size: 1.8rem; }

/* ── Dossiers ────────────────────────────────────────────────── */
.dossiers-section .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.dossiers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.dossier-card { display: flex; align-items: center; gap: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s; }
.dossier-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.dossier-icon { font-size: 1.8rem; }
.dossier-card strong { display: block; font-weight: 700; }
.dossier-card span, .dossier-card time { display: block; font-size: .82rem; color: var(--text-muted); }
.dossiers-grid--large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dossier-card--large { flex-direction: column; align-items: flex-start; padding: 0; overflow: hidden; }
.dossier-card--large .dossier-info { padding: 1rem; }
.dossier-photo { width: 100%; height: 160px; object-fit: cover; }
.dossier-photo-placeholder { width: 100%; height: 160px; background: #edf5f2; display: flex; align-items: center; justify-content: center; font-size: 3rem; }

/* ── List page ───────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.empty-state { color: var(--text-muted); }
.empty-state-block { text-align: center; padding: 4rem 2rem; background: var(--surface); border-radius: var(--radius); }
.empty-state-block p { font-size: 1.1rem; margin-bottom: 1rem; }

/* ── Detail page ─────────────────────────────────────────────── */
.detail-header { margin-bottom: 2rem; }
.detail-header a { color: var(--text-muted); font-size: .9rem; }
.detail-header h1 { font-size: 1.8rem; margin: .5rem 0; }
.badge { display: inline-block; background: var(--primary); color: #fff; padding: .25rem .8rem; border-radius: 20px; font-size: .85rem; }
.detail-photo { margin-bottom: 1.5rem; }
.detail-photo img { max-width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .main-nav ul { gap: .25rem; }
}
