/* ===================================================
    contact.css  —  Material-inspired dark theme
    Loaded on contact.html, sib_contact.html, sib_mcreg.html.
    =================================================== */

/* ── Top bar / header / nav — graded greys (evaluation only, easy to revert) */

/* Top bar — same dark as footer */
#top-bar {
    background-color: #333 !important;
    border-bottom-color: #444 !important;
}
#top-bar,
#top-bar a,
#top-bar .top-links > ul > li > a {
    color: #bbb !important;
}

/* Header / menu bar — one step lighter */
#header,
#header-wrap,
#header .menu-container {
    background-color: #484848 !important;
    border-bottom-color: #555 !important;
}

/* Top-level nav links */
#header .menu-item > a,
#primary-menu > ul > li > a {
    color: #ccc !important;
}

/* Top-level hover / active */
#primary-menu > ul > li:hover > a,
#primary-menu > ul > li.current > a,
#header .menu-item:hover > a {
    color: #fff !important;
}

/* Dropdown panel */
#primary-menu ul ul,
#primary-menu ul li .mega-menu-content {
    background-color: #3a3a3a !important;
    border-color: #4a4a4a !important;
    border-top: 2px solid #2B3389 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}

/* Dropdown links resting */
#primary-menu ul ul a {
    color: #bbb !important;
}

/* Dropdown links hover */
#primary-menu ul ul li:hover > a {
    background-color: #444 !important;
    color: #fff !important;
    padding-left: 18px;
}

/* Page title bar — lightest of the three */
#page-title {
    background: #606060 !important;
    border-bottom: 3px solid #c8973a;
}
#page-title h1 { color: #f0f0f0; }
#page-title span { color: #ccc; }
/* ────────────────────────────────────────────────────────────────────────── */

/* ── Page ──────────────────────────────────────────────────────────────────── */
#content {
    background: #1a1a1a;
    min-height: 60vh;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.cf2-card {
    max-width: 860px;
    margin: 40px auto 60px;
    background: #2d2d2d;
    border-radius: 6px;
    padding: 40px 48px 48px;
    box-shadow: 0 4px 24px rgba(0,0,0,.5);
}

.cf2-title {
    font-size: 26px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0 0 28px;
    letter-spacing: 0.3px;
}

/* ── Contact type select ────────────────────────────────────────────────────── */
.cf2-field-select .cf2-label {
    top: 2px;
    font-size: 11px;
    color: #7b8ce0;
}

select.cf2-input {
    padding-top: 22px;
    cursor: pointer;
    background-color: #252525;
    color: #e0e0e0;
}

/* ── Field rows ─────────────────────────────────────────────────────────────── */
.cf2-field {
    display: flex;
    align-items: flex-end;
    margin-bottom: 8px;
    padding-bottom: 4px;
}

#cf_service_other_row {
    margin-top: -2px;
}

.cf2-name-row {
    display: flex;
    gap: 16px;
}

.cf2-name-col {
    flex: 1;
    min-width: 0;
}

.cf2-field-textarea { align-items: flex-start; }

/* ── Leading icon ───────────────────────────────────────────────────────────── */
.cf2-icon {
    color: #a0a0a0;
    font-size: 22px;
    margin-right: 16px;
    flex-shrink: 0;
    padding-bottom: 6px;
    transition: color .2s;
}

.cf2-field-textarea .cf2-icon {
    padding-bottom: 0;
    margin-top: 28px;
}

