/* ==========================================================================
   IPRA SECURITY SOLUTIONS - v4 ENTERPRISE DESIGN SYSTEM
   Swiss Architectural Grid & Visual System
   ========================================================================== */

:root {
  --ipra-purple: #342887;
  --ipra-purple-light: #4638a8;
  --ipra-gold: #f4df58;
  --ipra-gold-dark: #d4a017;
  --ipra-ink: #0b0820;
  --ipra-obsidian: #0b0820;
  --ipra-midnight: #150f3a;
  --ipra-stone: #f8f8fc;
  --ipra-border: #e2e2ec;
  --ipra-text: #1e293b;
  --ipra-muted: #64748b;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ipra-text);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

*, *::before, *::after {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, .section-title, .hero-headline {
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
}

p, li, span, blockquote {
  overflow-wrap: break-word;
}

.font-serif-editorial {
  font-family: inherit;
  font-style: normal;
}

.font-mono-code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* TOP UTILITY STRIP */
.utility-bar {
  background: var(--ipra-ink);
  color: #ffffff;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.utility-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
@media (min-width: 768px) {
  .utility-inner {
    padding: 8px 32px;
  }
}
.utility-link {
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}
.utility-link:hover {
  opacity: 0.85;
}

/* SITE HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--ipra-border);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
@media (min-width: 768px) {
  .header-inner {
    padding: 14px 32px;
  }
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ipra-text);
}
.brand-lockup img {
  height: 42px;
  width: auto;
}
.brand-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ipra-purple);
  letter-spacing: -0.02em;
}
.brand-subtitle {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ipra-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 8px;
}
@media (min-width: 1024px) {
  .primary-nav {
    display: flex;
  }
}
.nav-trigger {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ipra-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
}
.nav-trigger:hover {
  color: var(--ipra-purple);
}

.brand-title, .brand-subtitle {
  white-space: nowrap;
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .header-inner {
    padding: 10px 16px;
    gap: 8px;
  }
  .brand-lockup {
    gap: 8px;
  }
  .brand-lockup img {
    height: 36px;
  }
  .brand-title {
    font-size: 16px;
  }
  .brand-subtitle {
    font-size: 9.5px;
    letter-spacing: 0.02em;
  }
  .primary-nav {
    gap: 2px;
  }
  .nav-trigger {
    padding: 6px 7px;
    font-size: 12px;
  }
  .header-actions .btn-architectural:not(.btn-purple) {
    display: none !important;
  }
  .header-actions .btn-purple {
    padding: 9px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* BUTTONS */
.btn-architectural {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-purple {
  background: var(--ipra-purple);
  color: #ffffff;
}
.btn-purple:hover {
  background: var(--ipra-midnight);
}
.btn-gold {
  background: var(--ipra-gold);
  color: var(--ipra-ink);
}
.btn-gold:hover {
  background: #ebd23c;
}

/* MEGA MENUS */
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 2px solid var(--ipra-purple);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  z-index: 40;
}
.mega-menu.open {
  display: block;
}
.mega-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  min-height: 280px;
}
.mega-intro {
  background: var(--ipra-midnight);
  color: #ffffff;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mega-links {
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
.mega-link-item {
  text-decoration: none;
  color: var(--ipra-text);
  padding: 10px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}
.mega-link-item:hover {
  background: var(--ipra-stone);
}
.mega-link-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ipra-purple);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mega-link-desc {
  font-size: 12px;
  color: var(--ipra-muted);
  margin-top: 4px;
  line-height: 1.45;
}
.mega-spotlight {
  background: var(--ipra-stone);
  padding: 32px 28px;
  border-left: 1px solid var(--ipra-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* SLIDE OVER RFP DRAWER */
.rfp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 8, 32, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
}
.rfp-backdrop.open {
  display: block;
}
.rfp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  z-index: 101;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  overflow-y: auto;
  padding: 32px 28px;
  visibility: hidden;
  pointer-events: none;
}
.rfp-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   MOBILE & VIEWPORT RESPONSIVE HARDENING (390px - 1440px)
   ========================================================================== */
.preview-bar {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 12px;
  text-align: center;
  background: #342887;
  color: #ffffff;
  font-weight: 600;
}

.section-shell, .mega-grid, .utility-inner, .header-inner, .hero-content-wrap {
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Telephone button hidden on mobile, shown on XL */
.header-actions .btn-call {
  display: none !important;
}
@media (min-width: 1280px) {
  .header-actions .btn-call {
    display: inline-flex !important;
  }
}

@media (max-width: 639px) {
  .utility-inner {
    justify-content: center !important;
    padding: 6px 12px !important;
    gap: 12px !important;
  }
  .utility-inner > div:first-child {
    display: none !important;
  }
  .utility-inner a[href*="/careers/"] {
    display: none !important;
  }
  .hero-guarantees-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-row-2col,
  .hero-form-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .hero-bullet-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .hero-tabs-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-tab {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding: 10px 14px !important;
  }
  .hero-headline {
    font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    line-height: 1.15 !important;
  }
  .hero-kicker {
    flex-wrap: wrap !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
  }
  .selector-tabs {
    display: flex !important;
    width: 100% !important;
  }
  .selector-tab {
    flex: 1 1 50% !important;
    padding: 10px 4px !important;
    font-size: 11px !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 8px 12px !important;
    gap: 6px !important;
  }
  .brand-lockup {
    gap: 8px !important;
    min-width: 0 !important;
  }
  .brand-lockup img {
    height: 32px !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }
  .brand-title {
    font-size: 14px !important;
    line-height: 1.2 !important;
  }
  .brand-subtitle {
    font-size: 8px !important;
    letter-spacing: 0.02em !important;
    white-space: normal !important;
  }
  .header-actions {
    flex-shrink: 0 !important;
  }
  .header-actions .btn-purple {
    padding: 7px 10px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  .header-actions .btn-purple span:last-child {
    display: none !important;
  }
  .selector-tabs button {
    padding: 10px 4px !important;
    font-size: 10.5px !important;
  }
  .form-cta-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  #ipra-preview-banner {
    padding: 6px 10px !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
  }
}


/* ==========================================================================
   MOBILE NAVIGATION (below 1024px the mega-menu is hidden)
   ========================================================================== */
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ipra-border);
  background: #ffffff;
  color: var(--ipra-purple);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-nav {
  border-top: 1px solid var(--ipra-border);
  background: #ffffff;
  max-height: 75vh;
  overflow-y: auto;
  padding: 4px 20px 20px;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ipra-purple);
  margin: 16px 0 4px;
}
.mobile-nav a {
  display: block;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ipra-text);
  text-decoration: none;
  border-bottom: 1px solid #f1f1f6;
}
@media (min-width: 1024px) {
  .mobile-menu-btn, .mobile-nav { display: none !important; }
}

