/* ==========================================================================
   ComplianceArmor - PTG showcase theme
   Ports the petronellatech.com design system (dark enterprise-security look:
   near-black navy canvas, cyan primary, violet secondary, Source Serif 4 +
   Manrope). Loaded AFTER output.css so it augments/overrides the base Tailwind
   build without a rebuild. Self-hosted fonts keep the strict CSP (font-src 'self').
   ========================================================================== */

/* ---- Self-hosted variable fonts (latin) ------------------------------------ */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/Manrope.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/SourceSerif4.woff2') format('woff2');
}

/* ---- Tokens ---------------------------------------------------------------- */
:root {
  --bg: #0b0d12;
  --surface: #1a1d24;
  --surface-2: #13161d;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.12);
  --text: #f0f0f0;
  --text-2: rgba(240, 240, 240, 0.78);
  --text-3: rgba(240, 240, 240, 0.55);
  --accent: #00a9e0;
  --accent-hover: #0086b5;
  --accent-2: #7c3aed;
  --accent-2-hover: #6d28d9;
  --warm: #f59e0b;
  --rose: #f43f5e;
  --emerald: #10b981;
  --ring: 0 0 0 4px rgba(0, 169, 224, 0.18);
  --grad-brand: linear-gradient(135deg, var(--accent), var(--accent-2));
  --grad-hero: linear-gradient(135deg, #050810 0%, #0a0a0f 45%, #1a0d2e 100%);
  --radius: 14px;
  --radius-lg: 20px;
  --container: 1200px;
  --font-serif: 'Source Serif 4', Charter, Georgia, serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Base ------------------------------------------------------------------ */
html, body { background: var(--bg); }
body {
  font-family: var(--font-sans) !important;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  letter-spacing: -0.005em;
  line-height: 1.12;
  color: var(--text);
}
a { color: var(--accent); }

.ptg-container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.ptg-eyebrow {
  font: 700 11px/1 var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ---- Header / footer (app shell) ------------------------------------------ */
.ptg-topbar {
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.ptg-topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.ptg-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.ptg-brand img { height: 38px; width: 38px; border-radius: 9px; }
.ptg-brand-name { font: 700 17px/1.15 var(--font-sans); color: var(--text); }
.ptg-brand-sub { font: 600 10px/1.3 var(--font-sans); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-2); }
.ptg-nav { display: flex; align-items: center; gap: 4px; }
.ptg-nav a {
  padding: 9px 16px; border-radius: 10px; font: 600 14px/1 var(--font-sans);
  color: var(--text-2); text-decoration: none; transition: all .18s;
}
.ptg-nav a:hover { color: var(--text); background: rgba(0, 169, 224, 0.08); }

/* hamburger toggle — hidden on desktop, shown under 720px */
.ptg-nav-toggle {
  display: none;
  appearance: none; cursor: pointer;
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.ptg-nav-toggle:hover { background: rgba(0, 169, 224, 0.08); border-color: var(--accent); }
.ptg-nav-toggle .i-close { display: none; }
.ptg-nav-toggle[aria-expanded="true"] .i-open { display: none; }
.ptg-nav-toggle[aria-expanded="true"] .i-close { display: block; }

@media (max-width: 720px) {
  .ptg-topbar-inner { position: relative; padding: 12px 16px; }
  .ptg-nav-toggle { display: inline-flex; }
  .ptg-nav {
    position: absolute; top: 100%; right: 16px; left: 16px;
    flex-direction: column; align-items: stretch; gap: 4px;
    margin-top: 10px; padding: 8px;
    background: var(--surface-2, #13161d);
    border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .ptg-nav.open { opacity: 1; visibility: visible; transform: none; }
  .ptg-nav a { padding: 12px 14px; min-height: 44px; display: flex; align-items: center; }
}

.ptg-footer {
  border-top: 1px solid var(--border); margin-top: 64px;
  background: var(--surface-2);
}
.ptg-footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 28px 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px;
}

/* ---- Buttons -------------------------------------------------------------- */
.ptg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; min-height: 50px; border-radius: 12px;
  font: 600 15px/1 var(--font-sans); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: all .2s;
}
.ptg-btn--primary { background: var(--accent); color: #05202b; }
.ptg-btn--primary:hover { background: var(--accent-hover); box-shadow: var(--ring); }
.ptg-btn--violet { background: var(--accent-2); color: #fff; }
.ptg-btn--violet:hover { background: var(--accent-2-hover); }
.ptg-btn--outline { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.ptg-btn--outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Cards & badges ------------------------------------------------------- */
.ptg-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.ptg-card--accent {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), var(--surface) 60%);
}
.ptg-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; font: 600 12px/1 var(--font-sans);
  background: rgba(16, 185, 129, 0.15); color: var(--emerald);
}
.ptg-badge--cyan { background: rgba(0, 169, 224, 0.15); color: var(--accent); }

/* ---- Hero ----------------------------------------------------------------- */
.ptg-hero {
  position: relative; overflow: hidden; background: var(--grad-hero);
  border-bottom: 1px solid var(--border);
}
.ptg-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,13,18,0.15) 0%, rgba(11,13,18,0.55) 75%, var(--bg) 100%);
}
.ptg-hero-inner {
  position: relative; z-index: 1; max-width: 900px; margin: 0 auto;
  padding: 96px 24px 72px; text-align: center;
}
.ptg-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 18px 0 0;
}
.ptg-hero .lede {
  font-family: var(--font-serif); font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  color: var(--text-2); margin: 20px auto 0; max-width: 640px;
}
.ptg-hero-cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.ptg-gradient-text {
  background: var(--grad-brand); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}

