/* Contact & Modals from style.css */

/* Modal: success dialog styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

    .modal-overlay.active {
        display: flex;
    }

.modal-card {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 36px 40px;
    position: relative;
    text-align: center;
}

.modal-close-icon {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    color: #111;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px
}

.modal-success-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px auto;
    border-radius: 50%;
    background: #58d22e;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(88,210,46,0.18)
}

    .modal-success-icon svg {
        width: 44px;
        height: 44px;
        color: #fff
    }

.modal-title {
    font-size: 28px;
    font-weight: 700;
    margin: 6px 0 8px 0;
    color: #111
}

.modal-text {
    color: #6b6b6b;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 22px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 6px
}
/* Keep modal buttons scoped so site-wide .btn isn't overridden */
.modal-card .btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    color: #111;
    cursor: pointer;
    font-size: 14px
}

    .modal-card .btn.btn-primary {
        background: transparent;
        border: 1.5px solid rgba(0,0,0,0.12)
    }

@media (max-width:480px) {
    .modal-card {
        padding: 20px
    }

    .modal-success-icon {
        width: 64px;
        height: 64px
    }

    .modal-title {
        font-size: 22px
    }

    .modal-text {
        font-size: 14px
    }
}

/* Contact (redesigned) */
.contact {
    padding: 120px 0 80px;
}

.contact-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    max-width: 1220px;
}

    /* Responsive margin limits for .contact-container when using utility class 'max' */
    /* Ensure left/right margins never push the container wider than the viewport */
    /* .contact-container.max {
        margin-left: clamp(16px, calc((100vw - 1180px) / 2), 350px);
        margin-right: clamp(16px, calc((100vw - 1180px) / 2), 250px);
    } */

.contact-left {
    width: 640px;
}

