/* =====================================================================
   Contact enquiry form – additions only (existing design untouched)
   Link AFTER style.css and theme-css.css
   ===================================================================== */

/* ---- Field errors ---- */
.contact-form-box .field-error {
    display: block;
    color: #b00020;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    margin: -8px 0 10px;
}
.contact-form-box .field-error:empty {
    display: none;
}
.contact-form-box .form-group.has-error input,
.contact-form-box .form-group.has-error select,
.contact-form-box .form-group.has-error textarea {
    border-color: #d93025 !important;
}

.contact-form-box .form-group textarea {
   color: #4a4e56 !important;
}

/* ---- Message box: show helper text only after click, hide when typing ---- */
.contact-form-box textarea#message::placeholder {
    color: #8a8a8a;
    opacity: 0;
    transition: opacity .2s ease;
}
.contact-form-box textarea#message:focus::placeholder {
    opacity: 1;
}
.contact-form-box textarea#message:focus + label,
.contact-form-box textarea#message:not(:placeholder-shown) + label {
    opacity: 0;
    visibility: hidden;
}
.contact-form-box .msg-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #5a4a1a;
    margin: -10px 0 8px;
}

/* ---- Searchable country dropdown ---- */
.contact-form-box .country-select {
    position: relative;
    z-index: 5;
    overflow: visible !important;
}
.country-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 4px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e0b25a;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    max-height: 260px;
    overflow-y: auto;
    z-index: 50;
    text-align: left;
}
.country-list.open {
    display: block;
}
.country-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    font-size: 14px;
    color: #222;
    cursor: pointer;
}
.country-list li .dial {
    color: #777;
    white-space: nowrap;
}
.country-list li:hover,
.country-list li.active {
    background: #fff3df;
}
.country-list li.empty {
    cursor: default;
    color: #888;
}

/* ---- Math CAPTCHA ---- */
.math-captcha {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e0b25a;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 4px auto 0;
}
.math-captcha .captcha-q {
    margin: 0;
    min-width: 90px;
    font-size: 17px;
    font-weight: 700;
    color: #222;
    letter-spacing: .5px;
    text-align: center;
    white-space: nowrap;
    user-select: none;
}
.math-captcha input {
    width: 80px;
    height: 38px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 15px;
    text-align: center;
}
.math-captcha input:focus {
    outline: 2px solid #fd9a51;
    border-color: #fd9a51;
}
.math-captcha .captcha-refresh {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 4px;
    background: #f3f3f3;
    color: #333;
    cursor: pointer;
}
.math-captcha .captcha-refresh:hover,
.math-captcha .captcha-refresh:focus {
    background: #e6e6e6;
}
.contact-form-box .captcha-error {
    text-align: center;
    margin: 6px 0 0;
}

/* ---- Submit button ---- */
.contact-form-box .submit-btn {
    background: #2A2A2A !important;
    border-color: #2A2A2A !important;
    color: #fff !important;
}
.contact-form-box .submit-btn:hover {
    background: #000 !important;
}
.contact-form-box .submit-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

/* ---- Status message ---- */
.form-status {
    display: none;
    max-width: 560px;
    margin: 10px auto 0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}
.form-status.success {
    display: block;
    background: #e7f6ec;
    color: #1e7b3a;
    border: 1px solid #9fd8b1;
}
.form-status.error {
    display: block;
    background: #fdecea;
    color: #b00020;
    border: 1px solid #f5b5ae;
}

/* ---- Helpers ---- */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.cf-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .math-captcha {
        flex-wrap: wrap;
        justify-content: center;
    }
    .country-list {
        max-height: 220px;
    }
}

/* =====================================================================
   FIXES – v2 (counter visibility, CAPTCHA alignment, button gap, dropdown)
   ===================================================================== */

/* 0 / 4000 counter: sit clearly below the message box */
.contact-form-box .msg-count {
    position: relative;
    z-index: 2;
    margin: 4px 0 8px !important;
    line-height: 1.2;
}

/* field errors never hide under the inputs */
.contact-form-box .field-error {
    position: relative;
    z-index: 2;
}

