/* Connect EPN styles (clean + One.com friendly) */

/* Box sizing reset (avoids One.com warning about universal selector alone) */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

html, body { margin: 0; padding: 0; }

/* Prevent excess space below footer on short pages */
body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(33,199,217,.32), transparent 60%),
    radial-gradient(900px 650px at 85% 20%, rgba(107,76,255,.28), transparent 55%),
    #1b2030;
  color: rgba(255,255,255,.92);
  line-height: 1.5;

  position: relative; /* ✅ add this */
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,.16),
      rgba(255,255,255,.02) 40%,
      transparent 70%
    );
  pointer-events: none;
  z-index: 0; /* ✅ was -1 */
}

/* ✅ keep all real content above the wash */
body > *{
  position: relative;
  z-index: 1;
}

main { flex: 1; }

a{ color: inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header / nav */
header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11,16,32,.65);
  border-bottom: 1px solid rgba(255,255,255,.14);

  /* iOS Safari safe-area (prevents header being cut off) */
  padding-top: env(safe-area-inset-top);
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 14px 0;
  position: relative; /* allows centered brand on desktop */
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 200px;
}

.brand.centered{
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: auto;
}

.brand img{
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 6px;
  background: rgba(255,255,255,.95);
  border-radius: 12px;
  box-shadow:
    0 2px 6px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(0,0,0,.08);
}

.brand.centered img{
  margin-bottom: 6px;
}

.brand .title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}

.brand .title strong{
  font-size: 14px;
  letter-spacing: .3px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.brand .title span{
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.menu{
  display:flex;
  gap:18px;
  align-items:center;
}

.menu a{
  padding: 10px 10px;
  border-radius: 10px;
  color: rgba(255,255,255,.72);
}

.menu a.active,
.menu a:hover{
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.06);
  text-decoration:none;
}

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

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  box-shadow: none;
  cursor: pointer;
}

.btn.primary{
  border: 0;
  background: linear-gradient(135deg, #21c7d9, #6b4cff);
}

.btn:hover{ transform: translateY(-1px); }

.burger{
  display:none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}

/* Hero */
.hero{ padding: 56px 0 28px; }

.hero-grid{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 24px;
  align-items: stretch;
}

.hero h1{
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 10px;
  letter-spacing: -0.6px;
}

.hero p{
  margin: 0 0 18px;
  color: rgba(255,255,255,.72);
  font-size: 16px;
}

.badges{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 12px;
}

.badge{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

/* Cards */
.card{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);

  /* Spacing when cards are stacked normally (not in a grid) */
  margin-bottom: 14px;
}

/* Don't leave an extra gap at the end of a section (for stacked cards) */
.section .card:last-child{
  margin-bottom: 0;
}
/* Service card icons */
.service-icon{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:6px;
}

.service-icon svg{
  width:20px;
  height:20px;
  flex:0 0 20px;
  opacity:.9;
}

/* KPIs */
.kpis{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top: 10px;
}

.kpi{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
}

.kpi strong{ display:block; font-size: 16px; }
.kpi span{ color: rgba(255,255,255,.72); font-size: 12px; }

/* Sections & grids */
.section{ padding: 24px 0; }
.section h2{ margin: 0 0 12px; font-size: 22px; }

.grid3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
}

.grid2{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  align-items: stretch;
}

/* ✅ KEY FIX: cards INSIDE grids should not also add margin-bottom,
   and must stretch to full row height to level up. */
.grid3 > .card,
.grid2 > .card{
  margin-bottom: 0;   /* grid gap handles spacing */
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* For your service cards + staff template cards: make the list area flex so heights match neatly */
.grid3 > .card .service-list,
.grid2 > .card .service-list{
  margin-top: 10px;
  flex: 1;
}

.grid3 > .card .link-list,
.grid2 > .card .link-list{
  margin-top: 10px;
  flex: 1;
}

.service h3{ margin:0 0 8px; font-size: 16px; }
.service p{ margin:0; color: rgba(255,255,255,.72); font-size: 14px; }

/* Services list styling (readable + consistent) */
.service-list{
  margin: 0;
  padding-left: 18px;
  color: rgba(255,255,255,.92);
}
.service-list li{ margin-bottom: 6px; }
.service-list li::marker{ color: rgba(255,255,255,.72); }

/* Optional alternate list style used in some staff pages */
.link-list{
  margin: 0;
  padding-left: 18px;
  color: rgba(255,255,255,.92);
}
.link-list li{ margin-bottom: 6px; }
.link-list li::marker{ color: rgba(255,255,255,.72); }

/* Forms */
form{ display:grid; gap: 12px; }
label{ font-size: 13px; color: rgba(255,255,255,.72); }

input, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.92);
  outline: none;
}