/* ==========================================================================
   OLDER PAGES IN THE v4 LOOK
   Service pages, Google Ads landing pages and blog posts keep their content
   and forms from v2; these rules bring their typography and surfaces in line.
   ========================================================================== */
body.v4-legacy main h1,
body.v4-legacy main h2,
body.v4-legacy main h3,
body.v4-legacy main .font-serif {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
body.v4-legacy main h1 { font-weight: 800; }
body.v4-legacy main [class*="rounded"]:not(.rounded-full) { border-radius: 2px !important; }
body.v4-legacy main .text-\[\#342887\] { color: var(--ipra-purple); }

/* Landing-page hero (the first section, holding the enquiry form) */
body.v4-legacy main > section:first-of-type:has(#enquiry) {
  background: var(--ipra-obsidian);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
body.v4-legacy main > section:first-of-type:has(#enquiry) :is(h1, .text-slate-900):not(#enquiry *) { color: #ffffff; }
body.v4-legacy main > section:first-of-type:has(#enquiry) :is(p, .text-slate-600, .text-slate-700, .text-slate-500):not(#enquiry *) { color: #d0d0e2; }
body.v4-legacy main > section:first-of-type:has(#enquiry) :is(.text-\[\#342887\], strong, b):not(#enquiry *):not(a) { color: var(--ipra-gold); }
body.v4-legacy main > section:first-of-type:has(#enquiry) nav[aria-label="Breadcrumb"] :is(a, span, li) { color: #a5a5c4; }
body.v4-legacy main > section:first-of-type:has(#enquiry) li.rounded-full:not(#enquiry *),
body.v4-legacy main > section:first-of-type:has(#enquiry) span.rounded-full:not(#enquiry *) {
  background: rgba(255, 255, 255, 0.08);
  color: #f4df58;
  border: 1px solid rgba(244, 223, 88, 0.35);
}
body.v4-legacy main > section:first-of-type:has(#enquiry) a:not(#enquiry *):not([class*="bg-"]) { color: #ffffff; }
body.v4-legacy #enquiry {
  background: #ffffff;
  border: 1px solid var(--ipra-border);
  border-top: 3px solid var(--ipra-gold);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

/* Purple call-to-action panels become midnight panels with a gold rule */
body.v4-legacy main :is(section, aside, div).bg-\[\#342887\] {
  background: var(--ipra-midnight);
  border-top: 3px solid var(--ipra-gold);
}
