:root{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --border:#e8eaf2;
  --text:#111827;
  --muted:#6b7280;

  --accent:#6d5efc;
  --accent2:#18c77a;

  --shadow:0 16px 40px rgba(16,24,40,.10);
  --radius:16px;

  --paper-bg:#eef0f6;
  --paper:#ffffff;
  --paper-border:#e7e7ea;

  --input-border:#dfe3ef;
}

*{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  margin:0;
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(109,94,252,.18), transparent 60%),
    radial-gradient(800px 450px at 85% 15%, rgba(24,199,122,.14), transparent 55%),
    var(--bg);
  color:var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a{ color:inherit; text-decoration:none; }

.container{
  max-width:1200px;
  margin:0 auto;
  padding:18px;
}

/* ===== NAVBAR ===== */
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(246,247,251,.72);
  border-bottom:1px solid var(--border);
}

.topbar-inner{
  max-width:1200px;
  margin:0 auto;
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.brand{ display:flex; align-items:center; gap:12px; }
.logo img{ display:block; }
.actions{ display:flex; gap:10px; align-items:center; }

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.2px;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease;
  box-shadow: 0 8px 18px rgba(16,24,40,.06);
}

.btn:hover{ border-color: rgba(109,94,252,.35); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  border-color: rgba(17,17,17,.35);
  background: #111;
  color:#fff;
  box-shadow: 0 14px 28px rgba(16,24,40,.18);
}

.btn.block{
  width:100%;
  justify-content:center;
}

/* ===== HOME (index) ===== */
.home{ padding-top: 10px; }

.home-hero{
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.home-hero-inner{
  padding: 26px 16px;
  text-align:center;
  max-width: 860px;
  margin: 0 auto;
}

.home-title{
  margin: 6px 0 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 950;
}

.home-title-accent{
  display:inline-block;
  margin-left: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}

.home-lead{
  margin: 0 auto 14px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
}

.home-cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
  margin: 12px 0 10px;
}

.home-badges{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px;
  margin-top: 10px;
}

.home-badge{
  border:1px solid var(--border);
  background: rgba(255,255,255,.65);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(16,24,40,.05);
}

