/* =========================================
   AEC GLOBAL STYLES
========================================= */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* =========================================
   Root Variables
========================================= */

:root{
  --navy:#0F3B63;
  --gold:#F5B800;
  --gold-dark:#D9A400;

  --ink:#0a0f1a;
  --muted:#5a667b;
  --card:#ffffff;
  --section:#f6f8fb;
  --border:#e5e9f2;
  --ring:#b7e4e4;

  --radius:16px;
  --gap:24px;
  --max:1200px;
}

/* =========================================
   Reset
========================================= */

html{box-sizing:border-box;height:100%}
*,*:before,*:after{box-sizing:inherit}

body{
  margin:0;
  min-height:100%;
  display:flex;
  flex-direction:column;
  font-family:'Inter',sans-serif;
  color:var(--ink);
  background:#fff;
  line-height:1.5;
  padding-top:117px; /* 32px util bar + 85px main nav */
}

main{flex:1}

img{max-width:100%;height:auto}
a{text-decoration:none;color:inherit}

/* =========================================
   Layout Containers
========================================= */

.container{
  max-width:var(--max);
  margin-inline:auto;
  padding:0 20px;
}

section{
  padding:56px 0;
}

h1{
  font-size:clamp(32px,5vw,52px);
  line-height:1.1;
}

h2{
  font-size:clamp(24px,3.6vw,34px);
  margin-bottom:18px;
}

.muted{color:var(--muted)}

.grid{display:grid;gap:var(--gap)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  transition:.2s ease;
}

.card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(10,15,26,.06);
}

/* =========================================
   Buttons (Generic Page Buttons)
========================================= */

.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:12px 18px;
  border-radius:12px;
  font-weight:600;
  border:1px solid transparent;
  transition:.2s ease;
  background:#eef3f8;
  cursor:pointer;
}

.btn.primary{
  background:var(--navy);
  color:#fff;
}

.btn.primary:hover{
  opacity:.9;
}

.btn.ghost{
  background:#fff;
  color:var(--navy);
  border:1px solid var(--border);
}

.btn.ghost:hover{
  background:#f6f8fb;
}

/* =========================================
   UTILITY BAR
========================================= */

.util-bar{
  background:#081c36;
  height:32px;
  width:100%;
  border-bottom:1px solid rgba(255,255,255,.07);
}

