/**
 * Eurocert — Brand Heritage theme (original brand palette)
 */
:root {
    --ec-navy: #1d467a;
    --ec-navy-deep: #163a66;
    --ec-dark: var(--ec-navy);
    --ec-dark-mid: var(--ec-navy-deep);
    --ec-accent: #008ca3;
    --ec-accent-hover: #007a8f;
    --ec-accent-soft: #e0f4f7;
    --ec-gold: #c99e55;
    --ec-gold-hover: #b8893f;
    --ec-primary: var(--ec-accent);
    --ec-light: #f4f8fa;
    --ec-text: #313234;
    --ec-font-display: 'Oswald', sans-serif;
    --ec-font-body: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--ec-font-body);
    color: var(--ec-text);
    background: #fff;
    margin: 0;
    padding-bottom: 0;
}

@media (max-width: 991.98px) {
    body { padding-bottom: 56px; }
}

.display-font, .ec-brand__text, .ec-hero h1, .ec-section-title {
    font-family: var(--ec-font-display);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.accent-gold, .text-ec-gold { color: var(--ec-gold) !important; }

/* Buttons */
.btn-ec-gold {
    background: var(--ec-accent);
    border-color: var(--ec-accent);
    color: #fff;
    font-weight: 600;
    font-family: var(--ec-font-display);
    letter-spacing: 0.04em;
}

.btn-ec-gold:hover, .btn-ec-gold:focus {
    background: var(--ec-accent-hover);
    border-color: var(--ec-accent-hover);
    color: #fff;
}

.btn-ec-dark {
    background: var(--ec-dark);
    border-color: var(--ec-dark);
    color: #fff;
}

.btn-ec-dark:hover { background: #000; color: #fff; }

.btn-ec-outline-light {
    border: 2px solid rgba(255,255,255,0.8);
    color: #fff;
}

.btn-ec-outline-light:hover {
    background: #fff;
    color: var(--ec-dark);
}

/* Header */
.ec-header { position: relative; z-index: 1030; overflow: visible; }

.ec-navbar { overflow: visible; }

.ec-topbar {
    background: var(--ec-dark);
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    padding: 0.4rem 0;
}

.ec-topbar a { color: inherit; text-decoration: none; }
.ec-topbar a:hover { color: var(--ec-gold); }

.ec-header--inner {
    background: #fff;
    box-shadow: 0 2px 16px rgba(29, 70, 122, 0.08);
    border-bottom: 3px solid var(--ec-accent);
}

.ec-header--inner .ec-navbar .nav-link {
    color: var(--ec-navy) !important;
}

.ec-header--inner .ec-navbar .nav-link:hover,
.ec-header--inner .ec-navbar .nav-link.active {
    color: var(--ec-accent) !important;
}

.ec-header--inner .ec-brand {
    color: var(--ec-navy) !important;
}

.ec-header--inner .navbar-toggler {
    border-color: rgba(29, 70, 122, 0.25);
}

.ec-header--inner .navbar-toggler-icon {
    filter: none;
}

.ec-header--home {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(29, 70, 122, 0.92) 0%, rgba(29, 70, 122, 0.45) 70%, transparent 100%);
}

.ec-header--home .ec-topbar { background: transparent; }

.ec-navbar .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem !important;
}

.ec-navbar .nav-link:hover,
.ec-navbar .nav-link.active { color: var(--ec-gold) !important; }

.ec-header--inner .ec-navbar .nav-link:hover,
.ec-header--inner .ec-navbar .nav-link.active { color: var(--ec-accent) !important; }

.ec-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff !important;
    text-decoration: none;
}

.ec-brand__logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.ec-brand__logo {
    display: block;
    height: 48px;
    width: auto;
    max-width: 52px;
    object-fit: contain;
}

.ec-header--inner .ec-brand__logo-wrap {
    box-shadow: 0 2px 10px rgba(29, 70, 122, 0.12);
    border: 1px solid rgba(29, 70, 122, 0.1);
}

.ec-brand__text {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.ec-mega-menu {
    width: 100%;
    left: 0;
    right: 0;
    border: none;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    border-top: 3px solid var(--ec-gold);
    border-radius: 0 0 10px 10px;
}

.ec-mega-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.25rem 1rem 0.5rem;
}

