/* ================================================
   ISOQUICK GLOBAL STYLES
   Modern, spacious, presentation-ready
   ================================================ */

/* Global Brand Palette */
:root {
    --brand-blue: #004a99;
    --brand-red: #E85C1A;
    --brand-gray: #333;
    --light-bg: #f4f4f4;
    --warm-bg: #faf8f5;
    --accent: #E85C1A;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--brand-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Skip-to-content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand-blue);
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    z-index: 10000;
    border-radius: 0 0 8px 0;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Focus-visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--brand-red);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default outline where focus-visible is supported */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
    outline: none;
}

/* ================================================
   HEADER — Modern, spacious
   ================================================ */
header {
    background: rgba(255, 255, 255, 0.98);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
    border-bottom-color: transparent;
}

/* ================================================
   HOMEPAGE HERO HEADER — Transparent overlay
   ================================================ */
.home-hero header {
    position: absolute;
    width: 100%;
    background: transparent;
    border-bottom: none;
}
.home-hero header .nav-left a,
.home-hero header .nav-right a,
.home-hero header .dropdown-trigger {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.home-hero header .nav-left a::after,
.home-hero header .nav-right a::after,
.home-hero header .dropdown-trigger::after {
    background: #fff;
}
.home-hero header .nav-item:hover .dropdown-trigger,
.home-hero header .nav-left a:hover,
.home-hero header .nav-right a:hover,
.home-hero header .nav-left a.active,
.home-hero header .nav-right a.active,
.home-hero header .dropdown-trigger.active {
    color: #fff;
}
.home-hero header .dropdown-content a {
    color: #1a1a2e;
    text-shadow: none;
}
.home-hero header .phone-button {
    color: #fff;
    border-color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.home-hero header .phone-button:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.home-hero header .hamburger span {
    background: #fff;
}
.home-hero header .hamburger:hover {
    background: rgba(255,255,255,0.1);
}
.home-hero header .logo img {
    filter: none;
}
.home-hero header .logo {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Revert to white background when scrolled on homepage */
.home-hero header.scrolled {
    position: fixed;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid transparent;
}
.home-hero header.scrolled .nav-left a,
.home-hero header.scrolled .nav-right a,
.home-hero header.scrolled .dropdown-trigger {
    color: #1a1a2e;
    text-shadow: none;
}
.home-hero header.scrolled .nav-left a::after,
.home-hero header.scrolled .nav-right a::after,
.home-hero header.scrolled .dropdown-trigger::after {
    background: var(--brand-blue);
}
.home-hero header.scrolled .nav-item:hover .dropdown-trigger,
.home-hero header.scrolled .nav-left a:hover,
.home-hero header.scrolled .nav-right a:hover,
.home-hero header.scrolled .nav-left a.active,
.home-hero header.scrolled .nav-right a.active,
.home-hero header.scrolled .dropdown-trigger.active {
    color: var(--brand-blue);
}
.home-hero header.scrolled .phone-button {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
    text-shadow: none;
}
.home-hero header.scrolled .phone-button:hover {
    background: var(--brand-blue);
    color: #fff;
}
.home-hero header.scrolled .hamburger span {
    background: #1a1a2e;
}
.home-hero header.scrolled .hamburger:hover {
    background: rgba(0,74,153,0.06);
}
.home-hero header.scrolled .logo img {
    filter: none;
}
.home-hero header.scrolled .logo {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

nav {
    display: flex;
    align-items: center;
    padding: 0 4%;
    max-width: 1600px;
    margin: 0 auto;
    height: 86px;
}

.nav-left, .nav-right-group {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-left {
    justify-content: flex-end;
    gap: 36px;
    padding-right: 50px;
}

.nav-right-group {
    justify-content: flex-start;
    gap: 36px;
    padding-left: 50px;
}

.nav-right {
    display: flex;
    gap: 36px;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    height: 90px;
    transition: height 0.3s ease;
}

header.scrolled .logo img {
    height: 66px;
}

.cert-stat-logo {
    display: block;
    width: auto;
    max-width: 132px;
    max-height: 44px;
    margin: 0 auto 6px;
    object-fit: contain;
}

.cert-stat-logo--kiwa {
    max-height: 48px;
}

.cert-stat-logo--ph {
    max-width: 150px;
    max-height: 44px;
}

.trust-cert-logo,
.cs-cert-logo,
.footer-cert-logo {
    display: inline-block;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.trust-cert-logo {
    max-width: 156px;
    max-height: 50px;
}

.cs-cert-logo {
    max-width: 120px;
    max-height: 46px;
}

.footer-cert-logo {
    max-height: 30px;
    margin-left: 8px;
}

.footer-cert-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.trust-text .trust-cert-logo {
    display: block;
    margin-bottom: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Nav links */
/* .nav-links merged into .nav-left / .nav-right */

.nav-left a, .nav-right a {
    text-decoration: none;
    color: #1a1a2e;
    font-weight: 500;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.25s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.nav-left a::after, .nav-right a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-blue);
    border-radius: 2px;
    transition: width 0.25s ease;
}

.nav-left a:hover, .nav-right a:hover { color: var(--brand-blue); }
.nav-left a:hover::after, .nav-right a:hover::after,
.nav-left a.active::after, .nav-right a.active::after { width: 100%; }
.nav-left a.active, .nav-right a.active { color: var(--brand-blue); font-weight: 600; }

/* Dropdown */
.nav-item {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    color: #1a1a2e;
    font-weight: 500;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.25s;
    display: inline-flex;
    align-items: center;
}

.dropdown-trigger::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-blue);
    border-radius: 2px;
    transition: width 0.25s ease;
}

.nav-item:hover .dropdown-trigger { color: var(--brand-blue); }
.nav-item:hover .dropdown-trigger::after { width: 100%; }
.dropdown-trigger.active { color: var(--brand-blue); font-weight: 600; }

.dropdown-content {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: #fff;
    min-width: 230px;
    box-shadow: 0 8px 40px rgba(0, 74, 153, 0.13), 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 14px;
    padding: 8px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid rgba(0,0,0,0.06);
    border-top: 1px solid rgba(0,0,0,0.06);
    border-radius: 2px;
    transform: translateX(-50%) rotate(45deg);
}

.nav-item::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

.nav-item:hover .dropdown-content {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 11px 16px;
    color: #1a1a2e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.dropdown-content a:hover,
.dropdown-content a:focus {
    background: var(--brand-blue);
    color: #fff;
}

/* CTA buttons */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.home-hero header .header-actions {
    background: rgba(255,255,255,0.12);
    padding: 5px 6px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.25);
    gap: 8px;
}

.home-hero header.scrolled .header-actions {
    background: transparent;
    padding: 0;
    border: none;
    gap: 10px;
}

.phone-button {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--brand-blue);
    border: 1.5px solid var(--brand-blue);
    padding: 9px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.01em;
    transition: all 0.25s;
    white-space: nowrap;
}

.phone-button:hover {
    background: var(--brand-blue);
    color: #fff;
}

.quote-button {
    display: inline-flex;
    align-items: center;
    background: var(--brand-red);
    color: #fff;
    padding: 9px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 14px rgba(230, 35, 29, 0.28);
    transition: all 0.25s;
    white-space: nowrap;
}

.quote-button:hover {
    background: #c21d17;
    box-shadow: 0 4px 20px rgba(230, 35, 29, 0.4);
    transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger:hover { background: rgba(0,74,153,0.06); }

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1a1a2e;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 8px 5% 28px;
}

.mobile-menu.open { display: flex; }

.mobile-menu-links {
    display: flex;
    flex-direction: column;
}

.mobile-menu-links a,
.mobile-menu-links summary {
    padding: 15px 0;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a2e;
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    list-style: none;
    transition: color 0.2s;
}

.mobile-menu-links a:hover,
.mobile-menu-links summary:hover { color: var(--brand-blue); }

.mobile-sub {
    display: flex;
    flex-direction: column;
    padding: 4px 0 4px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mobile-sub a {
    border-bottom: none;
    padding: 10px 0;
    font-size: 15px;
}

.mobile-menu-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.mobile-menu-actions .phone-button,
.mobile-menu-actions .quote-button {
    flex: 1;
    justify-content: center;
}

/* ================================================
   FOOTER STYLES
   ================================================ */
footer { 
    background: var(--brand-blue); 
    color: #fff; 
    padding: 50px 5% 30px 5%; 
}

.footer-container {
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1.5fr; 
    gap: 40px; 
    max-width: 1400px; 
    margin: 0 auto 40px auto; 
}

.footer-logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 20px; 
}

.footer-logo img { 
    height: 90px; 
}

.footer-logo .logo-text { 
    display: none;
}

.footer-description {
    line-height: 1.8; 
    margin-bottom: 15px; 
    opacity: 0.9; 
}

.footer-contact { 
    margin-bottom: 20px; 
}

.footer-contact a { 
    color: #fff; 
    text-decoration: none; 
    transition: opacity 0.3s; 
}

.footer-contact a:hover { opacity: 0.8; }

.social-links { 
    display: flex; 
    gap: 15px; 
}

.social-links a { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 40px; 
    height: 40px; 
    background: rgba(255,255,255,0.1); 
    border-radius: 6px; 
    color: #fff; 
    transition: all 0.3s; 
}

.social-links a:hover { 
    background: rgba(255,255,255,0.2); 
    transform: translateY(-2px); 
}

.footer-column h3 { 
    font-size: 1.1rem; 
    margin-bottom: 20px; 
    font-weight: 600; 
}

.footer-column ul { 
    list-style: none; 
}

.footer-column ul li { 
    margin-bottom: 12px; 
}

.footer-column ul li a { 
    color: #fff; 
    text-decoration: none; 
    opacity: 0.9; 
    transition: opacity 0.3s; 
}

.footer-column ul li a:hover { opacity: 1; }

.footer-office address { 
    font-style: normal; 
    line-height: 1.8; 
    opacity: 0.9; 
}

.footer-bottom { 
    text-align: center; 
    padding-top: 30px; 
    border-top: 1px solid rgba(255,255,255,0.2); 
}

.footer-bottom p { 
    margin: 5px 0; 
    opacity: 0.8; 
    font-size: 0.9rem; 
}

/* ================================================
   IMAGE PLACEHOLDERS
   ================================================ */
.img-placeholder {
    background: linear-gradient(135deg, #e8edf5 0%, #d4dce8 100%);
    border-radius: 16px;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    border: 2px dashed #b0bfce;
    color: #6a7d92;
    font-size: 1rem;
}

.img-placeholder strong {
    display: block;
    font-size: 1.05rem;
    color: var(--brand-blue);
    line-height: 1.6;
}

/* ================================================
   UTILITY CLASSES
   ================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.flash-messages {
    margin-bottom: 24px;
}

.flash {
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 500;
    background: #e0f2fe;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
    border-color: #22c55e;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

/* ================================================
   ERROR PAGES
   ================================================ */
.error-page {
    text-align: center;
    padding: 120px 24px;
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--brand-blue);
    line-height: 1;
    margin-bottom: 16px;
}

.error-code.error-500 {
    color: var(--brand-red);
}

.error-message {
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 32px;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    background: var(--brand-blue);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.25s;
}

.btn:hover {
    background: #003a7a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,74,153,0.25);
}

/* ===== AUDIENCE STRIP — Fixed side panel ===== */
.audience-strip {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    z-index: 999;
    background: var(--brand-blue);
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: stretch;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    max-width: 280px;
}
.audience-strip.collapsed {
    transform: translateY(-50%) translateX(calc(100% - 42px));
}
.audience-toggle {
    width: 42px;
    background: #fff;
    border: none;
    border-radius: 12px 0 0 12px;
    color: var(--brand-blue);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0;
    line-height: 1.2;
    flex-shrink: 0;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}
.audience-toggle span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    letter-spacing: 1px;
}
.audience-toggle:hover {
    background: var(--warm-bg);
}
.audience-inner {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}
.audience-strip-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
    margin: 0;
}
.audience-btn {
    display: block;
    padding: 10px 16px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.15);
    text-align: center;
}
.audience-btn:hover {
    background: #fff;
    border-color: #fff;
    color: var(--brand-blue);
    transform: translateX(-4px);
}
@media (max-width: 768px) {
    .audience-strip {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none !important;
        max-width: none;
        width: 100%;
        border-radius: 0;
        flex-direction: column;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
        z-index: 999;
    }
    .audience-strip.collapsed { transform: none !important; }
    .audience-toggle { display: none; }
    .audience-inner {
        flex-direction: row;
        padding: 8px 10px;
        gap: 6px;
        min-width: 0;
        align-items: center;
    }
    .audience-strip-label { display: none; }
    .audience-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 4px;
        font-size: 11px;
        line-height: 1.2;
        border-radius: 6px;
        white-space: normal;
        text-align: center;
    }
    .audience-btn:hover { transform: none; }
    body { padding-bottom: 60px; }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .header-actions { display: none; }
    .nav-left, .nav-right-group { gap: 24px; }
    .nav-left { padding-right: 30px; }
    .nav-right-group { padding-left: 30px; }
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-left, .nav-right-group { display: none; }
    .hamburger { display: flex; }

    /* Logo — fixed height, scale width proportionally */
    .logo img { height: 58px; width: auto; max-width: none; }
    nav { height: 64px; padding: 0 16px; }

    /* Prevent horizontal scroll globally */
    section, .sub-section, .sub-section--alt, .sub-section--dark,
    .sub-inner, .container { overflow-x: hidden; }

    /* Audience pages — hero */
    .sub-hero { padding: 64px 0 52px; }
    .sub-hero-inner { padding: 0 16px; }
    .sub-hero-tag { max-width: 90vw; white-space: normal; text-align: center; }
    .sub-hero h1 { font-size: clamp(1.8rem, 5vw, 3.5rem) !important; }
    .sub-hero p { font-size: 1rem; }

    /* Audience pages — cert logos */
    .cert-logo-img { max-height: 36px; }
    .cert-logo-inner { gap: 16px; }

    /* Audience pages — section padding */
    .sub-section { padding: 60px 0; }
    .sub-section--alt { padding: 60px 0; }
    .sub-section--dark { padding: 60px 0; }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .error-code {
        font-size: 5rem;
    }
}

@media (max-width: 480px) {
    /* CTA buttons — full width on small phones */
    .sub-hero-cta {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 24px;
        box-sizing: border-box;
    }
    .cta-btn-red, .cta-btn-outline {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 24px;
        box-sizing: border-box;
    }
}

@media (max-width: 600px) {
    .footer-column {
        text-align: center;
    }
}