.cf2-field.cf2-focused .cf2-icon { color: #7b8ce0; }

/* ── Input wrapper ──────────────────────────────────────────────────────────── */
.cf2-input-wrap {
    flex: 1;
    position: relative;
}

/* ── Inputs & textarea ──────────────────────────────────────────────────────── */
.cf2-input {
    width: 100%;
    background: #252525;
    border: none;
    border-bottom: 2px solid #3d3d3d;
    color: #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    padding: 22px 0 6px 0;
    outline: none;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
    border-radius: 0;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.cf2-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
}

.cf2-input:focus {
    border-bottom-color: #7b8ce0;
    background-color: #333333;
    box-shadow: 0 2px 0 0 rgba(123,140,224,.15);
}
.cf2-input.input-error { border-bottom-color: #e74c3c; }

/* Keep dark theme colors when browser autocomplete/autofill is applied */
.cf2-input:-webkit-autofill,
.cf2-input:-webkit-autofill:hover,
.cf2-input:-webkit-autofill:focus,
.cf2-textarea:-webkit-autofill,
.cf2-textarea:-webkit-autofill:hover,
.cf2-textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #e0e0e0 !important;
    caret-color: #e0e0e0 !important;
    background-color: #252525 !important;
    -webkit-box-shadow: 0 0 0 1000px #252525 inset !important;
    box-shadow: 0 0 0 1000px #252525 inset !important;
    border-bottom: 2px solid #3d3d3d !important;
    transition: background-color 9999s ease-out 0s;
}

.cf2-input:-webkit-autofill:focus,
.cf2-textarea:-webkit-autofill:focus {
    background-color: #333333 !important;
    -webkit-box-shadow: 0 0 0 1000px #333333 inset !important;
    box-shadow: 0 0 0 1000px #333333 inset !important;
    border-bottom-color: #7b8ce0 !important;
}

.cf2-input:-moz-autofill,
.cf2-textarea:-moz-autofill {
    -moz-text-fill-color: #e0e0e0;
    box-shadow: 0 0 0 1000px #252525 inset;
    border-bottom: 2px solid #3d3d3d;
}

.cf2-input:autofill,
.cf2-textarea:autofill {
    -webkit-text-fill-color: #e0e0e0;
    box-shadow: 0 0 0 1000px #252525 inset;
}

/* ── Floating label ─────────────────────────────────────────────────────────── */
.cf2-label {
    position: absolute;
    top: 22px;
    left: 0;
    color: #a0a0a0;
    font-size: 15px;
    font-weight: 400;
    pointer-events: none;
    white-space: nowrap;
    transition: top .18s ease, font-size .18s ease, color .18s ease;
}

.cf2-input:focus + .cf2-label,
.cf2-input:not(:placeholder-shown) + .cf2-label {
    top: 2px;
    font-size: 11px;
    color: #7b8ce0;
}

.cf2-field.cf2-has-error .cf2-label { color: #e74c3c; }

.cf2-hint {
    color: #a0a0a0;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
}

.cf2-required { color: #e74c3c; font-size: 14px; }

/* ── Per-field error messages ───────────────────────────────────────────────── */
.cf2-field-error {
    display: none;
    color: #e07070;
    font-size: 11px;
    margin-top: 3px;
    line-height: 1.3;
}

.cf2-field-error.visible { display: block; }

/* ── reCAPTCHA wrapper ────────────────────────────────────────────────────────── */
.cf2-recaptcha-wrap {
    margin: 28px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Force dark appearance on the reCAPTCHA iframe regardless of site-key state.
   data-theme="dark" handles it once a real key is in place; this filter is a
   reliable fallback that works even during development with the placeholder. */
.cf2-recaptcha-wrap iframe {
    filter: invert(1) hue-rotate(180deg);
    border-radius: 4px;
}
/* Re-invert logos/checkmark images so they look correct after the flip */
.cf2-recaptcha-wrap iframe img {
    filter: invert(1) hue-rotate(180deg);
}

/* ── Submit row ─────────────────────────────────────────────────────────────── */
.cf2-submit-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin-top: 36px;
}

.cf2-btn-send {
    background: #001689;
    color: #fff;
    border: none;
    padding: 11px 32px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .2s, box-shadow .2s, transform .2s;
    box-shadow: 0 4px 12px rgba(0,22,137,.3);
}

.cf2-btn-send .material-icons { font-size: 18px; }

.cf2-btn-send:hover:not(:disabled) {
    background: #0a2fb8;
    box-shadow: 0 4px 14px rgba(0,22,137,.4);
    transform: translateY(-1px);
}

.cf2-btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Draft status ───────────────────────────────────────────────────────────── */
#draft-status {
    font-size: 12px;
    font-style: italic;
    opacity: 0;
    transition: opacity .4s;
}

#draft-status.visible { opacity: 1; }
#draft-status.saved    { color: #5cb85c; }
#draft-status.restored { color: #7b8ce0; }

/* ── Result banner ──────────────────────────────────────────────────────────── */
#contact-result {
    margin-top: 24px;
    display: none;
    padding: 14px 18px;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.5;
}

#contact-result.success {
    background: #1a3a1a;
    border: 1px solid #3a7a3a;
    color: #7dc87d;
}

