/* =============================================
   FISC.LU — Design system
   Colors: Navy #1B3A6B, Gold #EAB308, Slate #64748B
   ============================================= */

:root {
  --navy: #1B3A6B;
  --navy-light: #2D5299;
  --navy-dark: #0F2347;
  --gold: #EAB308;
  --gold-light: #FDE68A;
  --slate: #64748B;
  --slate-light: #94A3B8;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-muted: #64748B;
  --success: #16A34A;
  --error: #DC2626;
  --warning: #D97706;
  --info: #2563EB;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

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

/* =============================================
   NAVIGATION
   ============================================= */
.site-header {
  background: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  position: sticky; top: 0; z-index: 100;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav__logo {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  text-decoration: none; letter-spacing: -.02em;
}
.nav__logo svg { flex-shrink: 0; }
.nav__logo-accent { color: var(--gold); }
.nav__links { display: flex; align-items: center; gap: 1.25rem; }
.nav__link { color: rgba(255,255,255,.8); font-size: .9rem; transition: color .15s; }
.nav__link:hover { color: #fff; text-decoration: none; }
.nav__link--admin { color: var(--gold-light); }
.nav__link--logout { color: rgba(255,255,255,.55); }
.nav__user {
  color: rgba(255,255,255,.6); font-size: .85rem;
  padding: .2rem .5rem; background: rgba(255,255,255,.08); border-radius: 4px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.25rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; border: 2px solid transparent;
  transition: all .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.btn--primary:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn--outline {
  background: transparent; color: var(--navy); border-color: var(--navy);
}
.btn--outline:hover { background: var(--navy); color: #fff; }
.btn--gold {
  background: var(--gold); color: var(--navy-dark); border-color: var(--gold);
}
.btn--gold:hover { background: #CA9A06; border-color: #CA9A06; }
.btn--sm { padding: .35rem .85rem; font-size: .82rem; }
.btn--lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn--full { width: 100%; }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content { min-height: calc(100vh - 60px - 120px); padding: 2.5rem 0; }

/* =============================================
   FLASH & ALERTS
   ============================================= */
.flash, .alert {
  padding: .85rem 1.25rem; border-radius: var(--radius);
  margin-bottom: 1.5rem; font-size: .9rem; border-left: 4px solid;
}
.flash--success, .alert--success { background: #F0FDF4; border-color: var(--success); color: #15803D; }
.flash--error, .alert--error { background: #FEF2F2; border-color: var(--error); color: #B91C1C; }
.flash--warning, .alert--warning { background: #FFFBEB; border-color: var(--warning); color: #92400E; }
.flash--info, .alert--info { background: #EFF6FF; border-color: var(--info); color: #1D4ED8; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex; align-items: center;
  padding: .15rem .6rem; border-radius: 100px;
  font-size: .75rem; font-weight: 600;
}
.badge--draft { background: #F1F5F9; color: var(--slate); }
.badge--in_progress { background: #EFF6FF; color: var(--info); }
.badge--review { background: #FFFBEB; color: var(--warning); }
.badge--complete { background: #F0FDF4; color: var(--success); }
.badge--available { background: #EFF6FF; color: var(--info); }
.badge--required { background: #FEF2F2; color: var(--error); }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--text); }
.form-control {
  width: 100%; padding: .6rem .85rem; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; color: var(--text);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,58,107,.12);
}

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-page {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 4rem 1rem;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 2.5rem;
}
.auth-card__header {
  text-align: center; margin-bottom: 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.auth-card__header h1 { font-size: 1.5rem; color: var(--navy); }
.auth-card__footer {
  text-align: center; margin-top: 1.5rem;
  font-size: .875rem; color: var(--text-muted);
}
.auth-form .btn { margin-top: .5rem; }

/* =============================================
   HERO
   ============================================= */
.hero { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%); color: #fff; padding: 5rem 0 4rem; }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero__title { font-size: 2.6rem; font-weight: 800; line-height: 1.15; margin-bottom: 1.25rem; letter-spacing: -.03em; }
.hero__accent { color: var(--gold); }
.hero__subtitle { font-size: 1.1rem; color: rgba(255,255,255,.8); margin-bottom: 2rem; line-height: 1.7; }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__actions .btn--primary { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }
.hero__actions .btn--primary:hover { background: #CA9A06; }
.hero__actions .btn--outline { border-color: rgba(255,255,255,.4); color: #fff; }
.hero__actions .btn--outline:hover { background: rgba(255,255,255,.1); }

.hero__illustration { display: flex; justify-content: center; }
.hero__doc-preview {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 320px;
}
.doc-line {
  height: 12px; background: rgba(255,255,255,.12); border-radius: 6px; margin-bottom: 1rem;
}
.doc-line--title { background: rgba(234,179,8,.3); height: 16px; width: 60%; }
.doc-line--short { width: 50%; }
.doc-line--amount { background: rgba(234,179,8,.2); width: 40%; margin-left: auto; }

/* =============================================
   FEATURES
   ============================================= */
.features { padding: 5rem 0; }
.section-title { text-align: center; font-size: 1.9rem; font-weight: 700; color: var(--navy); margin-bottom: 3rem; }
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.feature-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; text-align: center;
}
.feature-card__icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: .75rem; }
.feature-card p { color: var(--text-muted); font-size: .9rem; line-height: 1.65; }

.cta-section { background: var(--bg); padding: 4rem 0; }
.cta-box {
  background: var(--navy); color: #fff; border-radius: var(--radius-lg);
  padding: 3rem; text-align: center;
}
.cta-box h2 { font-size: 1.75rem; margin-bottom: .75rem; }
.cta-box p { color: rgba(255,255,255,.75); margin-bottom: 1.5rem; }
.cta-box .btn--primary { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }

/* =============================================
   DASHBOARD
   ============================================= */
.page-dashboard { }
.page-header { margin-bottom: 2.5rem; }
.page-header h1 { font-size: 1.75rem; color: var(--navy); margin-bottom: .25rem; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.declaration-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color .15s, box-shadow .15s; cursor: pointer;
  text-decoration: none; color: var(--text);
}
.declaration-card:hover { border-color: var(--navy); box-shadow: var(--shadow-md); text-decoration: none; }
.declaration-card--new { background: #F8FAFF; border-style: dashed; border-color: var(--navy-light); }
.declaration-card--new:hover { background: #EFF6FF; }
.declaration-card__year { font-size: 1.75rem; font-weight: 800; color: var(--navy); min-width: 64px; }
.declaration-card__info { flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.declaration-card__type { font-size: .82rem; color: var(--text-muted); }
.declaration-card__arrow { color: var(--slate-light); font-size: 1.25rem; }

section.declarations-list, section.new-declaration { margin-bottom: 3rem; }
section.declarations-list h2, section.new-declaration h2 {
  font-size: 1.1rem; font-weight: 600; color: var(--navy);
  margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--border);
}

/* =============================================
   WIZARD
   ============================================= */
.page-wizard { max-width: 720px; margin: 0 auto; }
.wizard-header { margin-bottom: 2.5rem; }
.wizard-header h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: .5rem; }
.wizard-intro { color: var(--text-muted); }

.wizard-progress {
  display: flex; gap: 0; margin-bottom: 2rem;
  border-radius: var(--radius); overflow: hidden; border: 1.5px solid var(--border);
  background: var(--bg-card);
}
.wizard-progress__step {
  flex: 1; text-align: center; padding: .6rem .5rem;
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  border-right: 1.5px solid var(--border);
}
.wizard-progress__step:last-child { border-right: none; }
.wizard-progress__step--active { background: var(--navy); color: #fff; }
.wizard-progress__step--done { background: #F0FDF4; color: var(--success); }

.wizard-section {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem;
  border: none;
}
.wizard-section legend {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 1rem; padding: 0;
  display: block; width: 100%;
}
.wizard-section fieldset { border: none; padding: 0; }
.wizard-form { display: flex; flex-direction: column; gap: 1.25rem; }

fieldset.wizard-section {
  background: var(--bg-card); border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 0;
}

.toggle-row {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: .85rem; border-radius: var(--radius);
  cursor: pointer; transition: background .12s;
  margin-bottom: .5rem;
}
.toggle-row:last-child { margin-bottom: 0; }
.toggle-row:hover { background: var(--bg); }
.toggle-row input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--navy); flex-shrink: 0; }
.toggle-row__text { display: flex; flex-direction: column; gap: .15rem; }
.toggle-row__text strong { font-size: .9rem; }
.toggle-row__text small { color: var(--text-muted); font-size: .8rem; }

.wizard-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; }

/* =============================================
   JUSTIFICATIFS
   ============================================= */
.page-justificatifs { max-width: 960px; margin: 0 auto; }
.justificatifs-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; margin-bottom: 2rem; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 3rem 2rem; text-align: center; background: #FAFBFE;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--navy); background: #EFF6FF; }
.upload-zone p { color: var(--text-muted); margin: .5rem 0; font-size: .9rem; }
.upload-zone__sub { color: var(--slate-light); font-size: .8rem; }
.upload-zone__hint { font-size: .75rem; color: var(--slate-light); margin-top: 1rem; }
.upload-zone label { margin: .75rem auto 0; }

.doc-checklist { display: flex; flex-direction: column; gap: .5rem; }
.doc-checklist__item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .82rem;
}
.doc-checklist__item--required { border-color: #FECACA; background: #FFF5F5; }
.doc-checklist__icon { font-size: 1rem; flex-shrink: 0; }
.doc-checklist .badge { margin-left: auto; }

.justificatifs-types h3 {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem;
}

/* =============================================
   PLACEHOLDERS
   ============================================= */
.placeholder-notice {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  color: var(--text-muted); font-size: .9rem;
}
.placeholder-notice p { margin-bottom: .5rem; }
.placeholder-notice--large { padding: 3rem; text-align: center; }
.placeholder-notice--large h2 { color: var(--navy); font-size: 1.3rem; margin-bottom: 1rem; }
.placeholder-notice--large ul { text-align: left; display: inline-block; margin: 1rem 0; }
.placeholder-notice--large li { padding: .3rem 0; color: var(--text-muted); }
.placeholder-notice--large li::before { content: '✓ '; color: var(--slate-light); }
.placeholder-notice .btn { margin-top: 1rem; }

/* =============================================
   ADMIN
   ============================================= */
.page-admin { }
.page-admin h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: 2rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.admin-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  display: block; color: var(--text); transition: box-shadow .15s, border-color .15s;
}
.admin-card:hover { box-shadow: var(--shadow-md); border-color: var(--navy); text-decoration: none; }
.admin-card h3 { color: var(--navy); margin-bottom: .4rem; }
.admin-card p { font-size: .85rem; color: var(--text-muted); }

.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.data-table th, .data-table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .875rem; }
.data-table th { background: var(--bg); font-weight: 600; color: var(--navy); }
.data-table tbody tr:hover { background: #F8FAFF; }

/* =============================================
   PAGE HEADER & BREADCRUMB
   ============================================= */
.page-breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: var(--text-muted); margin-bottom: 1.5rem;
}
.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--navy); }

.page-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--navy-dark); color: rgba(255,255,255,.5);
  padding: 2rem 0; margin-top: auto;
}
.site-footer .container { text-align: center; }
.footer__copy { font-size: .85rem; margin-bottom: .35rem; color: rgba(255,255,255,.7); }
.footer__disclaimer { font-size: .75rem; margin-bottom: 1rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.footer__links { display: flex; justify-content: center; gap: 1.5rem; }
.footer__links a { font-size: .78rem; color: rgba(255,255,255,.4); }
.footer__links a:hover { color: rgba(255,255,255,.7); }

/* =============================================
   ERROR PAGE
   ============================================= */
.error-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.error-page h1 { font-size: 5rem; color: var(--navy); font-weight: 800; }
.error-page p { color: var(--text-muted); margin: 1rem 0 2rem; }

/* =============================================
   FORM 100F SECTIONS
   ============================================= */
.page-form { max-width: 1060px; margin: 0 auto; }
.form-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1.5px solid var(--border);
}
.form-header h1 { font-size: 1.6rem; color: var(--navy); }
.text-muted { color: var(--text-muted); font-size: .875rem; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.form-save-status {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--text-muted);
}
.save-dot {
  width: 8px; height: 8px; border-radius: 50%;
  transition: background .3s;
}
.save-dot--idle    { background: var(--border); }
.save-dot--saving  { background: var(--warning); animation: pulse .8s infinite; }
.save-dot--saved   { background: var(--success); }
.save-dot--error   { background: var(--error); }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }

.form-section {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 1.25rem; overflow: hidden;
}
.form-section__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; cursor: pointer;
  background: #F8FAFC; border-bottom: 1.5px solid var(--border);
  user-select: none;
}
.form-section__header:hover { background: #EFF6FF; }
.form-section__header h2 { font-size: 1rem; color: var(--navy); font-weight: 700; margin: 0; }
.section-toggle-icon { color: var(--slate); font-size: .8rem; }
.form-section__body { padding: 0; }

.form-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.form-table thead tr { background: var(--bg); }
.form-table th {
  padding: .6rem 1rem; text-align: left; font-weight: 600;
  color: var(--text-muted); border-bottom: 1.5px solid var(--border);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
}
.form-table td { padding: .55rem 1rem; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.form-table tbody tr:last-child td { border-bottom: none; }
.form-table tbody tr:hover { background: #FAFBFF; }
.field-row--calc { background: #FAFBFC; }
.field-row--calc td { color: var(--text-muted); }

.col-code { width: 90px; }
.col-label { }
.col-value { width: 160px; }
.col-status { width: 80px; text-align: center; }

.field-input {
  width: 100%; padding: .4rem .6rem;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: .875rem; text-align: right; font-family: var(--font-mono);
  transition: border-color .15s;
}
.field-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(27,58,107,.1); }
.field-computed {
  display: block; text-align: right; font-family: var(--font-mono);
  font-size: .875rem; color: var(--text-muted); padding: .4rem .6rem;
}
.field-hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: .65rem; cursor: help; margin-left: .3rem;
}
.field-ceiling { display: block; font-size: .72rem; color: var(--warning); margin-top: .1rem; }

.section-total {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 1rem; padding: .75rem 1.25rem;
  background: var(--bg); border-top: 1.5px solid var(--border);
  font-size: .9rem;
}

.badge--success  { background: #F0FDF4; color: var(--success); }
.badge--info     { background: #EFF6FF; color: var(--info); }
.badge--neutral  { background: #F1F5F9; color: var(--slate); }
.badge--warning  { background: #FFFBEB; color: var(--warning); }
.badge--category { background: #EFF6FF; color: var(--info); }
.badge--conf     { background: #FEF9EC; color: #92400E; }
.badge--orphan   { background: #FEF2F2; color: var(--error); }

.inline-form { display: inline; }
.btn--danger { background: #FEF2F2; color: var(--error); border-color: #FECACA; }
.btn--danger:hover { background: var(--error); color: #fff; border-color: var(--error); }

/* Property cards in L section */
.property-cards { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 1.25rem; }
.property-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.property-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}
.property-card__header strong { display: block; font-size: .9rem; color: var(--navy); }
.property-card__header small { color: var(--text-muted); font-size: .78rem; }
.property-card__actions { display: flex; gap: .4rem; }
.property-card__body { padding: .75rem 1rem; }
.property-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .75rem; margin-bottom: .5rem; }
.property-kv > div { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; }
.property-kv span { color: var(--text-muted); }
.property-kv strong { font-family: var(--font-mono); font-size: .85rem; }
.section-empty { padding: 2rem 1.25rem; color: var(--text-muted); font-size: .9rem; }

/* =============================================
   PROPERTY FORM (190F)
   ============================================= */
.page-property { max-width: 860px; margin: 0 auto; }
.page-property h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: .25rem; }
.property-form { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }

.form-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.form-card__title {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  margin-bottom: 1.25rem; padding-bottom: .75rem;
  border-bottom: 1.5px solid var(--border);
}
.amort-separator { margin: 1rem 0 .5rem; }
.amort-separator hr { border: none; border-top: 1px dashed var(--border); margin-bottom: .75rem; }

.form-grid { display: grid; gap: 1rem; }
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-group--full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.form-group input[type=text],
.form-group input[type=number],
.form-group input[type=date],
.form-group select,
.form-group textarea {
  padding: .5rem .75rem; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; color: var(--text);
  background: #fff; transition: border-color .15s;
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(27,58,107,.1);
}
.required { color: var(--error); }
.toggle-row--inline { flex-direction: row; align-items: flex-start; gap: .75rem; padding: .5rem 0; }
.toggle-row--inline small { color: var(--text-muted); font-size: .78rem; display: block; margin-top: .15rem; }

.amort-preview, .result-preview {
  margin-top: 1.25rem; border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.amort-preview__row, .result-preview__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem 1rem; font-size: .875rem;
  border-bottom: 1px solid #F1F5F9;
}
.amort-preview__row:last-child, .result-preview__row:last-child { border-bottom: none; }
.amort-preview__row--result, .result-preview__row--total {
  background: #F0FDF4; font-weight: 600;
}
.amort-preview__row span:first-child, .result-preview__row span:first-child, .result-preview__row strong:first-child {
  color: var(--text-muted); font-size: .82rem;
}
.amort-preview__row span:last-child, .result-preview__row span:last-child { font-family: var(--font-mono); }
.amort-preview__row--days { background: #FAFBFC; }
.result-net { font-family: var(--font-mono); }

/* =============================================
   JUSTIFICATIFS REDESIGN
   ============================================= */
.page-justificatifs { max-width: 1060px; margin: 0 auto; }
.justif-layout { display: grid; grid-template-columns: 340px 1fr; gap: 2rem; margin-bottom: 2rem; }
.justif-upload-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.justif-list-panel { display: flex; flex-direction: column; gap: 1rem; }
.justif-list-header { display: flex; justify-content: space-between; align-items: center; }
.justif-list-header h2 { font-size: 1.05rem; color: var(--navy); font-weight: 700; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem; text-align: center; background: #FAFBFE;
  cursor: pointer; transition: all .15s; color: var(--text-muted);
}
.upload-zone svg { margin: 0 auto .75rem; color: var(--slate-light); }
.upload-zone__text { font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.upload-zone__sub { font-size: .8rem; margin: .25rem 0; }
.upload-zone__hint { font-size: .72rem; color: var(--slate-light); margin-top: .75rem; }
.upload-zone:hover, .upload-zone--dragover { border-color: var(--navy); background: #EFF6FF; }
.upload-zone--has-file { border-color: var(--success); background: #F0FDF4; }

.file-preview {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .85rem; border: 1.5px solid var(--success);
  border-radius: var(--radius); background: #F0FDF4; font-size: .85rem;
}
.file-preview__name { flex: 1; font-weight: 600; color: var(--success); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview__size { color: var(--text-muted); font-size: .78rem; flex-shrink: 0; }
.hidden { display: none !important; }

.upload-progress { margin: .5rem 0; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: .35rem; }
.progress-bar__fill { height: 100%; background: var(--navy); width: 0%; animation: progressAnim 1.5s ease-in-out infinite; }
@keyframes progressAnim { 0%{width:0%}60%{width:80%}100%{width:90%} }
#progressLabel { font-size: .78rem; color: var(--text-muted); }

.doc-checklist-panel { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.doc-checklist-panel h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; }
.doc-checklist { display: flex; flex-direction: column; gap: .4rem; }
.doc-checklist__item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .8rem; color: var(--text);
}
.doc-checklist__item--done { border-color: #BBF7D0; background: #F0FDF4; color: var(--success); }
.doc-checklist__item .badge { margin-left: auto; flex-shrink: 0; }
.doc-checklist__icon { font-size: .9rem; flex-shrink: 0; }

.justif-list { display: flex; flex-direction: column; gap: .75rem; }
.justif-item {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  transition: border-color .15s;
}
.justif-item--orphan { border-color: #FECACA; background: #FFF5F5; }
.justif-item:hover { border-color: var(--slate-light); }
.justif-item__main { display: flex; align-items: flex-start; gap: .75rem; }
.justif-item__icon { color: var(--slate-light); flex-shrink: 0; margin-top: .1rem; }
.justif-item__info { flex: 1; min-width: 0; }
.justif-item__name { font-size: .875rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .35rem; }
.justif-item__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.meta-sep { font-size: .78rem; color: var(--text-muted); }
.justif-item__actions { display: flex; gap: .4rem; margin-left: auto; padding-left: .75rem; flex-shrink: 0; }

.justif-edit {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* =============================================
   FORM PAGE — TOPBAR + SECTION REDESIGN
   ============================================= */
.form-topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; background: var(--bg-card);
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 1.25rem; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.form-topbar__left { display: flex; gap: .5rem; align-items: center; flex: 1; }
.form-topbar__right { display: flex; gap: .5rem; align-items: center; }

.form-section__header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
  padding: .9rem 1.25rem; background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}
.form-section__header:hover { background: #F0F4F8; }
.section-header__info { flex: 1; min-width: 0; }
.section-header__info h2 { font-size: .95rem; font-weight: 700; color: var(--navy); margin: 0 0 .35rem; }
.section-header__badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.section-toggle-icon { font-size: .8rem; color: var(--text-muted); flex-shrink: 0; margin-left: .75rem; }

/* Section non sélectionnée dans le wizard */
.form-section--inactive .form-section__header { background: #F9FAFB; opacity: .85; }
.form-section--inactive .form-section__header h2 { color: var(--text-muted); font-weight: 600; }

/* Badge muted */
.badge--muted { background: #F1F5F9; color: #94A3B8; }

/* Groupe de sections non pertinentes */
.form-section-group { margin: 2rem 0; }
.form-section-group--inactive { opacity: .9; }
.form-section-group__header {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 1.25rem;
  background: #FFFBEB; border: 1.5px solid #FDE68A;
  border-radius: var(--radius-lg); cursor: pointer;
  transition: background .15s;
}
.form-section-group__header:hover { background: #FEF3C7; }
.section-group__info {
  display: flex; gap: .75rem; align-items: flex-start; flex: 1;
}
.section-group__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.section-group__info strong { display: block; font-size: .875rem; color: #92400E; margin-bottom: .2rem; }
.section-group__info p { margin: 0; font-size: .8rem; color: #B45309; }
.form-section-group--inactive .form-section { margin-top: .5rem; border-radius: var(--radius); }
.form-section-group--inactive .form-section__header { background: #FAFAFA; }
.form-section-group--inactive .form-section__header h2 { color: var(--text-muted); font-weight: 600; }

/* Section vide / sans pré-rempli */
.section-no-prefill {
  padding: 1.25rem; background: #FAFBFE;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.section-no-prefill p { margin: 0; font-size: .875rem; }
.section-more {
  padding: .75rem 1.25rem; background: #FAFBFE;
  border-top: 1px dashed var(--border);
}
.btn--link {
  background: none; border: none; padding: 0;
  color: var(--navy); font-size: .85rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.btn--link:hover { color: var(--gold); }

/* Tableau pairé contribuable / conjoint */
.form-table--paired .col-contrib,
.form-table--paired .col-conjoint { width: 180px; }
.form-table--paired .col-value-full { /* single dans tableau pairé */ }
.col-code code { font-size: .72rem; color: var(--text-muted); display: block; }
.col-code .code-secondary { color: #A0AEC0; margin-top: 2px; }
.field-row--pair { background: #FDFEFE; }

/* Inputs texte et date */
.field-input--text {
  width: 100%; padding: .35rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .85rem; background: white;
  font-family: inherit;
}
.field-input--text:focus { outline: none; border-color: var(--navy); }

/* Checkbox */
.checkbox-wrap {
  display: inline-flex; align-items: center; gap: .4rem;
  cursor: pointer;
}
.checkbox-wrap input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--navy); }

/* Hint / note info */
.field-hint {
  display: inline-block; width: 1rem; height: 1rem; line-height: 1rem;
  text-align: center; font-size: .7rem; border-radius: 50%;
  background: #E2E8F0; color: var(--navy); cursor: help; margin-left: .25rem;
}
.section-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; background: #F0FDF4;
  border-top: 1.5px solid #BBF7D0; font-size: .875rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero__illustration { display: none; }
  .hero__title { font-size: 1.9rem; }
  .features__grid { grid-template-columns: 1fr; }
  .justif-layout { grid-template-columns: 1fr; }
  .justificatifs-layout { grid-template-columns: 1fr; }
  .justificatifs-types { display: none; }
  .wizard-progress { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .nav__links .btn--primary { display: none; }
  .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; }
  .property-kv { grid-template-columns: 1fr; }
  .justif-item__actions { flex-direction: column; }
  .form-topbar { flex-wrap: wrap; gap: .5rem; position: static; }
  .form-topbar__right { width: 100%; }
  .form-table--paired .col-contrib,
  .form-table--paired .col-conjoint { width: auto; min-width: 120px; }
}