/* CAPTCHA: question, answer box and refresh button on one centred line */
.math-captcha {
    align-items: center !important;
    gap: 10px;
    padding: 8px 12px !important;
}
.math-captcha > *,
.math-captcha .captcha-q,
.math-captcha input#captcha_answer,
.math-captcha .captcha-refresh {
    margin: 0 !important;
    vertical-align: middle;
}
.math-captcha .captcha-q {
    display: flex !important;
    align-items: center;
    height: 40px;
    padding: 0 !important;
    line-height: 1 !important;
}
.math-captcha input#captcha_answer {
    display: block;
    width: 90px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    line-height: 40px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 15px !important;
    text-align: center;
    background: #fff;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}
.math-captcha input#captcha_answer::placeholder {
    font-family: inherit;
    color: #999;
}
.math-captcha .captcha-refresh {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* gap between CAPTCHA and Send Enquiry */
.contact-form-box #enquirySubmit {
    margin-top: 18px !important;
}

/* country dropdown: class-based show/hide */
.country-list li.cf-hide {
    display: none !important;
}

/* =====================================================================
   v3 – Country as a select (read-only box + search inside the dropdown)
   ===================================================================== */

/* dropdown sits above every other field and icon */
.contact-form-box .country-select {
    z-index: 1000 !important;
}
.contact-form-box .form-group:not(.country-select) > i {
    z-index: 2 !important;
}

/* read-only box looks and behaves like a select */
.contact-form-box #cf_ctry_lookup {
    cursor: pointer;
    caret-color: transparent;
    padding-right: 36px !important;
    background-color: #fff !important;
    user-select: none;
}
.contact-form-box .ctry-caret {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -2px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #777;
    pointer-events: none;
    z-index: 3;
    transition: transform .2s ease;
}
.contact-form-box .country-select #cf_ctry_lookup[aria-expanded="true"] ~ .ctry-caret {
    transform: rotate(180deg);
}

/* dropdown panel */
.contact-form-box .country-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0b25a;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    z-index: 1001;
    text-align: left;
}
.contact-form-box .country-panel.open {
    display: block;
}