#contact-result.error {
    background: #3a1a1a;
    border: 1px solid #7a3a3a;
    color: #e07070;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .cf2-card {
        padding: 28px 20px 36px;
        border-radius: 0;
        box-shadow: none;
        margin: 0 0 40px;
    }

    .cf2-name-row {
        display: block;
    }

    .cf2-name-col {
        width: 100%;
    }

    .cf2-icon { font-size: 20px; margin-right: 12px; }

@media (max-width: 991px) {
    #content .content-wrap > .container {
        width: 100% !important;
        max-width: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #content .cf2-card {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}
}

/* ── Social icon hover fix ──────────────────────────────────────────────────── */
#top-social li a,
#top-social li a:focus,
#top-social li a:active,
#top-social li a:hover {
    outline: none !important;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

#top-social li a div,
#top-social li a div:focus,
#top-social li a div:active,
#top-social li a div:hover {
    outline: none !important;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ── Result modal (success / failure dialog after submit) ──────────────── */
.cf2-result-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 16px;
    box-sizing: border-box;
}
.cf2-result-backdrop[hidden] { display: none !important; }

.cf2-result-card {
    width: min(560px, 100%);
    max-width: 560px;
    padding: 28px 32px 24px;
    border-radius: 10px;
    border: 2px solid #2fcb74;
    background: rgba(16, 26, 21, 0.98);
    color: #bfffd9;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    font-weight: 600;
    line-height: 1.5;
}
.cf2-result-backdrop.error .cf2-result-card {
    border-color: #d64242;
    background: rgba(40, 18, 18, 0.98);
    color: #ffc6c6;
}

.cf2-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(47, 203, 116, 0.18);
    color: #6ee29c;
    font-size: 32px;
}
.cf2-result-backdrop.error .cf2-result-icon {
    background: rgba(214, 66, 66, 0.18);
    color: #ff8484;
}

.cf2-result-title {
    margin: 0 0 10px;
    font-size: 22px;
    letter-spacing: 0.3px;
}

.cf2-result-text {
    margin: 0 0 22px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0.9;
}

.cf2-result-close {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
    padding: 9px 32px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 13px;
    transition: background-color .15s, color .15s;
}
/* Hover: fill button with the card's accent color, flip text for contrast.
   Avoid `background: currentColor` — within a single rule, currentColor
   resolves to the rule's own new color value, so the button vanishes. */
.cf2-result-close:hover {
    background: #2fcb74;
    border-color: #2fcb74;
    color: #0a0a0a;
}
.cf2-result-backdrop.error .cf2-result-close:hover {
    background: #d64242;
    border-color: #d64242;
    color: #ffffff;
}

/* Light theme — flip backgrounds + adjust contrast */
[data-theme="light"] .cf2-result-backdrop {
    background: rgba(50, 50, 50, 0.45);
}
[data-theme="light"] .cf2-result-card {
    background: #ffffff;
    border-color: #16a34a;
    color: #065f46;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .cf2-result-backdrop.error .cf2-result-card {
    background: #ffffff;
    border-color: #dc2626;
    color: #991b1b;
}
[data-theme="light"] .cf2-result-icon {
    background: rgba(22, 163, 74, 0.14);
    color: #16a34a;
}
[data-theme="light"] .cf2-result-backdrop.error .cf2-result-icon {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}
[data-theme="light"] .cf2-result-close:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}
[data-theme="light"] .cf2-result-backdrop.error .cf2-result-close:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

/* ── Submit overlay (fullscreen blurred backdrop with spinner during AJAX) ── */
.cf2-submit-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, 0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.cf2-submit-overlay[hidden] { display: none !important; }

.cf2-submit-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 18px 22px;
    border-radius: 10px;
    background: rgba(34, 34, 34, 0.92);
    border: 1px solid #4a4a4a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.cf2-submit-overlay-image {
    width: 144px;
    height: 144px;
}

.cf2-submit-overlay-text {
    margin: 0;
    color: #e8ebff;
    font-size: 0.98em;
}

/* Light theme — flip the colors so the card reads on white */
[data-theme="light"] .cf2-submit-overlay {
    background: rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .cf2-submit-overlay-card {
    background: #ffffff;
    border: 1px solid #d8dce3;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .cf2-submit-overlay-text {
    color: #2a2a2a;
}