.contact-right {
    width: 740px;
    height: 480px;
    text-align: center;
    margin-top: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
    /* Allow contact image to shrink responsively using clamp */
    .contact-right img {
        width: clamp(300px, 40vw, 740px);
        height: auto;
        max-height: 480px;
        object-fit: cover;
        display: block;
    }
/* Decorative image holder used at mid-breakpoints to place the illustration behind the form */
.contact-image-box {
    display: none; /* hidden by default */
}

.contact [role="heading"][aria-level="2"] {
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 48px;
    text-align: left;
}

/* Form layout */
.contact form {
    margin: 0;
}

.form-rows {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row.two-col {
    display: flex;
    gap: 16px;
}

    .form-row.two-col > * {
        flex: 1;
    }

.form-row textarea {
    height: 140px;
    width: 640px;
}

/* Desktop: force first three rows to specific input sizes */
@media (min-width:1280px) {
    /* Target the first three form rows inside the contact form */
    .contact .form-rows > .form-row:nth-child(1) .field-group,
    .contact .form-rows > .form-row:nth-child(2) .field-group,
    .contact .form-rows > .form-row:nth-child(3) .field-group {
        width: 292px;
        flex: 0 0 292px;
        height: 52px;
    }

    .contact .form-rows > .form-row:nth-child(1) .composite-field-wrapper {
        height: 52px;
    }

    .contact .form-rows > .form-row:nth-child(1) .field-group input,
    .contact .form-rows > .form-row:nth-child(2) .field-group input,
    .contact .form-rows > .form-row:nth-child(3) .field-group input,
    .contact .form-rows > .form-row:nth-child(1) .field-group select,
    .contact .form-rows > .form-row:nth-child(2) .field-group select,
    .contact .form-rows > .form-row:nth-child(3) .field-group select {
        height: 51px;
        line-height: 51px;
    }
}

.contact .form-rows > .form-row:nth-child(1) .field-group select {
    border-radius: 0;
}
/* Base field styles */
.field-group {
    position: relative;
}

    .field-group input,
    .field-group select,
    .field-group textarea {
        width: 100%;
        height: 52px;
        padding: 0 16px;
        border: 1px solid #999999;
        border-radius: 8px;
        background: #fff;
        font-size: 14px;
        font-family: inherit;
        outline: none;
        transition: border-color .2s ease;
    }

    .field-group textarea {
        padding: 12px 16px;
        resize: vertical;
        height: 120px;
    }

        .field-group input:focus,
        .field-group select:focus,
        .field-group textarea:focus {
            border-color: #27201F;
        }

    .field-group select {
        appearance: none;
        background-image: url("/Style%20Library/OLL/img/chevron-down.svg") !important;
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 36px 24px;
        padding-right: 56px;
    }
    /* Ensure select arrows are present for select-wrap and composite selects */
    .select-wrap select,
    .field-group.composite select {
        appearance: none;
        background-image: url("/Style%20Library/OLL/img/chevron-down.svg") !important;
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 36px 24px;
        padding-right: 56px;
    }
    /* For the small title select inside composite, center the arrow visually */
    .field-group.composite select {
        background-position: center right 20px;
        background-size: 30px 18px;
        padding-right: 56px;
    }

        /* Make the specific #title select have a white background to match design */
        .field-group.composite select#title {
            background-color: #ffffff;
            background: #ffffff;
        }

    /* Composite Title + Name */
    .field-group.composite {
        display: flex;
        height: 52px;
        border: 1px solid transparent;
        border-radius: 8px;
        overflow: visible;
    }

        .field-group.composite select {
            flex: 0 0 92px;
            border: none;
            border-right: 1px solid #999999;
            background: #F9F9F9;
            padding: 0 12px;
            border-radius: 8px 0 0 8px;
        }

        .field-group.composite input {
            flex: 1;
            border: none;
            padding: 0 16px;
            border-radius: 0 8px 8px 0;
        }

    /* ::before draws border ON TOP so select background can never cover it */
    .field-group.composite::before {
        content: '';
        position: absolute;
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
        border: 1px solid #999999;
        border-radius: 8px;
        pointer-events: none;
        z-index: 2;
    }

        .field-group.composite:focus-within::before {
            border-color: #27201F;
        }

/* Composite: label floats to border */
.field-group.composite .floating-wrap input:focus + .floating-placeholder,
.field-group.composite .floating-wrap input.filled + .floating-placeholder {
    top: 0;
    transform: translateY(-50%);
    font-size: 12px;
    color: #27201F;
    background: #fff;
    padding: 0 4px;
}

/* .floating-wrap / .floating-placeholder moved to style.css (shared across all pages) */

/* select wrapper adjustments to keep arrow visible */
/* wrapper selects should not have a background image — we use the wrapper pseudo-element instead */
.select-wrap select {
    padding-right: 56px;
    -webkit-appearance: none;
    appearance: none;
    color: #999999;
    font-size: 16px;
    height: 48px;
    line-height: 48px;
    padding-left: 16px;
    background-image: none !important;
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 36px 24px;
    background-color: transparent;
}
    /* When a select has the empty placeholder option (value="") it is :invalid and should look like placeholder */
    .select-wrap select:invalid {
        color: #999999;
    }

    .select-wrap select:not(:invalid) {
        color: #27201F;
    }
/* Position label left so it visually matches text inputs */
.select-wrap .floating-placeholder {
    left: 16px;
    right: auto;
    transform: translateY(-50%);
    z-index: 2;
}
/* make select text sit above the select native arrow area and ensure label doesn't get clipped */
.select-wrap select {
    position: relative;
    z-index: 1;
}

/* Add a guaranteed arrow using a pseudo-element on the wrapper so it can rotate when opened */
.select-wrap {
    position: relative;
}

    .select-wrap::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 8px;
        /* make pseudo-element match the background-image size so SVG isn't clipped */
        width: 24px;
        height: 16px;
        transform: translateY(-50%) rotate(0deg) translateX(0);
        pointer-events: none;
        background-image: url("/Style%20Library/OLL/img/chevron-down.svg") !important;
        background-repeat: no-repeat;
        background-size: 24px 16px;
        z-index: 3;
        transition: transform .18s ease;
        transform-origin: center;
        backface-visibility: hidden;
    }
    /* When wrapper has .open (we toggle via JS), rotate arrow up */
    .select-wrap.open::after {
        transform: translateY(-50%) rotate(180deg);
    }
