/* ============================================================
   JWV Project Summary Form — Frontend Styles
   ============================================================ */

/* ── Reset ── */
.jwv-wrap *,
.jwv-wrap *::before,
.jwv-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Container ── */
.jwv-wrap {
    background: #f7f7f7;
    /* padding: 36px 42px 40px; */
    font-family: inherit;
}

/* ── Notice ── */
.jwv-wrap .jwv-notice {
    padding: 13px 17px;
    margin-top: 16px;
    margin-bottom: 0;
    font-size: 14px;
    display: none;
    line-height: 1.5;
}

.jwv-wrap .jwv-notice.success {
    background: #eaf6ea;
    color: #2d6a2d;
    border: 1px solid #b8ddb8;
}

.jwv-wrap .jwv-notice.error {
    background: #fdecea;
    color: #9b2020;
    border: 1px solid #f5c0c0;
}

/* ── Layout ── */
.jwv-wrap .jwv-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.jwv-wrap .jwv-col {
    flex: 1 1 0;
    min-width: 0;
}

.jwv-wrap .jwv-full {
    margin-bottom: 16px;
}

/* ── Text inputs & textarea ── */
.jwv-wrap input[type="text"],
.jwv-wrap input[type="email"],
.jwv-wrap input[type="tel"],
.jwv-wrap textarea {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 0;
    font-size: 16px;
    font-weight: 300;
    color: #555;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .18s;
    display: block;
    box-shadow: none;
}

.jwv-wrap input[type="text"]:focus,
.jwv-wrap input[type="email"]:focus,
.jwv-wrap input[type="tel"]:focus,
.jwv-wrap textarea:focus {
    border-color: #999;
}

.jwv-wrap input::placeholder,
.jwv-wrap textarea::placeholder {
    color: #aaa;
}

.jwv-wrap textarea {
    height: 155px;
    resize: vertical;
}

/* ── Select2 — field wrapper ── */
.jwv-wrap .jwv-select-wrap {
    margin-bottom: 16px;
}

.jwv-wrap .select2-container {
    width: 100% !important;
}

/* Field label above the Select2 box */
.jwv-wrap .jwv-select-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 6px;
}

/* ── Selection box ── */
.jwv-wrap .select2-container--default .select2-selection--multiple {
    position: relative;
    border: 1px solid #fff !important;
    border-radius: 0 !important;
    background: #fff;
    min-height: 52px;
    padding: 7px 64px 7px 14px;
    /* right padding leaves room for the clear × */
    cursor: text;
    transition: border-color .18s;
    box-shadow: none !important;
}

.jwv-wrap .select2-container--default .select2-selection--multiple::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.jwv-wrap .select2-container--default.select2-container--open .select2-selection--multiple::after {
    transform: translateY(-35%) rotate(-135deg);
}

.jwv-wrap .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #999 !important;
    outline: none !important;
}

/* Placeholder */
.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #aaa;
    font-size: 14px;
    line-height: 36px;
    margin-left: 2px;
}

/* Hide the inline search input that sits inside the box */
.jwv-wrap .select2-container--default .select2-selection--multiple .select2-search--inline {
    display: none;
}

/* ── Selected tags ── */
.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
    align-items: center;
}

.jwv-wrap .select2-container--default .select2-selection--multiple::before {
    content: attr(data-placeholder);
    position: absolute;
    left: 14px;
    top: 7px;
    color: #aaa;
    font-size: 16px;
    font-weight: 300;
    line-height: 36px;
    pointer-events: none;
}

.jwv-wrap .select2-container--default.jwv-has-value .select2-selection--multiple::before {
    display: none;
}

.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 4px 9px 4px 20px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Remove × button on each tag — rendered BEFORE the label in Select2 4.x */
.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 2;
    margin-left: 4px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-style: normal;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    border: none;
    padding: 0;
}

.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    order: 1;
}

.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: rgba(255, 255, 255, .5);
    color: #fff;
}

/* ── "Clear all" button (allowClear ×) ── */
.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__clear {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    transition: background .15s;
    z-index: 1;
    margin-top: 0 !important;
}

.jwv-wrap .select2-container--default .select2-selection--multiple .select2-selection__clear:hover {
    background: #999;
}

/* ── Dropdown panel ── */
.jwv-s2-drop {
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1) !important;
    font-family: inherit;
    font-size: 14px;
}

/* Force dropdown to always render below, never above */
.jwv-s2-force-below.select2-dropdown--above {
    /* Override Select2's above positioning */
    margin-top: 0 !important;
}

.jwv-s2-force-below.select2-dropdown--below {
    margin-top: 35px !important;
}

.jwv-s2-drop .select2-search {
    padding: 8px 10px 4px;
}

.jwv-s2-drop .select2-search__field {
    width: 100% !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 2px !important;
    padding: 7px 10px !important;
    font-size: 13px;
    font-family: inherit;
    outline: none !important;
    box-shadow: none !important;
    color: #555;
}

.jwv-s2-drop .select2-search__field::placeholder {
    color: #bbb;
}

/* ── Dropdown options — single column with checkbox ── */
/* Scope to [role="option"] only so group headings never get the ::before box */
.jwv-s2-drop .select2-results__option[role="option"] {
    padding: 9px 14px;
    color: #444;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jwv-s2-drop .select2-results__options--nested .select2-results__option[role="option"] {
    padding-left: 20px;
}