.ec-mega-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem !important;
    border-radius: 4px;
    white-space: normal;
}

.ec-mega-link:hover { background: var(--ec-light); color: var(--ec-dark); }

@media (min-width: 992px) {
    .ec-navbar .dropdown-mega .dropdown-menu.ec-mega-menu {
        position: absolute;
        inset-inline: 0;
    }
}

@media (max-width: 991.98px) {
    .ec-header--home {
        position: relative;
        background: var(--ec-navy);
    }
    .ec-header--inner .ec-navbar .navbar-collapse {
        background: #fff;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 8px 24px rgba(29, 70, 122, 0.08);
    }
    .ec-header--home .ec-navbar .navbar-collapse {
        background: var(--ec-navy-deep);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    .dropdown-mega .dropdown-menu { min-width: 100%; }
}

/* Homepage hero */
.ec-hero {
    background: linear-gradient(rgba(29, 70, 122, 0.86), rgba(0, 140, 163, 0.78)),
                url('../img/5.jpg') center/cover no-repeat;
    min-height: 88vh;
    display: flex;
    align-items: center;
    color: #fff;
    padding-top: 120px;
}

.ec-hero__tag { color: var(--ec-gold); font-weight: 600; }

.ec-hero h1 {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

/* Sector cards */
.ec-sector-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
    border-left: 4px solid var(--ec-gold);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ec-sector-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.ec-sector-card i {
    font-size: 1.75rem;
    color: var(--ec-gold);
    display: block;
    margin-bottom: 0.5rem;
}

/* Dark band */
.ec-dark-band {
    background: var(--ec-dark);
    color: #fff;
}

/* Client logos */
.ec-client-grid img {
    height: 44px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.65;
    transition: all 0.3s;
}

.ec-client-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Inner pages — restyle existing Porto markup */
#header, #mybutton, .header-body { display: none !important; }

.main { padding-top: 0 !important; }

.page-header {
    background: linear-gradient(135deg, var(--ec-navy) 0%, var(--ec-accent) 100%) !important;
    border: none !important;
    padding: 2.5rem 0 !important;
    margin-bottom: 0 !important;
}

.page-header h1 {
    color: #fff !important;
    font-family: var(--ec-font-display) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: clamp(1.5rem, 4vw, 2.25rem) !important;
    margin: 0 !important;
}

.page-header .breadcrumb {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: flex-end;
    gap: 0;
}

.page-header .breadcrumb > li {
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}

.page-header .breadcrumb > li + li::before {
    content: "/";
    padding: 0 0.5rem;
    color: rgba(255,255,255,0.45);
}

.page-header .breadcrumb a,
.page-header .breadcrumb .active,
.page-header .breadcrumb > li.active {
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.85rem;
    text-decoration: none;
}

.page-header .breadcrumb a:hover { color: var(--ec-gold) !important; }

@media (max-width: 767.98px) {
    .page-header .breadcrumb {
        justify-content: flex-start;
        margin-top: 0.5rem !important;
    }
}

.section { padding: 2.5rem 0 !important; }

/* Content panels */
.heading h5,
.heading .bg-primary {
    background: var(--ec-dark) !important;
    color: #fff !important;
    font-family: var(--ec-font-display) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none !important;
    border-left: 4px solid var(--ec-gold) !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
}

/* Sidebars */
.ec-sidebar,
aside.sidebar:not(.ec-acc-panel) {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--ec-gold);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

aside.sidebar.ec-acc-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--ec-gold);
    overflow: visible;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    width: 100%;
}

.ec-sidebar__title,
aside.sidebar .heading h5 {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-top: none !important;
}

.ec-sidebar .nav-list,
aside.sidebar .nav-list {
    background: #fff !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    list-style: none;
}

.ec-sidebar .m-cat a,
aside.sidebar .m-cat a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--ec-text);
    text-decoration: none;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.15s;
}

.ec-sidebar .m-cat a:hover {
    color: var(--ec-accent);
    background: var(--ec-light);
    padding-left: 1.25rem;
}

