/* ═══════════════════════════════════════════════════════════════
   OLAVE — PAGES INTERNES (Politique & Contrat)
   Hérite des variables de style.css
═══════════════════════════════════════════════════════════════ */

/* ─── PAGE HERO ─────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-light) 60%, #1a4a9e 100%);
  color: #fff;
  padding: 120px 0 64px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,107,0,.15) 0%, transparent 60%);
  pointer-events: none;
}
.page-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}
.page-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,107,0,.18);
  border: 1px solid rgba(255,107,0,.35);
  color: var(--orange-light);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 20px;
}
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
.page-hero h1 span { color: var(--orange-light); }
.page-hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: .83rem;
  opacity: .75;
  margin-top: 20px;
}
.page-hero-meta span { display: flex; align-items: center; gap: 6px; }

/* ─── LAYOUT DOCUMENT ───────────────────────────────────────── */
.doc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px;
  align-items: start;
}

/* ─── TABLE OF CONTENTS ─────────────────────────────────────── */
.doc-toc {
  position: sticky;
  top: 96px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px;
  border-top: 4px solid var(--orange);
}
.doc-toc h3 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}
.toc-list { display: flex; flex-direction: column; gap: 4px; }
.toc-list a {
  font-size: .82rem;
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  border-left: 2px solid transparent;
}
.toc-list a:hover,
.toc-list a.active {
  background: rgba(255,107,0,.07);
  color: var(--orange);
  border-left-color: var(--orange);
}
.toc-list a i { font-size: .7rem; opacity: .6; }
.toc-update {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-3);
}

/* ─── DOCUMENT CONTENT ──────────────────────────────────────── */
.doc-content { min-width: 0; }

.doc-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 36px 40px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
  transition: border-color .3s;
  scroll-margin-top: 96px;
}
.doc-section:hover { border-left-color: var(--orange-light); }
.doc-section:target { border-left-color: var(--orange); }

.doc-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.doc-section-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, rgba(255,107,0,.1), rgba(255,107,0,.05));
  border: 1px solid rgba(255,107,0,.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--orange);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.doc-section-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}
.doc-section-header h2 .art-num {
  font-size: .75rem;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.doc-text {
  font-size: .92rem;
  color: var(--text-2);
  line-height: 1.8;
}
.doc-text p { margin-bottom: 12px; }
.doc-text p:last-child { margin-bottom: 0; }

.doc-list {
  list-style: none;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
}
.doc-list li::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--orange);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}
.doc-list li i {
  color: var(--orange);
  font-size: .8rem;
  margin-top: 4px;
  flex-shrink: 0;
}

.doc-highlight {
  background: linear-gradient(135deg, rgba(255,107,0,.06), rgba(255,107,0,.03));
  border: 1px solid rgba(255,107,0,.15);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 14px 0;
  font-size: .88rem;
  color: var(--text-1);
}
.doc-highlight strong { color: var(--navy); }

.doc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.doc-card-mini {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  border-top: 3px solid var(--orange);
}
.doc-card-mini h4 { font-size: .85rem; font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.doc-card-mini p { font-size: .82rem; color: var(--text-2); }

/* ─── READ PROGRESS BAR ─────────────────────────────────────── */
.read-progress-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.1);
  z-index: 2000;
}
.read-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  width: 0%;
  transition: width .1s linear;
}
.read-progress-pct {
  position: fixed;
  top: 16px; right: 24px;
  background: var(--navy);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 30px;
  z-index: 2001;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.read-progress-pct.show { opacity: 1; }

/* ─── COMMISSION TABLE ──────────────────────────────────────── */
.commission-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 16px 0;
  font-size: .88rem;
}
.commission-table thead tr {
  background: var(--navy);
  color: #fff;
}
.commission-table th {
  padding: 12px 18px;
  font-weight: 600;
  text-align: left;
}
.commission-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.commission-table tbody tr:last-child td { border-bottom: none; }
.commission-table tbody tr:nth-child(odd) { background: var(--bg); }
.commission-table tbody tr:nth-child(even) { background: var(--surface); }
.commission-highlight { color: var(--orange) !important; font-weight: 700 !important; }

/* ─── SIGNATURE SECTION ─────────────────────────────────────── */
.sign-section {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  color: #fff;
  margin-top: 32px;
  position: relative;
  overflow: hidden;
}
.sign-section::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,107,0,.15) 0%, transparent 70%);
  pointer-events: none;
}
.sign-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.sign-section-title i { color: var(--orange-light); font-size: 1.5rem; }
.sign-section-title h2 { font-size: 1.4rem; font-weight: 800; }
.sign-section-subtitle {
  font-size: .9rem;
  opacity: .7;
  margin-bottom: 36px;
  padding-left: 42px;
}