/* Unselected checkbox */
.jwv-s2-drop .select2-results__option[role="option"]::before {
    content: "";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border: 1.5px solid #ccc;
    border-radius: 2px;
    background: #fff;
    transition: background .12s, border-color .12s;
}

/* Selected — support both Select2 4.0 (aria-selected) and 4.1 (--selected class). */
.jwv-s2-drop .select2-results__option[role="option"][aria-selected="true"]::before,
.jwv-s2-drop .select2-results__option[role="option"].select2-results__option--selected::before,
.jwv-s2-drop .select2-results__option[role="option"][aria-selected="true"].select2-results__option--highlighted::before,
.jwv-s2-drop .select2-results__option[role="option"].select2-results__option--selected.select2-results__option--highlighted::before {
    content: "\2713";
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    background-color: #000;
    border-color: #000;
}

/* Highlighted (hovered) — soft teal row, border hint on checkbox */
.jwv-s2-drop .select2-results__option--highlighted[aria-selected] {
    background: #f3fafa !important;
    color: #000 !important;
}

.jwv-s2-drop .select2-results__option--highlighted[aria-selected]::before {
    border-color: #000;
}

/* Selected (not highlighted) — very light teal row */
.jwv-s2-drop .select2-results__option[role="option"][aria-selected="true"] {
    color: #000;
    background: #f8fdfd;
}

/* Group headings — no flex, no checkbox, plain label */
.jwv-s2-drop .select2-results__group {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #aaa;
    padding: 12px 14px 5px;
    border-top: 1px solid #f0f0f0;
}

.jwv-s2-drop .select2-results__group:first-child {
    border-top: none;
}

/* ── Field description (below a field) ── */
.jwv-wrap .jwv-field-desc {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    line-height: 1.5;
}

/* ── Field-level validation errors ── */
.jwv-wrap .jwv-field-error {
    display: block;
    font-size: 12px;
    color: #c0392b;
    margin-top: 5px;
    line-height: 1.4;
}

.jwv-wrap input.jwv-invalid,
.jwv-wrap textarea.jwv-invalid {
    border-color: #e74c3c !important;
    background: #fff8f8;
}

.jwv-wrap .jwv-select-wrap .jwv-invalid+.select2-container--default .select2-selection--multiple,
.jwv-wrap .select2-container--default.jwv-select-invalid .select2-selection--multiple {
    border-color: #e74c3c !important;
    background: #fff8f8;
}

.jwv-wrap .jwv-file-box input.jwv-invalid {
    border: none;
}

.jwv-wrap .jwv-file-box.jwv-box-invalid {
    border-color: #e74c3c !important;
    background: #fff8f8;
}

/* ── File upload — drag-and-drop zone ── */
.jwv-wrap .jwv-file-box {
    position: relative;
    background: #fff;
    border: 2px dashed rgb(0 0 0 / 10%);
    border-radius: 2px;
    padding: 28px 20px;
    margin-bottom: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s;
}

.jwv-wrap .jwv-file-box:hover,
.jwv-wrap .jwv-file-box.jwv-drag-over {
    border-color: #000;
    background: #f3fafa;
}

/* Hidden native input covers the entire zone for click-to-browse */
.jwv-wrap .jwv-file-box input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    z-index: 1;
}

/* Upload icon */
.jwv-wrap .jwv-file-icon {
    display: block;
    margin: 0 auto 10px;
    width: 36px;
    height: 36px;
    color: #b0b0b0;
    transition: color .18s;
}

.jwv-wrap .jwv-file-box:hover .jwv-file-icon,
.jwv-wrap .jwv-file-box.jwv-drag-over .jwv-file-icon {
    color: #000;
}

/* Prompt text */
.jwv-wrap .jwv-file-prompt {
    font-size: 13.5px;
    color: #666;
    line-height: 1.5;
    pointer-events: none;
}

.jwv-wrap .jwv-file-prompt strong {
    color: #000;
    font-weight: 600;
}

/* Accepted formats hint */
.jwv-wrap .jwv-file-hint {
    font-size: 11px;
    color: #bbb;
    margin-top: 6px;
    pointer-events: none;
}

/* Selected file pill */
.jwv-wrap .jwv-file-chosen {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 2;
}

.jwv-wrap .jwv-file-chosen.is-visible {
    display: flex;
}

.jwv-wrap .jwv-file-chosen-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f4f4;
    color: #000;
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jwv-wrap .jwv-file-remove {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    pointer-events: all;
    transition: background .15s;
}

.jwv-wrap .jwv-file-remove:hover {
    background: #1f5959;
}

/* Error state */
.jwv-wrap .jwv-file-box.jwv-box-invalid {
    border-color: #e74c3c !important;
    background: #fff8f8;
}

/* ── Submit ── */
.jwv-wrap .jwv-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.jwv-submit-btn {
    color: #143d59 !important;
    border-width: 4px !important;
    border-color: #143d59 !important;
    border-radius: 0px !important;
    letter-spacing: 2px !important;
    font-size: 14px !important;
    font-family: 'Myriad Variable Concept', Helvetica, Arial, Lucida, sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.jwv-submit-btn::after {
    font-size: 14px !important;
    transform: translateY(-50%);
    top: 50%;
}

/* ── Responsive ── */
@media (max-width: 620px) {
    .jwv-wrap .jwv-row {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    .jwv-wrap .jwv-col {
        margin-bottom: 16px;
    }
}