/* ---- Forms ---------------------------------------------------------------- */
.ptg-field label, label.ptg-label { display: block; font: 600 13px/1.4 var(--font-sans);
  color: var(--text-2); margin-bottom: 6px; }
/* Cover every text-entry control the app uses. The venue-derived .form-input /
   .form-select / .form-textarea classes (0,1,0) outrank bare element selectors
   (0,0,1) and default to Tailwind's white form styles unless a .dark ancestor
   exists (which this theme does not set), so they must be named here explicitly.
   url/tel/date/search input types were also previously uncovered. */
.ptg-input, .form-input, .form-select, .form-textarea,
input[type="text"], input[type="email"], input[type="number"],
input[type="password"], input[type="url"], input[type="tel"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%; background: var(--surface-2) !important; color: var(--text) !important;
  border: 1px solid var(--border-2) !important; border-radius: 10px; padding: 12px 14px;
  font: 400 15px/1.4 var(--font-sans); transition: border-color .15s, box-shadow .15s;
  box-shadow: none;
}
.ptg-input:focus, .form-input:focus, .form-select:focus, .form-textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent) !important; box-shadow: var(--ring) !important;
}
::placeholder { color: var(--text-3) !important; }
select option { background: var(--surface-2); color: var(--text); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.75); }
input[type="radio"], input[type="checkbox"] {
  appearance: auto !important; -webkit-appearance: auto !important;
  accent-color: var(--accent);
  width: 17px !important; height: 17px; flex: 0 0 auto;
  padding: 0 !important; border: none !important;
  background: transparent !important; box-shadow: none !important;
}
input[type="radio"]:focus, input[type="checkbox"]:focus { box-shadow: none !important; }

/* ==========================================================================
   Overrides for base.html-extending pages (wizard, chat, review).
   These pages use light Tailwind utilities; remap the common ones to the dark
   palette so the whole app reads as one premium product.
   ========================================================================== */
.bg-gray-50, .bg-gray-100 { background-color: var(--bg) !important; }
.bg-white { background-color: var(--surface) !important; color: var(--text); }
.text-gray-900, .text-gray-800 { color: var(--text) !important; }
.text-gray-700, .text-gray-600 { color: var(--text-2) !important; }
.text-gray-500, .text-gray-400 { color: var(--text-3) !important; }
.border-gray-200, .border-gray-300, .border { border-color: var(--border) !important; }
.shadow-sm, .shadow, .shadow-md { box-shadow: 0 1px 3px rgba(0,0,0,0.4) !important; }
.rounded-lg, .rounded-xl { border-radius: var(--radius) !important; }
.text-blue-600, .text-blue-700 { color: var(--accent) !important; }
.bg-blue-600, .bg-primary-600 { background-color: var(--accent) !important; }
.hover\:bg-gray-50:hover, .hover\:bg-gray-100:hover { background-color: rgba(255,255,255,0.05) !important; }
.hover\:border-gray-300:hover { border-color: var(--border-2) !important; }
.hover\:border-primary-500:hover { border-color: rgba(0, 169, 224, 0.6) !important; }
.hover\:text-gray-600:hover, .hover\:text-gray-800:hover { color: var(--text) !important; }