.util-inner{
  max-width:1300px;
  margin:0 auto;
  padding:0 48px;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.util-tagline{
  font-size:11px;
  color:rgba(255,255,255,.5);
  letter-spacing:.04em;
  text-transform:uppercase;
}

.util-right{
  display:flex;
  align-items:center;
  gap:16px;
}

.util-divider{
  width:1px;
  height:14px;
  background:rgba(255,255,255,.15);
  display:block;
}

.util-portal{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  font-weight:500;
  color:rgba(255,255,255,.65);
  letter-spacing:.03em;
  text-decoration:none;
  transition:color .15s ease;
}

.util-portal:hover{
  color:#fff;
}

.util-portal svg{
  opacity:.7;
  flex-shrink:0;
}

.util-portal:hover svg{
  opacity:1;
}

/* =========================================
   LANGUAGE SELECTOR
========================================= */

.lang-selector{
  position:relative;
}

.lang-trigger{
  display:flex;
  align-items:center;
  gap:5px;
  background:none;
  border:none;
  cursor:pointer;
  padding:0;
  font-family:inherit;
  font-size:11px;
  font-weight:500;
  color:rgba(255,255,255,.65);
  letter-spacing:.03em;
  transition:color .15s ease;
}

.lang-trigger:hover{
  color:#fff;
}

.lang-flag{
  font-size:13px;
  line-height:1;
}

.lang-current{
  letter-spacing:.05em;
}

.lang-chevron{
  color:rgba(255,255,255,.4);
  transition:transform .2s ease;
}

.lang-trigger[aria-expanded="true"] .lang-chevron{
  transform:rotate(180deg);
}

.lang-dropdown{
  display:none;
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  list-style:none;
  margin:0;
  padding:6px 0;
  min-width:160px;
  z-index:2000;
}

.lang-dropdown.open{
  display:block;
}

.lang-option{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  cursor:pointer;
  transition:background .12s ease;
}

.lang-option:hover{
  background:var(--section);
}

.lang-option.active{
  background:#eef3fb;
}

.lang-opt-flag{
  font-size:15px;
  line-height:1;
  flex-shrink:0;
}

.lang-opt-name{
  flex:1;
  font-size:13px;
  color:var(--ink);
  font-weight:500;
}

.lang-opt-code{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
  letter-spacing:.05em;
}

/* =========================================
   HEADER SYSTEM
========================================= */

.site-header{
  position:fixed;
  top:0;
  width:100%;
  height:117px;
  background:#ffffff;
  z-index:1000;
  transition:box-shadow .2s ease;
  border-bottom:1px solid var(--border);
}

.site-header.scrolled{
  box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.header-inner{
  max-width:1300px;
  margin:0 auto;
  height:75%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 48px;
}

.logo{
  display:flex;
  align-items:center;
  flex-shrink:0;
}

.logo img{
  width:90px;
  display:block;
}

.main-nav{
  flex:1;
  margin-left:60px;
}

.nav-list{
  display:flex;
  gap:40px;
  list-style:none;
  margin:0;
  padding:0;
}

.nav-link{
  font-family:inherit;
  font-size:15px;
  font-weight:500;
  letter-spacing:.02em;
  text-transform:uppercase;
  color:rgba(15,59,99,.8);
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
  position:relative;
}

.nav-link:hover{color:var(--navy)}

.nav-link::after{
  content:"";
  position:absolute;
  bottom:-6px;
  left:0;
  height:2px;
  width:0;
  background:var(--gold);
  transition:width .2s ease;
}

.nav-link:hover::after{width:100%}

/* =========================================
   Header CTAs
========================================= */

.header-cta{
  display:flex;
  gap:12px;
  align-items:center;
}

.btn-primary{
  background:var(--navy);
  color:#fff;
  padding:11px 28px;
  font-weight:700;
  font-size:14px;
  letter-spacing:.03em;
  text-transform:uppercase;
  border-radius:4px;
  border:2px solid var(--navy);
  text-decoration:none;
  transition:all .2s ease;
  display:inline-block;
}

.btn-primary:hover{
  background:#0a2744;
  border-color:#0a2744;
  color:#fff;
}

.btn-secondary{
  background:var(--gold);
  color:var(--navy);
  padding:11px 28px;
  font-weight:700;
  font-size:14px;
  letter-spacing:.03em;
  text-transform:uppercase;
  border-radius:4px;
  border:2px solid var(--gold);
  text-decoration:none;
  transition:all .2s ease;
  display:inline-block;
}

.btn-secondary:hover{
  background:var(--gold-dark);
  border-color:var(--gold-dark);
}

.btn-ghost-header{
  background:transparent;
  color:var(--navy);
  padding:11px 28px;
  font-weight:600;
  font-size:14px;
  letter-spacing:.03em;
  text-transform:uppercase;
  border-radius:4px;
  border:2px solid rgba(15,59,99,.4);
  text-decoration:none;
  transition:all .2s ease;
  display:inline-block;
}

.btn-ghost-header:hover{
  color:var(--navy);
  border-color:var(--navy);
  background:rgba(15,59,99,.05);
}

/* Mobile Toggle */

.mobile-toggle{
  display:none;
  background:none;
  border:none;
  cursor:pointer;
  padding:8px;
  flex-direction:column;
  gap:5px;
  z-index:1001;
}

.mobile-toggle span{
  width:26px;
  height:2px;
  background:var(--navy);
  transition:all .3s ease;
  display:block;
}

.mobile-toggle.active span:nth-child(1){
  transform:rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2){
  opacity:0;
}

.mobile-toggle.active span:nth-child(3){
  transform:rotate(-45deg) translate(6px, -6px);
}

/* =========================================
   Mega Panel
========================================= */

.mega-panel{
  position:absolute;
  top:117px;
  left:0;
  width:100%;
  background:#fff;
  opacity:0;
  visibility:hidden;
  transform:translateY(8px);
  transition:all .2s ease;
  box-shadow:0 8px 24px rgba(0,0,0,.1);
  border-top:3px solid var(--gold);
}

.mega-panel.active{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.mega-inner{
  max-width:1300px;
  margin:0 auto;
  padding:36px 48px;
  display:flex;
  gap:0;
  align-items:flex-start;
}

.mega-column{
  flex:1;
  padding-right:40px;
  border-right:1px solid var(--border);
  margin-right:40px;
}

.mega-column:last-of-type{
  border-right:none;
  margin-right:0;
}

.mega-column h4{
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin:0 0 20px 0;
  color:var(--muted);
}

.mega-link-item{
  margin-bottom:18px;
}

.mega-link-title{
  display:block;
  font-size:14px;
  font-weight:600;
  color:var(--navy);
  transition:color .15s ease;
  margin-bottom:3px;
}

.mega-link-title:hover{
  color:var(--gold-dark);
}

.mega-link-desc{
  margin:0;
  font-size:12px;
  color:var(--muted);
  line-height:1.5;
}

.mega-featured{
  width:260px;
  flex-shrink:0;
}

.mega-featured-label{
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin-bottom:12px;
}

.mega-featured-card{
  display:block;
  background:var(--navy);
  border-left:3px solid var(--gold);
  border-radius:8px;
  padding:20px;
  text-decoration:none;
  transition:transform .2s ease, box-shadow .2s ease;
}

.mega-featured-card:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(15,59,99,.18);
}

.mega-featured-tag{
  display:inline-block;
  background:var(--gold);
  color:var(--navy);
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:3px 8px;
  border-radius:3px;
  margin-bottom:12px;
}

.mega-featured-title{
  font-size:14px;
  font-weight:700;
  color:#fff;
  line-height:1.4;
  margin-bottom:10px;
}

.mega-featured-desc{
  font-size:12px;
  color:rgba(255,255,255,.7);
  line-height:1.6;
  margin-bottom:14px;
}

.mega-featured-link{
  font-size:12px;
  font-weight:600;
  color:var(--gold);
  letter-spacing:.02em;
}

/* =========================================
   Mobile Navigation
========================================= */

.mobile-nav{
  position:fixed;
  top:117px;
  left:0;
  width:100%;
  height:calc(100vh - 117px);
  background:var(--navy);
  opacity:0;
  visibility:hidden;
  transform:translateX(-100%);
  transition:all .3s ease;
  overflow-y:auto;
  z-index:999;
}

.mobile-nav.active{
  opacity:1;
  visibility:visible;
  transform:translateX(0);
}

.mobile-nav nav{
  padding:32px 24px;
}

.mobile-section{
  margin-bottom:32px;
  padding-bottom:24px;
  border-bottom:1px solid rgba(255,255,255,.1);
}

.mobile-section:last-of-type{
  border-bottom:none;
}

.mobile-section h4{
  color:#fff;
  font-size:13px;
  font-weight:600;
  text-transform:uppercase;
  margin:0 0 16px 0;
  letter-spacing:.05em;
}

.mobile-section a{
  display:block;
  color:rgba(255,255,255,.85);
  font-size:15px;
  padding:10px 0;
  transition:color .2s ease;
}

.mobile-section a:hover{
  color:#fff;
}

.mobile-cta{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:24px;
}

.mobile-cta .btn-primary,
.mobile-cta .btn-ghost-header,
.mobile-cta .btn-secondary{
  text-align:center;
  width:100%;
  box-sizing:border-box;
}

.mobile-cta .btn-ghost-header{
  color:#fff;
  border-color:rgba(255,255,255,.4);
}

.mobile-cta .btn-ghost-header:hover{
  color:#fff;
  border-color:#fff;
  background:rgba(255,255,255,.06);
}

/* =========================================
   Footer
========================================= */

footer{
  background:#111f3a;
  color:#cbd5e1;
}

footer .cols{
  display:grid;
  gap:24px;
  grid-template-columns:2fr 1fr 1fr 1fr;
  padding:36px 0;
}

footer a{
  color:#dbe6ff;
  transition:color .2s ease;
}

footer a:hover{color:#fff}

footer strong{
  font-size:13px;
  font-weight:600;
  letter-spacing:.02em;
  color:#fff;
}

footer a{
  font-size:13px;
  font-weight:400;
  line-height:1.8;
  opacity:.85;
}

footer a:hover{
  opacity:1;
}

footer .small{
  font-size:12px;
  opacity:.8;
  line-height:1.6;
}

.small{font-size:13px}

.footer-newsletter{
  border-top:1px solid rgba(255,255,255,.08);
  padding:28px 0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.footer-newsletter-name{
  font-size:15px;
  font-weight:700;
  color:#fff;
  letter-spacing:.01em;
  margin-bottom:4px;
}

.footer-newsletter-left .small{
  opacity:.7;
}

.footer-newsletter-form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.footer-newsletter-form input[type="email"]{
  padding:10px 16px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.07);
  color:#fff;
  font-size:13px;
  font-family:inherit;
  min-width:220px;
  transition:border-color .2s ease;
}

.footer-newsletter-form input[type="email"]::placeholder{
  color:rgba(255,255,255,.35);
}

.footer-newsletter-form input[type="email"]:focus{
  outline:none;
  border-color:var(--gold);
}

#newsletterMessage{
  display:none;
  width:100%;
  font-size:13px;
  margin-top:4px;
}

.footer-accreditation{
  border-top:1px solid rgba(255,255,255,.08);
  padding:24px 0;
}

.footer-accreditation-label{
  display:block;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.1em;
  color:rgba(255,255,255,.35);
  margin-bottom:16px;
}

.footer-accreditation-logos{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:32px;
}

.accred-logo-link{
  display:inline-flex;
  align-items:center;
  opacity:.55;
  transition:opacity .2s ease;
  filter:brightness(0) invert(1);
}

.accred-logo-link:hover{
  opacity:.9;
}

.accred-logo-link img{
  height:32px;
  width:auto;
  max-width:120px;
  display:block;
}

.accred-logo-link.accred-missing{
  display:none;
}

.footer-legal-notice{
  border-top:1px solid rgba(255,255,255,.06);
  padding:20px 0;
}

.footer-legal-notice .small{
  opacity:.6;
  max-width:780px;
}

.footer-bottom{
  border-top:1px solid rgba(255,255,255,.06);
  padding:16px 0;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
}

/* =========================================
   Utilities
========================================= */

.spacer-8{height:8px}
.spacer-16{height:16px}
.spacer-24{height:24px}
.spacer-32{height:32px}

.btn:focus,
.card:focus-within,
a:focus{
  outline:3px solid var(--ring);
  outline-offset:2px;
}

/* =========================================
   CERTIFICATION PAGE VARIANTS
========================================= */

/* Teal CTA button — primary action on cert pages */
.btn-cert{
  background:#0ea5a5;
  color:#fff;
  padding:11px 28px;
  font-weight:700;
  font-size:14px;
  letter-spacing:.03em;
  text-transform:uppercase;
  border-radius:4px;
  border:2px solid #0ea5a5;
  text-decoration:none;
  transition:all .2s ease;
  display:inline-block;
}

.btn-cert:hover{
  background:#0c9292;
  border-color:#0c9292;
  color:#fff;
}

/* Hero gradient — dark navy for cert pages */
.hero-cert{
  background:linear-gradient(
    180deg,
    #0b2346,
    #0f2f4f 70%,
    #132f52
  );
  color:#fff;
}

/* Ghost button override inside cert hero (dark bg context) */
.hero-cert .btn-ghost-header{
  color:#fff;
  border-color:rgba(255,255,255,.45);
  background:transparent;
}

.hero-cert .btn-ghost-header:hover{
  color:#fff;
  border-color:#fff;
  background:rgba(255,255,255,.08);
}

/* =========================================
   COOKIE CONSENT BANNER
   Injected globally via layout.js on every
   page. cookies.html manages its own banner
   and is exempt from this injection.
========================================= */

#cookieBanner{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background:#0b2346;
  color:#fff;
  border-top:3px solid var(--gold);
  box-shadow:0 -4px 20px rgba(0,0,0,.15);
  z-index:1500;
  padding:18px 0;
  /* Start off-screen, animate in via .cb-visible */
  transform:translateY(100%);
  transition:transform .35s ease;
}

#cookieBanner.cb-visible{
  transform:translateY(0);
}