/* Composite wrapper arrow (for title + name small select) */
.field-group.composite {
    position: relative;
}

    .field-group.composite::after {
        content: '';
        position: absolute;
        top: 50%;
        /* position inside the fixed-width select area (select flex-basis:92px) */
        left: 60px;
        width: 30px;
        height: 18px;
        transform: translateY(-50%) rotate(0deg) translateX(0);
        pointer-events: none;
        background-image: url("/Style%20Library/OLL/img/chevron-down.svg") !important;
        background-repeat: no-repeat;
        background-size: 30px 18px;
        z-index: 3;
        transition: transform .18s ease;
        transform-origin: center;
        backface-visibility: hidden;
    }

    .field-group.composite.open::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .field-group.composite.open select {
        background-image: none !important;
    }
    /* Increase padding to account for larger arrows */
    .select-wrap select, .field-group.composite select {
        padding-right: 40px;
    }
    /* Ensure selects inside our wrappers never show their own background image (prevents tiled arrows) */
    .select-wrap select, .field-group.composite select {
        background-image: none !important;
    }

/* Custom Select Implementation */
.select-wrap.custom-active select {
    display: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #999999;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    color: #27201F;
    cursor: pointer;
    user-select: none;
}

    .custom-select-trigger.placeholder {
        color: transparent; 
        color: transparent;
    }

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #999999;
    border-radius: 8px;
    margin-top: 4px;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
}

.select-wrap.open .custom-options {
    display: block;
}

.custom-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 16px;
    color: #27201F;
    transition: background 0.2s;
}

    .custom-option:hover {
        background: #f5f5f5;
    }

    .custom-option.selected {
        background: #f0f0f0;
        font-weight: 600;
        color: #DA291C;
    }

/* Hide native dropdown arrow in IE/Edge */
select::-ms-expand {
    display: none;
}

/* Ensure composite layout keeps floating label visually inside input area */
.field-group.composite .floating-wrap {
    flex: 1;
}

/* Radio row */
.radio-row {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 14px;
    flex-wrap: wrap;
    position: relative;
}

    .radio-row .field-error {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        margin-top: 4px;
    }

.radio-label {
    flex: 0 0 auto;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}

.radio-options {
    display: flex;
    gap: 32px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0%;
    cursor: pointer;
}

    .radio-item input[type=radio] {
        accent-color: #DA291C;
        width: 18px;
        height: 18px;
    }