/* Tinted status surfaces (question cards, badges, alerts). The templates pair
   light -50/-100 backgrounds with dark -600..-900 text; the remaps above turn
   the text light, so the light backgrounds must also flip or the text becomes
   white-on-white. Convert each color family to a translucent tint of its
   dark-palette accent and lift the dark text shades to their accent color.
   Solid button utilities (bg-*-500/600/700 with text-white) are left alone. */
.bg-blue-50, .bg-blue-100, .bg-blue-200 { background-color: rgba(0, 169, 224, 0.12) !important; }
.bg-green-50, .bg-green-100, .bg-green-200 { background-color: rgba(16, 185, 129, 0.12) !important; }
.bg-amber-50, .bg-amber-100, .bg-amber-200,
.bg-yellow-50, .bg-yellow-100 { background-color: rgba(245, 158, 11, 0.12) !important; }
.bg-red-50, .bg-red-100, .bg-red-200 { background-color: rgba(244, 63, 94, 0.14) !important; }
.border-blue-200, .border-blue-300, .border-blue-400, .border-blue-500 { border-color: rgba(0, 169, 224, 0.45) !important; }
.border-green-100, .border-green-200, .border-green-300 { border-color: rgba(16, 185, 129, 0.45) !important; }
.border-amber-200, .border-amber-300, .border-amber-400 { border-color: rgba(245, 158, 11, 0.45) !important; }
.border-red-300, .border-red-400 { border-color: rgba(244, 63, 94, 0.5) !important; }
.text-blue-800 { color: var(--accent) !important; }
.text-green-600, .text-green-700, .text-green-800, .text-green-900 { color: var(--emerald) !important; }
.text-amber-600, .text-amber-700, .text-amber-800, .text-amber-900,
.text-yellow-600, .text-yellow-800 { color: var(--warm) !important; }
.text-red-600, .text-red-700, .text-red-800 { color: #fb7185 !important; }

/* Tailwind "primary" family (wizard selected states, links, radio cards).
   Previously unmapped: bg-primary-50 stayed a near-white light blue while the
   gray-900 text inside was remapped to near-white - the step6 white-on-white
   card. Map the family to the cyan accent like the blue-* family above. */
.bg-primary-50, .bg-primary-100 { background-color: rgba(0, 169, 224, 0.12) !important; }
.border-primary-200, .border-primary-300, .border-primary-400,
.border-primary-500 { border-color: rgba(0, 169, 224, 0.55) !important; }
.text-primary-600, .text-primary-700, .text-primary-800,
.text-primary-900 { color: var(--accent) !important; }
.hover\:border-primary-300:hover { border-color: rgba(0, 169, 224, 0.45) !important; }
.hover\:bg-primary-50:hover, .hover\:bg-primary-100:hover { background-color: rgba(0, 169, 224, 0.10) !important; }

/* Families used by wizard steps 3-5 that the sweep above missed. */
.bg-purple-50, .bg-purple-100, .bg-purple-200 { background-color: rgba(124, 58, 237, 0.16) !important; }
.border-purple-300, .border-purple-400 { border-color: rgba(124, 58, 237, 0.5) !important; }
.text-purple-600, .text-purple-700, .text-purple-800 { color: #a78bfa !important; }
.text-orange-800 { color: var(--warm) !important; }
.text-green-500 { color: var(--emerald) !important; }
.text-red-500 { color: #fb7185 !important; }
.text-blue-900, .text-primary-950 { color: var(--accent) !important; }
.bg-gray-200 { background-color: var(--surface-2) !important; }
.border-gray-400 { border-color: var(--border-2) !important; }

/* Step 4 control-assessment cards (2026-07-22). output.css paints
   .control-card with a white background, but the sweep above remaps the
   gray text families to light colors - white-on-white for every card in
   the assessment list. Map the card itself to the dark surface. */
.control-card { background-color: var(--surface) !important; border-color: var(--border) !important; }
.control-card.bg-green-50 { background-color: rgba(16, 185, 129, 0.10) !important; }

/* NIST 800-172 enhanced-control badges (CMMC Level 3 delta view). */
.bg-rose-100 { background-color: rgba(244, 63, 94, 0.16) !important; }
.text-rose-700 { color: #fb7185 !important; }
.border-l-rose-400 { border-left-color: #fb7185 !important; }
.border-l-green-500 { border-left-color: var(--emerald) !important; }