.cb-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:16px;
}

.cb-text{
  flex:1;
  min-width:260px;
}

.cb-text strong{
  display:block;
  font-size:15px;
  font-weight:700;
  color:#fff;
  margin-bottom:4px;
}

.cb-text p{
  margin:0;
  font-size:13px;
  color:rgba(255,255,255,.75);
  line-height:1.5;
}

.cb-text a{
  color:var(--gold);
  text-decoration:underline;
}

.cb-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  flex-shrink:0;
}

.cb-btn{
  padding:9px 20px;
  font-size:13px;
  font-weight:600;
  border-radius:6px;
  cursor:pointer;
  border:2px solid transparent;
  transition:all .2s ease;
  font-family:inherit;
  white-space:nowrap;
}

.cb-solid{
  background:var(--gold);
  color:var(--navy);
  border-color:var(--gold);
}

.cb-solid:hover{
  background:var(--gold-dark);
  border-color:var(--gold-dark);
}

.cb-ghost{
  background:transparent;
  color:#fff;
  border-color:rgba(255,255,255,.35);
}

.cb-ghost:hover{
  border-color:#fff;
  background:rgba(255,255,255,.08);
}

@media(max-width:640px){
  .cb-inner{
    flex-direction:column;
    align-items:flex-start;
  }
  .cb-actions{
    width:100%;
  }
  .cb-btn{
    flex:1;
    text-align:center;
  }
}

