/* ==========================================================================
   Lead Dossier Management - Theme matching aides-pac-national.fr
   Fonts: 'Nunito' (Headings) & 'Poppins' (Body/UI)
   Colors: #012970 (Navy), #4154f1 (Primary Accent), #f6f9ff (Page Background)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* aides-pac-national.fr Color Palette */
  --heading-color: #012970;
  --accent-color: #4154f1;
  --accent-hover: #3448eb;
  --accent-light: #f0f3ff;
  --accent-border: #d0d7fe;
  
  --default-color: #444444;
  --text-muted: #6c757d;
  --text-light: #899bbd;
  
  --bg-page: #f6f9ff;
  --bg-surface: #ffffff;
  --border-color: #e0e5f2;
  
  --success: #17ab13;
  --success-bg: #e8f8ec;
  --success-border: #b8ecc0;
  
  --warning: #ff771d;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  
  --danger: #dc3545;
  --danger-bg: #fdf2f2;
  --danger-border: #f8b4b4;

  /* Theme Shadows */
  --shadow-theme: 0px 0 30px rgba(1, 41, 112, 0.08);
  --shadow-sm: 0 2px 6px rgba(1, 41, 112, 0.05);
  --shadow-md: 0 4px 12px rgba(1, 41, 112, 0.08);
  --shadow-btn: 0 4px 15px rgba(65, 84, 241, 0.25);
  --shadow-btn-hover: 0 6px 20px rgba(65, 84, 241, 0.35);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 50px;
  
  --transition: all 0.25s ease-in-out;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-page);
  color: var(--default-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', 'Poppins', sans-serif;
  color: var(--heading-color);
  font-weight: 700;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* ==========================================================================
   Header (Exact match with leads-marketing.co screenshot)
   ========================================================================== */
.site-header {
  background-color: #ffffff;
  padding: 1.1rem 0;
  width: 100%;
  border-bottom: 1px solid #f0f2f5;
}

.header-container {
  width: 100%;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img {
  max-height: 52px;
  width: auto;
  display: block;
}

/* ==========================================================================
   Main Layout Container
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 3rem 1.5rem;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.search-page-wrapper {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   Footer (Exact match with leads-marketing.co screenshot: #313744 block)
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: #313744;
  color: #9d9ba3;
  padding: 4.5rem 0;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  position: relative;
  width: 100%;
}

.footer-container {
  width: 100%;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.footer-text {
  margin: 0;
  line-height: 1.7;
  color: #9d9ba3;
  font-size: 0.925rem;
}

.footer-text a.policy-link {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  margin-right: 0.4rem;
  transition: color 0.2s;
}

.footer-text a.policy-link:hover {
  color: #80c2fa;
}

.footer-text a.email-link {
  color: #9d9ba3;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-text a.email-link:hover {
  color: #80c2fa;
}

/* Scroll to top button in bottom right */
.scroll-to-top {
  position: fixed;
  bottom: 9px !important;
  right: 14px !important;
  width: 44px;
  height: 44px;
  background: #6db0f8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  z-index: 99;
  transition: background 0.2s;
}

.scroll-to-top:hover {
  background: #509ff7;
  color: #ffffff;
}

/* ==========================================================================
   Clean & Authentic Search Card (index.php)
   ========================================================================== */
.search-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2.75rem 2.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  transition: box-shadow 0.2s ease;
}

.search-card-logo {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.search-card-logo img {
  max-height: 46px;
  width: auto;
  display: block;
}

.search-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.search-card-subtitle {
  color: #64748b;
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
  font-weight: 400;
}

.search-card-form {
  text-align: left;
}

.form-field {
  margin-bottom: 0.5rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-container .input-icon {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  pointer-events: none;
}

.input-container .form-input {
  width: 100%;
  height: 48px;
  padding: 0 120px 0 2.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  color: #0f172a;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  font-family: 'Poppins', sans-serif;
  transition: all 0.15s ease;
}

.input-container .form-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-container .form-input::placeholder {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #94a3b8;
}

.input-container .btn-submit {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  padding: 0 1.15rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.input-container .btn-submit:hover {
  background: #1d4ed8;
}

.input-container .btn-submit:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Alerts & Feedback
   ========================================================================== */
.alert-banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.925rem;
  max-width: 600px;
  width: 100%;
}

.alert-danger {
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.alert-icon {
  flex-shrink: 0;
}

/* ==========================================================================
   Details Page Layout & Components (Authentic CRM Look)
   ========================================================================== */
.dossier-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.toolbar-back-btn:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-family: 'Poppins', sans-serif;
  transition: all 0.15s ease;
}

.btn-action-tool:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Dossier Summary Header */
.dossier-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dossier-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.dossier-badge-number {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}

.dossier-badge-number:hover {
  background: #e2e8f0;
}

.dossier-title-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

.dossier-meta-info {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.meta-line {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

.meta-label {
  color: #64748b;
}

.meta-val {
  color: #1e293b;
  font-weight: 500;
}

/* 2-Column Data Grid */
.dossier-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .dossier-data-grid {
    grid-template-columns: 1fr;
  }
  .dossier-meta-info {
    text-align: left;
  }
  .meta-line {
    justify-content: flex-start;
  }
}

.data-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.data-card.full-span {
  grid-column: 1 / -1;
}

.data-card-header {
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.data-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Poppins', sans-serif;
}

.data-table {
  padding: 0.5rem 1.4rem;
}

.data-table.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
}

@media (max-width: 768px) {
  .data-table.grid-3-cols {
    grid-template-columns: 1fr;
  }
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}

.data-row:last-child {
  border-bottom: none;
}

.data-col-label {
  color: #64748b;
  font-weight: 500;
  min-width: 140px;
}

.data-col-value {
  color: #0f172a;
  font-weight: 500;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.font-bold {
  font-weight: 600;
}

.text-accent {
  color: #2563eb;
}

.text-muted {
  color: #94a3b8;
}

.monospace {
  font-family: monospace;
  font-size: 0.85rem;
}

.phone-link, .email-link, .source-link {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 500;
}

.phone-link:hover, .email-link:hover, .source-link:hover {
  color: #1d4ed8;
}

.btn-copy-mini {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy-mini:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.status-badge-green {
  display: inline-flex;
  align-items: center;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.field-group {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #f1f4f9;
  gap: 1rem;
}

.field-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 140px;
}

.label-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading-color);
}

.label-sub {
  font-size: 0.75rem;
  color: var(--text-light);
}

.field-value-wrapper {
  text-align: right;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.field-value {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--default-color);
  word-break: break-word;
}

.field-value-highlight {
  font-size: 1.05rem;
  color: var(--accent-color);
  font-weight: 700;
}

.field-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
}

.pill-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.pill-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.pill-info { background: var(--accent-light); color: var(--accent-color); border: 1px solid var(--accent-border); }
.pill-dark { background: #f6f9ff; color: var(--heading-color); border: 1px solid var(--border-color); }

.quick-action-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.quick-action-btn:hover {
  background: var(--accent-light);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--heading-color);
  color: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(1, 41, 112, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: var(--transition);
  z-index: 1000;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt;
  }

  .dossier-hero-actions,
  .quick-action-btn,
  #toast,
  .no-print {
    display: none !important;
  }

  .main-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .dossier-hero {
    box-shadow: none !important;
    border: 1.5px solid #000000 !important;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .details-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.85rem !important;
  }

  .detail-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }

  .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #ccc !important;
    padding: 0.5rem 0.75rem !important;
  }

  .card-body {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }

  .field-group {
    padding-bottom: 0.35rem !important;
  }
}