textarea{ min-height: 140px; resize: vertical; }

/* Select styling (matches inputs) */
select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.92);
  outline: none;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.72) 50%),
    linear-gradient(135deg, rgba(255,255,255,.72) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

select option{
  background: #0b1020;
  color: rgba(255,255,255,.92);
}

select:hover{ border-color: rgba(255,255,255,.25); }
select:focus{
  border-color: #21c7d9;
  box-shadow: 0 0 0 1px rgba(33,199,217,.4);
}

.notice{ font-size: 13px; color: rgba(255,255,255,.72); }

/* Footer */
.footer{
  border-top: 1px solid rgba(255,255,255,.14);
  margin-top: 26px;
  padding: 18px 0 30px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.footer .row{
  display:flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.small-links{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Thank-you reference box */
.ref-box{
  margin: 18px auto;
  max-width: 520px;
  text-align: center;
  padding: 16px;
  border-radius: 14px;
  background: rgba(51, 209, 122, 0.12);
  border: 1px solid rgba(51, 209, 122, 0.45);
}

.ref-label{
  font-size: 13px;
  color: rgba(255,255,255,.72);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.ref-value{
  display: inline-block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.14);
}

.ref-date{
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.72);
}

.ref-ooh{
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255,255,255,.72);
}

/* Staff area warning banner */
.staff-warning{
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 184, 107, 0.14);
  border: 1px solid rgba(255, 184, 107, 0.45);
  color: rgba(255,255,255,.92);
  font-size: 13px;
  line-height: 1.4;
}

.staff-warning strong{
  display: block;
  margin-bottom: 4px;
  letter-spacing: .3px;
}

.staff-btn{
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13px;
}

/* Cookie banner */
.cookie-banner{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 0;
  z-index: 9999;
  background: rgba(11,16,32,.92);
  border-top: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

.cookie-inner{
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.cookie-text{ max-width: 780px; }

.cookie-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Ensure hidden cookie banner never reserves space */
.cookie-banner { margin: 0; }
.cookie-banner[style*="display: none"]{
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Mobile */
/* ===== Staff form toolbars: prevent overlap on iPad / mid-width screens ===== */
.tools{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:10px;
}

.tools .right{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
  justify-content:flex-end;
}

/* Each control block (e.g. Reference / Date / Time) */
.tools .right > div{
  flex: 1 1 220px;
  min-width: 200px;
}

/* Inputs should fill their container */
.tools .right input,
.tools .right select{
  width:100%;
  box-sizing:border-box;
}

/* iPad-ish and below: stack neatly */
@media (max-width: 1024px){
  .tools{ align-items:stretch; }
  .tools .right{
    width:100%;
    justify-content:flex-start;
  }
  .tools .right > div{
    flex: 1 1 260px;
    min-width: 220px;
  }
}

/* Phones: single column */
@media (max-width: 560px){
  .tools .right > div{
    flex: 1 1 100%;
    min-width: 0;
  }
}

@media (max-width: 860px){
  .hero-grid{ grid-template-columns: 1fr; }
  .grid3{ grid-template-columns: 1fr; }
  .grid2{ grid-template-columns: 1fr; }

  .menu{ display:none; }
  .burger{ display:inline-flex; align-items:center; justify-content:center; }

  .menu.open{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    padding: 10px 0 16px;
  }

  .menu a{ padding: 12px 10px; }

  /* iOS/Safari header clipping fixes */
  .nav{
    align-items:flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand{ min-width: 0; }
  .cta{
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .btn{ white-space: nowrap; }

  .brand.centered{ margin: 0 auto; }

  /* Cookie banner layout on mobile */
  .cookie-inner{
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-actions{
    justify-content: flex-end;
  }
}

/* Desktop: centered brand while keeping menu + CTA at sides */
@media (min-width: 861px){
  .brand.centered{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* --- Print / Save as PDF (clean A4 output) --- */
@media print {

  header, .nav, .brand, .menu, .cta, .burger {
    display: none !important;
    position: static !important;
    top: auto !important;
  }

  [style*="position:sticky"], [style*="position: fixed"] {
    position: static !important;
  }

  body { padding-top: 0 !important; }

  @page { margin: 14mm; }

  footer { display: none !important; }

  * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
  }

  body {
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.35;
  }

  .container {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .section { padding: 0 !important; }

  .card {
    border: 1px solid #bbb !important;
    border-radius: 8px !important;
    padding: 12mm !important;
    margin: 0 0 10mm 0 !important;
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    color: #000 !important;
    page-break-after: avoid;
  }

  h1 { font-size: 18pt; margin: 0 0 6mm 0 !important; }
  h2 { font-size: 14pt; margin: 0 0 4mm 0 !important; }
  h3 { font-size: 12.5pt; margin: 0 0 3mm 0 !important; }

  p { margin: 0 0 4mm 0 !important; }
  ul { margin: 0 0 4mm 0 !important; padding-left: 6mm !important; }
  li { margin: 0 0 2mm 0 !important; }

  a, a:visited {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }

  button, .btn { display: none !important; }

  .ref-box { border: 1px solid #bbb !important; padding: 10mm !important; }
  .ref-value { border: 1px solid #bbb !important; background: transparent !important; }
}
/* === QUICK PATCH: level up template cards === */

.grid3{
  align-items: stretch;
}

.grid3 > .card{
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0; /* prevent fighting grid gap */
}

.grid3 > .card .link-list{
  flex: 1;           /* this is the key line */
  margin-top: 10px;
}

/* ============================================================
   Connect EPN – Visual Polish v2 (non-breaking enhancements)
   Integrated into styles.css (drop-in replacement)
   ============================================================ */

/* Smooth, consistent micro-interactions */
.btn{
  transition:
    transform .15s ease,
    background .15s ease,
    box-shadow .15s ease,
    opacity .15s ease,
    border-color .15s ease;
  will-change: transform;
}
.btn:active{
  transform: translateY(0);
  opacity: .92;
}

/* Card edge definition (subtle inner highlight) */
.card{
  position: relative;
}
.card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  pointer-events:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

/* Section rhythm (more breathing space) */
.section{ padding: 32px 0; }
.section + .section{
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Headings inside cards: clearer hierarchy */
.card h3{
  font-size: 16px;
  margin-bottom: 6px;
}
.card h3:not(.service-icon)::after{
  content:"";
  display:block;
  width: 36px;
  height: 2px;
  margin-top: 6px;
  background: linear-gradient(90deg, #21c7d9, transparent);
  opacity: .6;
}

/* Lists inside cards: slightly roomier + app-like hover */
.link-list li{ margin-bottom: 8px; }
.link-list a:hover{
  text-decoration: none;
  opacity: .88;
}

/* Header depth (helps separation on long pages) */
header{
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}

/* Form focus glow (matches your select focus behaviour) */
input:focus,
textarea:focus{
  border-color: #21c7d9;
  box-shadow: 0 0 0 2px rgba(33,199,217,.35);
}

/* Lightweight status pills (optional utility classes) */
.status{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.82);
}
.status.ok{ background: rgba(51,209,122,.14); }
.status.warn{ background: rgba(255,184,107,.14); }
.status.bad{ background: rgba(255,107,107,.14); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
  .btn:hover{ transform: none !important; }
}
/* Add space between sub-heading and badges */
.hero .badges {
  margin-top: 2.5rem;
}
.hero h1 {
  margin-bottom: 2rem;
}
/* ============================
   iPad staff forms: harden toolbar layout (prevents overlap)
   Paste at end of styles.css
   ============================ */

/* Allow flex children to shrink properly (Safari/iPad needs this) */
.tools, .tools *{
  min-width: 0;
}

/* Make the right cluster wrap no matter what element types are inside */
.tools .right{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
}

/* IMPORTANT: target ALL direct children, not just divs */
.tools .right > *{
  flex: 1 1 220px;   /* wraps instead of colliding */
  min-width: 200px;
}

/* Buttons shouldn't stretch huge, but must wrap cleanly */
.tools .right > button,
.tools .right > .btn{
  flex: 0 0 auto;
}

/* Inputs always fill their block */
.tools .right input,
.tools .right select,
.tools .right textarea{
  width:100%;
  box-sizing:border-box;
}

/* iPad / tablet widths (portrait + landscape) */
@media (max-width: 1100px){
  .tools{
    align-items:stretch;
  }
  .tools .right{
    width:100%;
    justify-content:flex-start;
  }
  .tools .right > *{
    flex: 1 1 260px;
    min-width: 220px;
  }
}

/* Phones */
@media (max-width: 560px){
  .tools .right > *{
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* If any forms use grid blocks for those fields */
@media (max-width: 1100px){
  .grid3tight{ grid-template-columns: 1fr; }
}
/* ============================
   iPad: STOP overlap on form header controls
   (forces stacking + overrides inline min-width)
   ============================ */

@media (max-width: 1100px){
  /* If the page is using the common toolbar pattern */
  .tools{
    display:flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .tools .right{
    display:flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Override inline min-widths that cause the collision */
  .tools .right > *{
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  .tools .right input,
  .tools .right select,
  .tools .right textarea{
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* If any templates use a 3-column grid for those fields */
  .grid3tight{
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   iPad: force form header controls to stack (selector-agnostic)
   Works whether your markup uses .right or not.
   Paste kept at end so it wins.
   ========================================================= */
@media (max-width: 1100px){
  .tools{
    display:flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* Catch ANY direct children of .tools (not just .right) */
  .tools > *{
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* And catch nested common “row” wrappers too */
  .tools .right,
  .tools .left,
  .tools .row{
    display:flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .tools .right > *,
  .tools .left > *,
  .tools .row > *{
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Inputs fill their blocks */
  .tools input,
  .tools select,
  .tools textarea{
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* If any forms use a 3-column grid for those fields */
  .grid3tight{
    grid-template-columns: 1fr !important;
  }
}
/* =========================================================
   iPad landscape: prevent form header controls overlapping
   Only applies in landscape on tablets
   ========================================================= */
@media (orientation: landscape) and (max-width: 1200px){

  /* Toolbars: allow wrap and shrink properly */
  .tools,
  .tools .right{
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 10px !important;
  }

  /* Critical for Safari flex shrink */
  .tools, .tools *{
    min-width: 0 !important;
  }

  /* Make ALL controls take full line if needed */
  .tools .right > *{
    flex: 1 1 240px !important;
    min-width: 220px !important;
    max-width: 100% !important;
  }

  /* Keep buttons from stretching */
  .tools .right > button,
  .tools .right > .btn{
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  /* Inputs fill their block */
  .tools input,
  .tools select,
  .tools textarea{
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* If any pages use 3-column grid blocks for those fields */
  .grid3tight{
    grid-template-columns: 1fr 1fr !important; /* nicer in landscape than single column */
  }
}

/* If it still clips, make grid3tight single column on slightly smaller landscape widths */
@media (orientation: landscape) and (max-width: 980px){
  .grid3tight{
    grid-template-columns: 1fr !important;
  }
}
/* --- Staff: remove the unwanted right-hand accent line on card headings --- */
.card h3.h-icon::after,
.card h3.h-icon::before{
  content: none !important;
  display: none !important;
}

/* Keep underline ONLY under the text span */
.service-title{
  display: inline-flex;
  flex: 0 0 auto;
}

.service-title::after{
  pointer-events: none;
}
/* iPad landscape: stop date/time style grids colliding */
@media (orientation: landscape) and (max-width: 1200px){
  .row, .row3{
    grid-template-columns: 1fr !important; /* stack fields */
  }
}
