/* ===== LithiumConnect - ImPPPact Nigeria Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Jost:wght@300;400;500;600;700&display=swap');

/* ─── CSS THEME VARIABLES (ImPPPact Nigeria Palette) ───────────────────── */
:root {
  --color-primary:        #1b7339;
  --color-primary-hover:  #145c2c;
  --color-secondary:      #fac51c;
  --color-secondary-hover:#e5b417;
  
  --c-bg:                 #ffffff;
  --c-surface:            #ffffff;
  --c-surface-sub:        #f9fafb;
  --c-border:             #e5e5e5;
  --c-border-sub:         #d4d4d4;
  --c-muted:              #666666;
  --c-text:               #232323;
  --c-heading:            #1b7339;
  --c-heading-dark:       #232323;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  transition: background-color 0.25s ease, color 0.25s ease;
  font-family: 'Jost', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.015em;
}

/* ─── SCROLLBAR ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(27,115,57,0.06); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(27,115,57,0.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(27,115,57,0.65); }

/* ─── CARD ────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 1.125rem;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: rgba(27, 115, 57, 0.35);
  box-shadow: 0 6px 20px rgba(27, 115, 57, 0.08);
}

@media (min-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

/* ─── BADGE ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(27, 115, 57, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(27, 115, 57, 0.25);
}

/* ─── GRADIENT TEXT ─────────────────────── */
.grad-text {
  color: #1b7339 !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #1b7339 !important;
}