/* Sections */
.home-section{
  margin-top: 16px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.home-section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.home-section-head h2{
  margin: 0;
  font-size: 16px;
  letter-spacing: .2px;
}

.home-section-head p{
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* Steps */
.home-steps{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 820px){
  .home-steps{ grid-template-columns: 1fr 1fr 1fr; }
}

.home-step{
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(16,24,40,.06);
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.home-num{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 950;
  background: rgba(109,94,252,.14);
  border: 1px solid rgba(109,94,252,.25);
  color: rgba(109,94,252,1);
  margin-bottom: 2px;
}

.home-step b{ font-size: 14px; }
.home-step span{ color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* Home cards */
.home-cards{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 920px){
  .home-cards{ grid-template-columns: 1fr 1fr; }
}

.home-card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(16,24,40,.06);
}

.home-tag{
  display:inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  border:1px solid rgba(24,199,122,.35);
  background: rgba(24,199,122,.10);
  color: rgba(24,199,122,1);
  margin-bottom: 8px;
}
.home-tag.soon{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
  color: rgba(245,158,11,1);
}

.home-card h3{
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.home-card p{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.5;
}

.home-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ===== RESILIATION (form + preview) ===== */
.wrap{ max-width:1200px; margin:0 auto; padding:18px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
.leftCol, .preview-shell{ min-width:0; }

@media (min-width: 1100px){
  .grid{ grid-template-columns: 460px 1fr; }
}

.card{
  background: rgba(255,255,255,.85);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  margin-bottom: 16px;
}

.card-head{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.card-head h2{ margin:0; font-size:14px; }
.card-head p{ margin:6px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body{ padding:16px; }

/* Collapsible */
.card-collapsible .collapsible-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.chevron-btn{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
  line-height:1;
  padding:4px 6px;
  border-radius:8px;
  transition: transform .2s ease, background .2s ease;
}
.chevron-btn:hover{ background: rgba(0,0,0,.04); }
.card-collapsible.collapsed .chevron-btn{ transform: rotate(-90deg); }
.card-collapsible.collapsed .collapsible-body{ display:none; }

.section{
  padding:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.75);
  border-radius: 14px;
  margin-bottom: 12px;
}
.section h3{
  margin:0 0 10px;
  font-size:12px;
  letter-spacing:.4px;
  text-transform:uppercase;
  color: var(--muted);
}

.field{ margin-top: 10px; }
.field label{ display:block; margin-bottom:6px; color: var(--muted); font-size: 12.5px; }

.field input,
.field select,
.field textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border:1px solid var(--input-border);
  background:#fff;
  color: var(--text);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: rgba(109,94,252,.55);
  box-shadow: 0 0 0 4px rgba(109,94,252,.14);
}

.field textarea{ min-height: 88px; resize: vertical; }

.row2{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}
@media (min-width: 560px){
  .row2{ grid-template-columns: 1fr 1fr; }
}

/* ✅ Radios / checkbox */
.radioRow{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:center;
  margin-top:8px;
}

.radio, .check{
  display:inline-flex;
  align-items:center;
  gap:10px;
  user-select:none;
  font-size: 13px;
  color: var(--text);
}

.radio input[type="radio"],
.check input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
  accent-color: var(--accent);
}

.check input[disabled]{
  opacity:.5;
  cursor:not-allowed;
}
.check input[disabled] ~ *{
  opacity:.6;
}

/* Preview paper */
.preview-shell{
  background: rgba(255,255,255,.85);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  min-width:0;
}

.preview-toolbar{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  color: var(--muted);
  font-size: 12.5px;
  background: rgba(255,255,255,.85);
}

.paperWrap{
  overflow:auto;
  background: var(--paper-bg);
  padding: 14px;
}

.paper{
  max-width: 100%;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: 10px;
  padding: 18mm 15mm;
  box-shadow: 0 14px 30px rgba(16,24,40,.12);
  color: #111;
}

/* ===== DOCUMENTS PAGE ===== */
.docs-page{ padding-top: 10px; }

.docs-hero{
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.docs-title{
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.docs-subtitle{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.docs-section{ margin-top: 14px; }

.docs-section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
  margin: 10px 2px;
}
.docs-section-head h2{
  margin: 0;
  font-size: 14px;
  letter-spacing: .35px;
  text-transform: uppercase;
}
.docs-section-head p{
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.docs-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px){
  .docs-grid{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1080px){
  .docs-grid{ grid-template-columns: 1fr 1fr 1fr; }
}

.doc-card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(16,24,40,.06);
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.doc-card:hover{ border-color: rgba(109,94,252,.35); }

.doc-title{
  font-weight: 950;
  font-size: 15px;
  margin: 0;
}

.doc-desc{
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.doc-meta{
  margin-top: auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  padding-top: 6px;
  border-top: 1px dashed rgba(232,234,242,.9);
}

.badge{
  display:inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border:1px solid rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
  color: rgba(245,158,11,1);
}
.badge.ok{
  border-color: rgba(24,199,122,.35);
  background: rgba(24,199,122,.10);
  color: rgba(24,199,122,1);
}

/* Footer */
.footer{
  padding: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ===== Responsive global ===== */
@media (max-width: 900px){
  .grid { grid-template-columns: 1fr; }
  .preview-shell { order: 2; }
}

/* ===== Mobile readability boost (bigger + bolder) ===== */
@media (max-width: 520px){
  body{ font-size: 16px; }

  .wrap{ padding: 16px; }
  .container{ padding: 16px; }
  .topbar-inner{ padding: 14px 16px; }
  .actions{ gap:8px; }

  /* Headings / lead */
  .home-title{ font-size: clamp(34px, 9vw, 44px); line-height: 1.06; }
  .home-lead{ font-size: 16px; line-height: 1.65; }

  .home-section-head h2{ font-size: 18px; }
  .home-section-head p{ font-size: 14px; }

  .home-step b{ font-size: 16px; }
  .home-step span{ font-size: 14.5px; line-height: 1.6; }

  .home-card h3{ font-size: 18px; }
  .home-card p{ font-size: 14.5px; line-height: 1.6; }

  /* Buttons */
  .btn{
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 800;
  }

  /* Form */
  .card-head h2{ font-size: 16px; }
  .card-head p{ font-size: 14px; line-height: 1.55; }

  .section h3{ font-size: 13px; }

  .field label{
    font-size: 14px;
    font-weight: 600;
  }

  .radio, .check{ font-size: 15px; }

  .field input,
  .field select,
  .field textarea{
    padding: 14px 14px;
    font-size: 16px; /* évite le zoom iOS */
  }

  /* Preview */
  .preview-toolbar{ font-size: 13.5px; }
  .paperWrap{ padding: 12px; }
  .paper{ padding: 14mm 12mm; }

  /* Documents */
  .docs-title{ font-size: 24px; }
  .docs-subtitle{ font-size: 14.5px; line-height: 1.6; }
  .docs-section-head h2{ font-size: 15px; }
  .docs-section-head p{ font-size: 14px; }
  .doc-title{ font-size: 16px; }
  .doc-desc{ font-size: 14.5px; line-height: 1.6; }
  .doc-meta{ font-size: 13px; }

  /* Footer */
  .footer{ font-size: 13.5px; }
}