/* search box inside the dropdown – reset the theme's form-input styles */
.contact-form-box .country-panel input.country-filter {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 0 6px !important;
    padding: 0 10px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 38px !important;
    color: #222 !important;
    background: #fafafa !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
.contact-form-box .country-panel input.country-filter:focus {
    outline: none;
    border-color: #fd9a51 !important;
    background: #fff !important;
}

/* list inside the panel (overrides the older absolute-list styles) */
.contact-form-box .country-panel .country-list {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    max-height: 230px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .contact-form-box .country-panel .country-list {
        max-height: 200px;
    }
}


/* ===== Be In Touch. Be Insight Driven. ===== */
.be-in-touch-section {
    background: #ffffff;
    padding: 50px 0 70px;
}
.be-in-touch-card {
    max-width: 900px;
    margin: 0 auto;
    background: #2a2a2a;
    border-radius: 18px;
    padding: 50px 30px 16px;
    text-align: center;
}
.be-in-touch-card .bit-title {
    margin: 0 0 30px;
    font-size: 50px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.be-in-touch-card .bit-line1,
.be-in-touch-card .bit-line2 {
    display: block;
}
.be-in-touch-card .bit-line1 {
    color: #ffffff;
}
/* yellow -> orange gradient text */
.be-in-touch-card .bit-line2 {
    background: linear-gradient(90deg, #f7d55a 0%, #fd9a51 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fd9a51; /* fallback */
}
.be-in-touch-card .bit-tagline {
    margin: 0;
    color: #9a9a9a;
    font-size: 12px;
    line-height: 1;
}

@media (max-width: 991px) {
    .be-in-touch-card .bit-title {
        font-size: 42px;
    }
}
@media (max-width: 768px) {
    .be-in-touch-section {
        padding: 30px 0 40px;
    }
    .be-in-touch-card {
        border-radius: 14px;
        padding: 34px 18px 20px;
    }
    .be-in-touch-card .bit-title {
        font-size: 30px;
        margin-bottom: 20px;
    }
    .be-in-touch-card .bit-tagline {
        font-size: 12px;
    }
}

/* =====================================================================
   v4 – "Thank You" popup after a successful enquiry
   ===================================================================== */
.cf-ty-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.cf-ty-overlay.open {
    opacity: 1;
    visibility: visible;
}
.cf-ty-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 8px;
    padding: 30px 28px 28px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    transform: translateY(14px) scale(.97);
    transition: transform .25s ease;
    outline: none;
}
.cf-ty-overlay.open .cf-ty-box {
    transform: translateY(0) scale(1);
}
.cf-ty-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #2cbb4d;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cf-ty-title {
    margin: 0 0 18px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: #111;
}
.cf-ty-text {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.5;
    color: #777;
}
.cf-ty-ok {
    min-width: 64px;
    padding: 8px 18px;
    border: 0;
    border-radius: 2px;
    background: #2A2A2A;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.cf-ty-ok:hover,
.cf-ty-ok:focus {
    background: #000;
    outline: 2px solid #fd9a51;
    outline-offset: 2px;
}
body.cf-ty-lock {
    overflow: hidden;
}
@media (max-width: 480px) {
    .cf-ty-box { padding: 24px 18px 22px; }
    .cf-ty-title { font-size: 26px; }
    .cf-ty-text { font-size: 14px; }
}
/* =====================================================================
   v5 – Regional offices (Americas / EMEA / Asia Pacific)
   Desktop look (replaces the old inline styles)
   ===================================================================== */
.contact-section .region-map {
    max-width: 37% !important;
    height: auto;
}
.contact-section .region-title {
    padding-top: 20px;
    padding-bottom: 20px;
    margin: 0;
    font-weight: 800 !important;
}
.contact-section .region-line {
    margin-bottom: 3px;
}
.contact-section .region-line + .region-line {
    margin-bottom: 1rem;
}
/* black text, not the theme's blue link colour */
.contact-section .region-line a,
.contact-section .region-line a:visited,
.contact-section .region-line a:hover,
.contact-section .region-line a:focus {
    color: #000 !important;
    font-weight: 400;
    text-decoration: none;
}
.contact-section .region-icon {
    width: 20px !important;
    max-width: 20px !important;
    height: auto;
    vertical-align: middle;
}
@media (max-width: 767px) {
    .contact-section .region-card {
        display: flex;
        align-items: center;
        gap: 10px;
        text-align: left !important;
        padding: 16px 0;
    }
    /* smaller map on the left */
    .contact-section .region-map {
        flex: 0 0 27%;
        width: 27%;
        max-width: 27% !important;
        height: auto;
    }
    .contact-section .region-info {
        flex: 1 1 auto;
        min-width: 0;
    }
    .contact-section .region-title {
        text-align: left !important;
        font-size: 19px !important;
        line-height: 1.2 !important;
        padding: 0 0 10px !important;
        margin: 0 !important;
    }
    /* phone + email: small, left aligned, one line each */
    .contact-section .region-line,
    .contact-section .region-line + .region-line {
        margin: 0 0 6px !important;
        padding: 0 !important;
        text-align: left !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    .contact-section .region-line a {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px !important;
        line-height: 1.4 !important;
        white-space: nowrap;
    }
    .contact-section .region-icon {
        flex: 0 0 14px;
        width: 14px;
        max-width: 14px !important;
    }
    .contact-section .region-toll {
        font-style: italic;
    }
    /* email is the longest line – a touch smaller so it never wraps */
    .contact-section .region-line a[href^="mailto:"] {
        font-size: 11.5px !important;
        gap: 6px;
    }
}

/* very small phones */
@media (max-width: 360px) {
    .contact-section .region-map { flex-basis: 25%; width: 25%; max-width: 25% !important; }
    .contact-section .region-line,
    .contact-section .region-line a { font-size: 11px !important; }
    .contact-section .region-line a[href^="mailto:"] { font-size: 10.5px !important; }
    .contact-section .region-title { font-size: 17px !important; }
}

/* =====================================================================
   v6 – Enquiry form on mobile / tablet
   - box stays inside the screen (no side overflow)
   - "Connect With Our Market Research Team" + image ABOVE the form,
     heading left, image right
   Desktop (992px and up) is unchanged
   ===================================================================== */
@media (max-width: 991px) {
    .contact-wrapper .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .contact-wrapper .cf-gradient {
        padding: 20px 14px 22px !important;
    }
    .contact-wrapper .contact-form-box {
        padding: 0 !important;
    }
    /* stop Bootstrap's -15px row margins pushing the box off screen */
    .contact-wrapper .contact-form-box > .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .contact-wrapper .cf-form-col,
    .contact-wrapper .cf-side {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* same for the field rows inside the form */
    .contact-wrapper .cf-form-col .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .contact-wrapper .cf-form-col [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* heading + image first */
    .contact-wrapper .cf-side {
        order: -1;
        margin-bottom: 18px;
    }
    .contact-wrapper .cf-side .contact-info-box {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        text-align: center;
    }
    .contact-wrapper .cf-side .contact-info-box h2 {
        flex: 1 1 55%;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 22px !important;
        line-height: 1.25 !important;
        text-align: center !important;
    }
    .contact-wrapper .cf-side .contact-info-box img {
        flex: 0 0 43%;
        width: 43% !important;
        max-width: 43% !important;
        height: auto !important;
        margin: 0 !important;
        position: static !important;
    }

    /* CAPTCHA box never wider than the screen */
    .contact-wrapper .math-captcha {
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .contact-wrapper .cf-side .contact-info-box h2 {
        font-size: 19px !important;
    }
    .contact-wrapper .cf-gradient {
        padding: 18px 10px 20px !important;
    }
}

/* Mobile: message icon panel sits INSIDE the box border, like the other fields */
@media (max-width: 767px) {
    .contact-form-box .textarea-group {
        position: relative;
    }
    .contact-form-box .textarea-group > i {
        top: 2px !important;
        bottom: 2px !important;
        left: 2px !important;
        height: auto !important;
        min-height: 0 !important;
        line-height: normal !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 5px 0 0 5px;
        box-sizing: border-box !important;
    }
}

/* =====================================================================
   v7 – "Leading Global Brands" logos on mobile
   ===================================================================== */
@media (max-width: 767px) {
    /* heading: smaller, two neat lines */
    .service-section h2 {
        font-size: 22px !important;
        line-height: 1.4 !important;
        padding-bottom: 18px !important;
        margin: 0 !important;
    }

    /* 3 logos per row, each centred in an equal-height cell */
    .service-section .contactpageicon {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 58px;
        padding: 8px 14px !important;
    }
    .service-section .contactpageicon img {
        width: auto !important;
        max-width: 100% !important;
        max-height: 30px !important;
        height: auto !important;
        object-fit: contain;
    }
}

/* =====================================================================
   v8 – Uniform visual gap between sections
   Desktop: 80px   |   Mobile (≤767px): 53px
   The gap is the empty space between the visible bottom of one section
   and the visible top of the next. Spacing INSIDE sections is unchanged.
   ===================================================================== */
:root {
    --pmi-section-gap: 80px;
}
@media (max-width: 767px) {
    :root {
        --pmi-section-gap: 53px;
    }
}

/* 1. switch off the old spacer divs between sections */
.contact-section > .pd_top_90,
.contact-section > .pd_top_70,
.contact-wrapper > .pd_top_30,
.service-section > .pd_top_20,
.service-section > .pd_bottom_60 {
    display: none !important;
}

/* 2. sections have no outer margin / padding of their own
      (corp-hq keeps its padding – it is inside its dark background) */
.rd_page > .contact-section,
.rd_page > .contact-wrapper,
.rd_page > .service-section,
.rd_page > .inquiry-section,
.rd_page > .be-in-touch-section {
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.rd_page > .corp-hq-section {
    margin-bottom: 0 !important;
}

/* 3. one gap rule: hero -> first section, and between every two sections */
body .rd_page > .page_header_default + section,
body .rd_page > section + section {
    margin-top: var(--pmi-section-gap) !important;
}
/* last section -> footer */
body .rd_page > .be-in-touch-section {
    margin-bottom: var(--pmi-section-gap) !important;
}

/* 4. remove invisible space at the very top / bottom of section content,
      so the visible content touches the section edge */
.contact-section .region-card .region-line:last-child,
.contact-section .region-line + .region-line {
    margin-bottom: 0 !important;
}
.service-section .col-lg-12 > h2 {
    margin-top: 0 !important;
}
.inquiry-section .inquiry-box p:last-child {
    margin-bottom: 0;
}
.be-in-touch-section .container > .be-in-touch-card {
    margin-top: 0;
    margin-bottom: 0;
}

@media (max-width: 767px) {
    /* region cards: no blank padding above the first / below the last */
    .contact-section .region-card:first-child { padding-top: 0 !important; }
    .contact-section .region-card:last-child  { padding-bottom: 0 !important; }

    /* logos: last row cell has ~14px blank under the logo – pull it in */
    .service-section .row.align-items-center {
        margin-bottom: -14px;
    }
}