/* =========================================
   Responsive
========================================= */

@media(max-width:1024px){

  .header-inner{
    padding:0 24px;
  }

  .util-inner{
    padding:0 24px;
  }

  .main-nav,
  .header-cta{
    display:none;
  }

  .mobile-toggle{
    display:flex;
  }

  footer .cols{
    grid-template-columns:1fr 1fr;
  }

  .footer-newsletter{
    gap:16px;
  }

  .mega-inner{
    padding:32px 24px;
    gap:32px;
  }
}

@media(max-width:640px){

  body{
    padding-top:107px;
  }

  .site-header{
    height:107px;
  }

  .header-inner{
    padding:0 16px;
  }

  .logo img{
    width:75px;
  }

  .util-inner{
    padding:0 16px;
  }

  .util-tagline{
    display:none;
  }

  .mobile-nav{
    top:107px;
    height:calc(100vh - 107px);
  }

  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2{
    grid-template-columns:1fr;
  }

  footer .cols{
    grid-template-columns:1fr;
  }

  .footer-newsletter{
    flex-direction:column;
    align-items:flex-start;
  }

  .footer-newsletter-form{
    width:100%;
  }

  .footer-newsletter-form input[type="email"]{
    width:100%;
    min-width:unset;
    box-sizing:border-box;
  }

  .footer-accreditation-logos{
    gap:24px;
  }

  .footer-bottom{
    flex-direction:column;
    gap:4px;
  }

  .mega-inner{
    flex-direction:column;
    gap:24px;
  }

  .mega-featured{
    width:100%;
  }
}

