/* ============================================================
   Konforme — Overlay enhancements (applied on top of the bundle)
   - Focus ring RGAA AA (3px gold + offset)
   - Reduced motion
   - Selection color
   - Custom scrollbar (Firefox + WebKit)
   - Floating contact card button (FAB) + drawer
   - Sticky credit footer
   - Print stylesheet
   ============================================================ */

::selection { background: #2563eb; color: #fff; }
:focus-visible { outline: 3px solid #fbbf24 !important; outline-offset: 3px !important; border-radius: 4px; }
html { scrollbar-color: #3b82f6 #131a2c; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #131a2c; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #2563eb, #06b6d4); border-radius: 8px; border: 2px solid #131a2c; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Skip link to bypass header for keyboard users */
#kf-skip {
  position: absolute; left: -9999px; top: 0;
  background: #fbbf24; color: #000; padding: 10px 16px;
  font-weight: 700; border-radius: 0 0 10px 0; z-index: 10001; text-decoration: none;
}
#kf-skip:focus { left: 0; }

/* === Floating contact card (FAB) ============================ */
#kf-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 9998;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #fff; font: 600 14px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  border: 0; border-radius: 999px;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.45), 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer; text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
#kf-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(37, 99, 235, 0.55), 0 6px 16px rgba(0, 0, 0, 0.35); }
#kf-fab svg { width: 18px; height: 18px; }
#kf-fab .label { white-space: nowrap; }
@media (max-width: 540px) {
  #kf-fab { padding: 12px; }
  #kf-fab .label { display: none; }
}
@media (prefers-reduced-motion: reduce) { #kf-fab { transition: none; } }

/* When the SPA header button is mounted, hide the FAB on desktop */
@media (min-width: 768px) {
  #kf-fab.kf-has-header-btn { display: none; }
}

/* === Header button injected into the SPA <nav> ============== */
#kf-header-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #fff;
  font: 600 13px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
  border: 0; cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transition: transform 150ms ease, box-shadow 150ms ease;
  vertical-align: middle;
}
#kf-header-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(37,99,235,0.45); }
#kf-header-btn svg { display: inline-block; }
@media (max-width: 540px) { #kf-header-btn span { display: none; } #kf-header-btn { padding: 8px; } }
@media (prefers-reduced-motion: reduce) { #kf-header-btn { transition: none; } }

/* === Backdrop + drawer ====================================== */
#kf-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(10, 14, 26, 0.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
#kf-drawer-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }

#kf-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(420px, 100%); z-index: 10000;
  background: linear-gradient(180deg, #131a2c 0%, #1a2238 100%);
  color: #f1f5fb;
  border-left: 1px solid #2a3654;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#kf-drawer[data-open="true"] { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  #kf-drawer-backdrop, #kf-drawer { transition: none; }
}

#kf-drawer header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #2a3654;
}
#kf-drawer header h2 {
  margin: 0; font: 700 1.05rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
}
#kf-drawer-close {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; color: #f1f5fb;
  border: 1px solid #2a3654; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#kf-drawer-close:hover { background: rgba(255,255,255,0.05); }
#kf-drawer-close svg { width: 16px; height: 16px; }

#kf-drawer .scroll {
  overflow-y: auto; padding: 18px 20px 24px;
  flex: 1;
}
#kf-drawer .info {
  font-size: 0.92rem; color: #cbd5e1; line-height: 1.55; margin: 0 0 16px;
}
#kf-drawer .info a { color: #67e8f9; text-decoration: none; }
#kf-drawer .info a:hover { text-decoration: underline; }
#kf-drawer .qr-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px;
}
#kf-drawer .qr {
  background: #fff; border-radius: 12px; padding: 10px 10px 6px;
  text-align: center; border: 1px solid #2a3654;
}
#kf-drawer .qr img { width: 100%; height: auto; aspect-ratio: 1; display: block; }
#kf-drawer .qr figcaption {
  margin-top: 4px; font: 700 0.7rem/1 ui-sans-serif, system-ui, sans-serif;
  color: #1a2238; letter-spacing: 0.05em; text-transform: uppercase;
}
#kf-drawer .actions { display: grid; gap: 8px; }
#kf-drawer .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 10px;
  font: 600 0.92rem/1 ui-sans-serif, system-ui, sans-serif;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
#kf-drawer .btn.primary { background: #2563eb; color: #fff; }
#kf-drawer .btn.primary:hover { background: #3b82f6; }
#kf-drawer .btn.ghost { background: transparent; color: #f1f5fb; border-color: #2a3654; }
#kf-drawer .btn.ghost:hover { background: rgba(255,255,255,0.05); }

/* === Sticky credit footer (low intrusion) =================== */
#kf-credit {
  position: fixed; left: 12px; bottom: 12px; z-index: 9997;
  font: 500 11px/1.4 ui-sans-serif, system-ui, sans-serif;
  color: rgba(255,255,255,0.55);
  background: rgba(10, 14, 26, 0.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}
#kf-credit:hover { color: #fff; background: rgba(10,14,26,0.85); }
#kf-credit strong { color: rgba(255,255,255,0.85); font-weight: 700; }
@media (max-width: 540px) {
  #kf-credit { display: none; }
}

/* === Print stylesheet ====================================== */
@media print {
  body { background: #fff !important; color: #000 !important; }
  #kf-fab, #kf-credit, #kf-drawer, #kf-drawer-backdrop, #kf-cookie-banner { display: none !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  a[href^="#"]::after, a[href^="javascript:"]::after { content: ""; }
  pre, blockquote { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
}