/* Submit */
.btn-submit {
    margin-top: 24px;
    width: 100%;
    height: 52px;
    background: #27201F;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid #27201F;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

/* Placeholder styling */
::placeholder {
    color: #999999;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}
/* Vendor-prefixed placeholder selectors for broader browser support */
::-webkit-input-placeholder {
    color: #999999;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}

::-moz-placeholder {
    color: #999999;
    opacity: 1;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}

:-ms-input-placeholder {
    color: #999999;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}

:-moz-placeholder {
    color: #999999;
    opacity: 1;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}
/* Add red for asterisks by wrapping star directly; using simple color fallback */
.field-group input::placeholder,
.field-group select.required-placeholder,
.field-group textarea::placeholder {
    color: #999999;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}

/* Wrapper for composite fields to allow error message to sit outside the overflow:hidden box */
.composite-field-wrapper {
    flex: 1;
    position: relative;
}

.field-error {
    color: red;
    font-size: 13px;
    margin-top: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Ensure hidden attribute works for field-error */
.field-error[hidden] {
    display: none;
}

@media (max-width:1023px) {
    .contact-left {
        width: 100%;
        padding: 24px;
    }

    .contact-right {
        display: none;
    }
    .contact-right img {
        display: none;
    }

    .form-row.two-col {
        flex-direction: column;
    }

    .radio-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .radio-options {
        gap: 24px;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .contact .form-row.two-col {
        flex-direction: row;
    }

    .contact .radio-row {
        flex-direction: row;
        align-items: center;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .contact [role="heading"][aria-level="2"] {
        font-weight: 700;
        font-style: Bold;
        font-size: 28px;
        line-height: 100%;
        letter-spacing: 0%;
    }
    .contact {
        padding: 60px 0 0;
    }
}

@media (max-width: 480px) {
    .field-error {
        position: static;
    }

    .radio-row .field-error {
        position: static;
        margin-top: 4px;
    }
}

/* Compact footer layout for 1279px ~ 1024px to match screenshot */
@media (min-width:1024px) and (max-width:1279px) {
    .contact {
        padding: 120px 150px 80px;
    }
}

/* Specific adjustment for 1024px - 1219px to use image as form background */
@media (min-width: 1024px) and (max-width: 1219px) {
    .contact-container.max {
        display: block;
        margin-left: auto;
        margin-right: auto;
        max-width: 700px;
    }

    .contact-left {
        width: 100%;
    }

    .contact-right {
        display: none;
    }

    /* Use a dedicated image box behind the form rather than the section background.
     This keeps the decorative layer separate so we can blur/mask it later without
     affecting form content. The box uses the same asset and is absolutely positioned
     inside .contact-container. */
    .contact-image-box {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 0;
        background-image: url("/Style%20Library/OLL/img/bg-contact-1024.jpg");
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        opacity: 0.15;
        border-radius: 20px;
    }

    /* Ensure form container sits above the decorative image box */
    .contact-container {
        position: relative;
        overflow: hidden;
        border-radius: 20px;
        padding: 40px;
    }
    /* Allow form fields to flex properly in single column */
    .contact .form-rows > .form-row:nth-child(1) .field-group,
    .contact .form-rows > .form-row:nth-child(2) .field-group,
    .contact .form-rows > .form-row:nth-child(3) .field-group {
        flex: 1;
        width: auto;
    }
}

/* Contact layout adjustments for 1024px - 1279px: center form, remove decorative background */
@media (min-width:1024px) and (max-width:1279px) {
    /* Slightly less padding at this range */
     .contact {
        padding: 60px 24px;
    }

    .contact-container {
        justify-content: center;
    }

    /* Move heading above the form in center if needed, or keep left aligned within the constrained box */
    .contact [role="heading"][aria-level="2"] {
        font-size: 28px;
        margin-bottom: 32px;
    }

    .contact-left {
        /* let the left side (form) take appropriate width */
        width: 100%;
        max-width: 720px;
    }
    
    /* Ensure right side image is totally gone so we can center the form */
    .contact-right {
        display: none;
    }
}

/* Bootstrap 3 modal styles (required for captcha popup) */
.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: none;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    outline: 0;
}
.modal.fade .modal-dialog {
    -webkit-transition: -webkit-transform .3s ease-out;
    -o-transition: -o-transform .3s ease-out;
    transition: transform .3s ease-out;
    -webkit-transform: translate(0, -25%);
    -ms-transform: translate(0, -25%);
    -o-transform: translate(0, -25%);
    transform: translate(0, -25%);
}
.modal.in .modal-dialog {
    -webkit-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    -o-transform: translate(0, 0);
    transform: translate(0, 0);
}
.modal-open .modal {
    overflow-x: hidden;
    overflow-y: auto;
}
.modal-dialog {
    position: relative;
    width: auto;
    margin: 10px auto;
}
.modal-content {
    position: relative;
    background-color: #fff;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    border: 1px solid #999;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 6px;
    -webkit-box-shadow: 0 3px 9px rgba(0,0,0,.5);
    box-shadow: 0 3px 9px rgba(0,0,0,.5);
    outline: 0;
}
.modal-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    background-color: #000;
}
.modal-backdrop.in {
    opacity: .5;
}

/* Captcha modal close button (positioned outside the box, matching esubscription) */
.modal-content .modal-close-icon {
    position: absolute;
    right: -32px;
    top: 0;
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    color: #ccc;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    z-index: 1;
}