/* =========================================
   RESOURCES DROPDOWN (simple dropdown nav)
========================================= */

.has-dropdown{
  position:relative;
}

.nav-dropdown{
  display:none;
  position:absolute;
  top:100%;
  left:50%;
  transform:translateX(-50%);
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  min-width:240px;
  padding:8px 0;
  z-index:1100;
  margin-top:6px;
}

.nav-dropdown.open{
  display:block;
}

.nav-dropdown-link{
  display:block;
  padding:9px 18px;
  font-size:13px;
  font-weight:500;
  color:var(--ink);
  transition:background .12s ease, color .12s ease;
  text-decoration:none;
  white-space:nowrap;
}

.nav-dropdown-link:hover{
  background:var(--section);
  color:var(--navy);
}

.nav-dropdown-viewall{
  font-weight:700;
  color:var(--navy);
}

.nav-dropdown-divider{
  height:1px;
  background:var(--border);
  margin:6px 0;
}

/* =========================================
   MEGA-GRID — Compact multi-column layout
   Used for Certifications (many groups)
========================================= */

.mega-grid{
  flex:1;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:20px 32px;
  padding-right:40px;
  border-right:1px solid var(--border);
  margin-right:40px;
}

.mega-grid-group h4{
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin:0 0 6px 0;
  color:var(--muted);
}

.mega-grid-link{
  display:block;
  font-size:13px;
  font-weight:500;
  color:var(--navy);
  padding:2px 0;
  transition:color .15s ease;
  line-height:1.7;
}

.mega-grid-link:hover{
  color:var(--gold-dark);
}

/* =========================================
   MEGA BOTTOM BAR — "View All" link strip
========================================= */

.mega-bottom-bar{
  border-top:1px solid var(--border);
  padding:12px 48px;
  background:var(--section);
}

.mega-bottom-link{
  font-size:13px;
  font-weight:700;
  color:var(--navy);
  text-decoration:none;
  transition:color .15s ease;
}

.mega-bottom-link:hover{
  color:var(--gold-dark);
}

/* =========================================
   Responsive — new nav components
========================================= */

@media(max-width:1024px){
  .has-dropdown .nav-dropdown{
    display:none !important;
  }

  .mega-grid{
    grid-template-columns:repeat(2, 1fr);
    gap:16px 24px;
    padding-right:24px;
    margin-right:24px;
  }

  .mega-bottom-bar{
    padding:12px 24px;
  }
}

@media(max-width:640px){
  .mega-grid{
    grid-template-columns:1fr;
    padding-right:0;
    border-right:none;
    margin-right:0;
  }

  .mega-bottom-bar{
    padding:12px 16px;
  }
}