/* Content area */
.col-sm-8 .pb-3.px-3,
.col-sm-8 > .pb-3 {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.col-sm-8 p.text-dark { color: var(--ec-text) !important; }

/* Legacy text utilities (ported from custom.css — site-wide) */
.m-text-justify {
    text-align: justify !important;
    text-justify: inter-word;
    hyphens: auto;
}

.m-text-center {
    text-align: center !important;
}

.m-letter-spacing {
    letter-spacing: 1px;
}

.m-pull-right {
    float: right;
}

/* Global inner-page body copy — justified paragraphs & lists */
.main .col-sm-8 {
    font-size: 0.97rem;
}

.main .col-sm-8 p.text-dark,
.main .col-sm-8 li.text-dark,
.main .col-sm-8 p:not(.m-text-center):not(.form-control),
.main .col-sm-8 li:not(.m-text-center):not(.nav-item) {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    line-height: 1.75;
    margin-bottom: 0.9rem;
}

.main .col-sm-8 p.text-dark:last-child,
.main .col-sm-8 li.text-dark:last-child {
    margin-bottom: 0;
}

.main .col-sm-8 strong {
    font-weight: 600;
    color: var(--ec-navy);
}

.main .col-sm-8 ul:not(.nav-list):not(.breadcrumb):not(.dropdown-menu),
.main .col-sm-8 ol {
    margin: 0 0 1.1rem;
    padding-left: 1.5rem;
}

.main .col-sm-8 ul:not(.nav-list):not(.breadcrumb) > li,
.main .col-sm-8 ol > li {
    margin-bottom: 0.55rem;
}

.main .col-sm-8 .heading h5,
.main .col-sm-8 .heading .bg-primary {
    text-align: left;
}

.main .col-sm-8 form label,
.main .col-sm-8 .btn,
.main .col-sm-8 .m-btn,
.main .col-sm-8 .badge,
.main .col-sm-8 table,
.main .col-sm-8 .ec-cert-table th {
    text-align: left;
}

.main .col-sm-8 .ec-cert-table__scope {
    text-align: justify;
}

/* Images inside page content */
.main img,
.col-sm-8 img,
.ec-content img {
    max-width: 100%;
    height: auto;
}

.main .img-fluid,
.col-sm-8 .img-fluid {
    display: block;
    width: 100%;
}

.ec-page-sidebar {
    width: 100%;
    min-width: 0;
}

.ec-page-sidebar > .ec-sidebar + .ec-sidebar,
.ec-page-sidebar > aside + aside {
    margin-top: 1rem;
}

/* Buttons legacy */
.m-btn, a .m-btn {
    display: inline-block;
    background: var(--ec-accent) !important;
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    font-family: var(--ec-font-display);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin: 0.25rem 0.25rem 0.25rem 0;
    transition: background 0.2s;
}

.m-btn:hover { background: var(--ec-accent-hover) !important; color: #fff !important; }

.m-pull-right.m-btn { float: right; }

/* Forms */
.form-control {
    border-radius: 6px;
    border-color: #cbd5e1;
    padding: 0.6rem 0.85rem;
}

.form-control:focus {
    border-color: var(--ec-accent);
    box-shadow: 0 0 0 0.2rem rgba(0, 140, 163, 0.22);
}

label.font-weight-bold, label.required { font-weight: 600 !important; color: var(--ec-dark); }

.btn-primary, .btn.btn-primary {
    background: var(--ec-accent) !important;
    border-color: var(--ec-accent) !important;
    color: #fff !important;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--ec-accent-hover) !important;
    border-color: var(--ec-accent-hover) !important;
    color: #fff !important;
}

.form-row { display: flex; flex-wrap: wrap; margin: 0 -0.5rem; }
.form-row > .form-group,
.form-row > [class*="col-"] { padding: 0 0.5rem; }

/* Tables */
.table { color: var(--ec-text); }
.table-bordered { border-color: #e2e8f0; }
.table td, .table th { border-color: #e2e8f0; }
.table tbody tr:nth-child(even) { background: #f8fafc; }

/* Certified client result table */
.ec-cert-table {
    width: 100%;
    margin-bottom: 0;
}

.ec-cert-table th,
.ec-cert-table td {
    padding: 0.85rem 1rem;
    vertical-align: top;
    border-color: #e2e8f0 !important;
    color: var(--ec-text);
}

.ec-cert-table th {
    width: 28%;
    font-weight: 600;
    color: var(--ec-navy);
    background: #f8fafc;
    white-space: nowrap;
}

.ec-cert-table td {
    background: #fff;
    line-height: 1.6;
}

.ec-cert-table__scope {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    line-height: 1.7;
    word-break: break-word;
}

.badge-success { background: #16a34a !important; }
.badge-danger { background: #dc2626 !important; }

/* Accreditation sidebar */
.section .row.justify-content-around > .col-sm-2:last-child {
    min-width: 0;
}

/* Footer */
.ec-footer {
    background: var(--ec-dark);
    color: rgba(255,255,255,0.8);
    margin-top: auto;
}

.ec-footer__logo-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    line-height: 0;
}

.ec-footer__logo {
    display: block;
    height: 64px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
}

.ec-footer__title {
    color: var(--ec-gold);
    font-family: var(--ec-font-display);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.ec-footer__links a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 2;
}

.ec-footer__links a:hover { color: var(--ec-gold); }

.ec-footer__text { color: rgba(255,255,255,0.55); }

.ec-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    margin-right: 0.5rem;
    text-decoration: none;
    transition: background 0.2s;
}

.ec-footer__social a:hover { background: var(--ec-accent); color: #fff; }

.ec-footer__bottom {
    background: rgba(0,0,0,0.25);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ec-footer__bottom a { color: rgba(255,255,255,0.7); text-decoration: none; }
.ec-footer__bottom a:hover { color: var(--ec-gold); }

/* Mobile CTA */
.ec-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: var(--ec-dark);
    display: flex;
    border-top: 2px solid var(--ec-accent);
}

.ec-mobile-cta__item {
    flex: 1;
    text-align: center;
    color: #fff;
    text-decoration: none;
    padding: 0.6rem 0.25rem;
    font-size: 0.7rem;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.ec-mobile-cta__item:last-child { border-right: none; }
.ec-mobile-cta__item i { display: block; font-size: 1.1rem; margin-bottom: 0.15rem; }
.ec-mobile-cta__item:hover { background: var(--ec-navy-deep); color: var(--ec-gold); }

/* Loading overlay */
#loading {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    position: fixed;
    display: none;
    opacity: 0.85;
    background: #fff;
    z-index: 10060;
    text-align: center;
}

#loading-image {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10061;
}

/* Hide old footer & mobile inquiry bar */
#footer + a .fixed,
footer#footer,
div.fixed.d-block { display: none !important; }

/* Layout wrapper */
.ec-site-wrap,
body > .body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ec-site-wrap .main,
body > .body > .main { flex: 1; }

/* List group on homepage */
.ec-iso-list .list-group-item {
    border-color: #e2e8f0;
    transition: all 0.15s;
}

.ec-iso-list .list-group-item:hover {
    background: var(--ec-light);
    border-left: 3px solid var(--ec-accent);
}

/* Owl override for any remaining carousels */
.owl-carousel .owl-item img { border-radius: 8px; }

/* Accreditation carousel in sidebar */
.ec-acc-carousel {
    position: relative;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem;
}

.ec-acc-carousel .carousel-inner {
    border-radius: 6px;
    overflow: hidden;
}

.ec-acc-carousel .ec-acc-img,
.ec-acc-panel img {
    border-radius: 8px;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    background: #fff;
}

.ec-acc-carousel__control {
    width: 2rem;
    height: 2rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 50%;
}

.ec-acc-carousel__control.carousel-control-prev { left: 0.35rem; }
.ec-acc-carousel__control.carousel-control-next { right: 0.35rem; }

/* Responsive columns — keep 3-col layout on inner pages */
@media (min-width: 576px) {
    .section .row.justify-content-around > .col-sm-2 {
        flex: 0 0 auto;
        width: 16.666667%;
    }

    .section .row.justify-content-around > .col-sm-8 {
        flex: 0 0 auto;
        width: 66.666667%;
    }
}

@media (max-width: 767.98px) {
    .col-sm-2, .col-sm-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