.sign-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.sign-field { display: flex; flex-direction: column; gap: 8px; }
.sign-field label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  opacity: .8;
  text-transform: uppercase;
}
.sign-field label span { color: var(--orange-light); }
.sign-field input, .sign-field select {
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  transition: var(--transition);
  outline: none;
}
.sign-field input::placeholder { color: rgba(255,255,255,.4); }
.sign-field input:focus, .sign-field select:focus {
  border-color: var(--orange-light);
  background: rgba(255,255,255,.15);
}
.sign-field input[readonly] {
  background: rgba(255,255,255,.06);
  opacity: .7;
}
.sign-field select option { background: var(--navy); color: #fff; }

/* Signature pad */
.sign-pad-wrap { margin: 8px 0 24px; }
.sign-pad-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sign-pad-label span {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  opacity: .8;
}
.sign-pad-clear {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 6px;
  transition: var(--transition);
  background: rgba(255,255,255,.08);
  font-family: 'Poppins', sans-serif;
}
.sign-pad-clear:hover { background: rgba(255,107,0,.2); color: var(--orange-light); }

#signatureCanvas {
  width: 100%;
  height: 160px;
  background: rgba(255,255,255,.95);
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.3);
  cursor: crosshair;
  display: block;
  touch-action: none;
}
#signatureCanvas.has-sig { border-color: var(--green); }
.sign-pad-hint {
  font-size: .75rem;
  opacity: .5;
  margin-top: 8px;
  text-align: center;
}

/* Agreement checkbox */
.sign-agreement {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 28px;
  cursor: pointer;
}
.sign-agreement input[type="checkbox"] {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--orange);
  cursor: pointer;
}
.sign-agreement-text {
  font-size: .87rem;
  line-height: 1.6;
  opacity: .85;
}
.sign-agreement-text strong { color: var(--orange-light); opacity: 1; }

/* Submit button */
.sign-submit-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-sign-submit {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  padding: 16px 32px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,107,0,.4);
  transition: var(--transition);
}
.btn-sign-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,107,0,.55);
}
.btn-sign-submit:disabled { opacity: .5; cursor: not-allowed; }

.btn-print {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  padding: 16px 24px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,.25);
  cursor: pointer;
  transition: var(--transition);
}
.btn-print:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.5);
}

/* ─── MODAL CONFIRMATION ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,31,92,.7);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 520px;
  width: 100%;
  transform: translateY(20px) scale(.97);
  transition: transform .3s ease;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }

.modal-check {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(34,197,94,.35);
}
.modal-box h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 10px;
}
.modal-box p {
  font-size: .9rem;
  color: var(--text-2);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 28px;
}
.modal-agent-recap {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: .85rem;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-agent-recap div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.modal-agent-recap span:first-child { color: var(--text-3); font-size: .8rem; }
.modal-agent-recap span:last-child { font-weight: 600; color: var(--navy); text-align: right; }

.modal-sig-preview {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  text-align: center;
}
.modal-sig-preview img { max-height: 80px; object-fit: contain; margin: 0 auto; }

.modal-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}
.btn-modal-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}
.btn-modal-wa:hover { background: #1faf54; transform: translateY(-1px); }

.btn-modal-print {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-modal-print:hover { border-color: var(--navy); color: var(--navy); }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--navy); }

/* ─── POLICY SPECIFIC ───────────────────────────────────────── */
.policy-rights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.policy-right-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  border-top: 3px solid transparent;
  transition: var(--transition);
}
.policy-right-card:hover { border-top-color: var(--orange); }
.policy-right-card i {
  font-size: 1.4rem;
  color: var(--orange);
  margin-bottom: 10px;
}
.policy-right-card h4 { font-size: .82rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.policy-right-card p { font-size: .76rem; color: var(--text-2); line-height: 1.5; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
  .doc-section { padding: 24px 20px; }
  .sign-form-grid { grid-template-columns: 1fr; }
  .doc-grid-2 { grid-template-columns: 1fr; }
  .policy-rights-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .policy-rights-grid { grid-template-columns: 1fr; }
  .sign-section { padding: 28px 20px; }
  .sign-submit-row { flex-direction: column; }
  .modal-box { padding: 28px 20px; }
  .doc-section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─── PRINT STYLES ──────────────────────────────────────────── */
@media print {
  .page-hero, .doc-toc, .navbar, .float-whatsapp,
  .back-to-top, .read-progress-wrap, .sign-submit-row,
  .sign-pad-clear, .modal-overlay, .sign-field input,
  .sign-field select { display: none !important; }

  body { background: #fff !important; }
  .doc-layout { grid-template-columns: 1fr; padding: 20px; }
  .doc-section { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .sign-section {
    background: #fff !important;
    color: #000 !important;
    border: 1.5px solid #333;
    print-color-adjust: exact;
  }
  #signatureCanvas { border: 1px solid #999; }
  .sign-section::before { display: none; }

  .print-header {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding: 16px 0 24px;
    border-bottom: 2px solid #0F1F5C;
    margin-bottom: 24px;
  }
  .print-header img { width: 48px; height: 48px; object-fit: contain; }
}

.print-header { display: none; }