/* ─── BUTTONS (ImPPPact Pill & Filled System) ───────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.35rem;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  background: #1b7339;
  color: #ffffff !important;
  border: 1px solid #1b7339;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 115, 57, 0.25);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary:hover {
  background: #145c2c;
  border-color: #145c2c;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27, 115, 57, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.35rem;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1.5px solid var(--c-border);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: #1b7339;
  color: #1b7339;
  background: rgba(27, 115, 57, 0.05);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.35rem;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  background: #fac51c;
  color: #232323 !important;
  border: 1px solid #fac51c;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(250, 197, 28, 0.25);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-accent:hover {
  background: #e5b417;
  border-color: #e5b417;
  transform: translateY(-1px);
}

/* ─── INPUT / SELECT ────────────────────── */
.form-control {
  width: 100%;
  background: var(--c-surface-sub);
  border: 1.5px solid var(--c-border);
  border-radius: 0.75rem;
  padding: 0.6875rem 1rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.875rem;
  color: var(--c-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus {
  border-color: #1b7339;
  box-shadow: 0 0 0 3px rgba(27, 115, 57, 0.15);
  background: #ffffff;
}

/* ─── SECTION TITLE ───────────────────── */
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-sub {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--c-muted);
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* ─── MOBILE DRAWER ───────────────────── */
#mobile-drawer {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
#mobile-drawer.drawer-closed {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
#mobile-drawer.drawer-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* ─── TOAST NOTIFICATION ──────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--c-surface);
  color: var(--c-heading);
  border: 1px solid var(--c-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}
@keyframes slideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* ─── RESPONSIVE UTILITIES ────────────── */
@media (max-width: 640px) {
  .btn-primary, .btn-secondary {
    width: 100%;
  }
}

/* ─── COMMAND PALETTE (CTRL+K) ────────── */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 35, 35, 0.45);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cmd-palette-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.cmd-palette-dialog {
  width: 100%;
  max-width: 620px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(-10px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cmd-palette-backdrop.open .cmd-palette-dialog {
  transform: scale(1) translateY(0);
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--c-text);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}
.cmd-palette-item:hover, .cmd-palette-item.active {
  background: var(--c-surface-sub);
  color: #1b7339;
}

/* ==========================================================================
   A4 PORTRAIT PRINT & PDF EXPORT OPTIMIZATION
   ========================================================================== */
/* ─── OFFICIAL DIN A4 PRINT STYLESHEET ────────────────────────── */
@page {
  size: A4 portrait;
  margin: 12mm 15mm 15mm 15mm;
}

@media print {
  html, body {
    background-color: #ffffff !important;
    color: #232323 !important;
    font-family: 'Jost', sans-serif !important;
    font-size: 9pt !important;
    line-height: 1.4 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Remove all browser URL annotations */
  a, a:visited {
    text-decoration: none !important;
    color: #1b7339 !important;
  }
  a[href]:after {
    content: "" !important;
  }

  /* Hide web-only interface elements */
  header,
  footer,
  nav,
  #nav-auth-slot,
  #nav-auth-container,
  #toast-container,
  .cmd-palette-backdrop,
  #mobile-drawer,
  #theme-toggle,
  button,
  .btn-primary,
  .btn-secondary,
  .no-print,
  #save-success-banner,
  #alert-box,
  #step-bar,
  .step-indicator-item {
    display: none !important;
  }

  /* Main Container & Page Flow */
  main {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Document Cards */
  .card {
    background-color: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 8px !important;
    color: #232323 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-bottom: 8pt !important;
    box-shadow: none !important;
    padding: 12pt !important;
  }

  /* Text & Headers */
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif !important;
    color: #1b7339 !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  h1 { font-size: 14pt !important; font-weight: 800 !important; line-height: 1.2 !important; }
  h2 { font-size: 12.5pt !important; font-weight: 800 !important; line-height: 1.25 !important; }
  h3 { font-size: 11pt !important; font-weight: 700 !important; line-height: 1.3 !important; }
  h4 { font-size: 9.5pt !important; font-weight: 700 !important; }

  /* Badges */
  .badge, 
  span[class*="badge"] {
    display: inline-block !important;
    border: 1px solid #1b7339 !important;
    background-color: rgba(27, 115, 57, 0.08) !important;
    color: #1b7339 !important;
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    padding: 1.5px 5px !important;
    border-radius: 4px !important;
  }

  /* Tables & Lists */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  th, td {
    border: 1px solid #e5e5e5 !important;
    padding: 4pt 6pt !important;
    font-size: 8pt !important;
    color: #232323 !important;
  }

  th {
    background-color: #f9fafb !important;
    color: #1b7339 !important;
    font-weight: 700 !important;
  }

  /* SDG Matrix in Print */
  #sdg-result-matrix,
  div[class*="grid-cols-6"] {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 3pt !important;
  }
  /* LOI Letter of Intent Print Document */
  #loi-modal:not(.hidden) {
    position: static !important;
    background: #ffffff !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    z-index: 9999 !important;
  }

  #loi-modal > div {
    max-width: 100% !important;
    width: 100% !important;
    border: 1px solid #1b7339 !important;
    background: #ffffff !important;
    padding: 12pt !important;
    box-shadow: none !important;
  }

  #loi-content {
    color: #232323 !important;
    background-color: #ffffff !important;
    font-family: 'Jost', sans-serif !important;
    font-size: 8.5pt !important;
    line-height: 1.4 !important;
  }
}



/* ─── HIGH CONTRAST & RESPONSIVE TYPOGRAPHY ───────────────────── */
p {
  color: #232323;
}
.text-muted, [class*="text-slate-400"], [class*="text-slate-500"], [class*="text-gray-400"] {
  color: #555555 !important;
}

label {
  color: #232323;
  font-weight: 600;
}

input, select, textarea {
  color: #232323 !important;
  background-color: #ffffff !important;
}
input::placeholder, textarea::placeholder {
  color: #888888 !important;
}

/* ─── RESPONSIVE TABLES ───────────────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  border: 1px solid var(--c-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background-color: #f9fafb;
  color: #1b7339;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 2px solid #e5e5e5;
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: #232323;
  border-bottom: 1px solid #e5e5e5;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(27, 115, 57, 0.03);
}

/* ─── RESPONSIVE STEP BAR (WIZARDS) ───────────────────────────── */
#step-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
  padding-bottom: 4px;
}
#step-bar::-webkit-scrollbar {
  display: none;
}

/* ─── INTERACTIVE SDG CHECKBOX CARDS ─────────────────────────── */
.sdg-card {
  transition: all 0.15s ease-in-out;
  user-select: none;
}
.sdg-card:hover {
  border-color: #1b7339 !important;
  transform: translateY(-1px);
}
.sdg-card:has(input:checked) {
  border-color: #1b7339 !important;
  background-color: rgba(27, 115, 57, 0.08) !important;
  box-shadow: 0 1px 3px rgba(27, 115, 57, 0.15);
}
.sdg-card input[type="checkbox"] {
  accent-color: #1b7339;
  cursor: pointer;
}
