/**
 * TravelStore Lead Router - Frontend Form Styles
 *
 * Scoped to .tslr-form to avoid bleeding into other CF7 forms.
 * Builds on the existing .field-row styling in the theme's main.css.
 */

/* ── Response message: move to top of form via flexbox ──────────── */

.wpcf7-form:has(.tslr-form) {
    display: flex;
    flex-direction: column;
}

.wpcf7-form .tslr-form {
    order: 0;
}

.wpcf7-form .wpcf7-response-output {
    order: -1;
    color: #F5A623 !important;
    background: rgba(245, 166, 35, 0.12) !important;
    border: 1px solid #F5A623 !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    margin: 0 0 16px 0 !important;
}

.wpcf7-form[data-status="init"] .wpcf7-response-output {
    display: none;
}

/* ── Reset: neutralize CF7's auto-wrapping <p> tags ─────────────── */

.tslr-form .field-col p {
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

.tslr-form .field-row br {
    display: none;
}

/* ── Layout: rows and columns ───────────────────────────────────── */
/*
 * Theme's main.css sets .field-row .field-col { width: 100% } which
 * forces all columns full-width. We need higher specificity to win.
 * Using .tslr-form--leisure .field-row .field-col.field-col-50 (4 classes).
 */

.tslr-form .field-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
    align-items: flex-start !important;
    position: relative;
}

.tslr-form .field-row .field-col {
    box-sizing: border-box !important;
    position: relative;
}

.tslr-form .field-row .field-col.field-col-50 {
    flex: 0 0 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
    min-width: 0 !important;
    display: block !important;
}

.tslr-form .field-row .field-col.field-col-100 {
    flex: 0 0 100% !important;
    width: 100% !important;
}

.tslr-form .field-col p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Dark footer + cruise line rows can wrap */
.tslr-form .field-row.field-row--dark,
.tslr-form .field-row.tslr-cruise-line-wrap {
    flex-wrap: wrap !important;
}

@media (max-width: 767px) {
    .tslr-form .field-row {
        flex-wrap: wrap !important;
    }
    .tslr-form .field-row .field-col.field-col-50 {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ── Field wrap: no bottom margin (handled by .field-row instead) ─ */

.tslr-form .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 0 !important;
    position: relative;
}

/* ── Text inputs ────────────────────────────────────────────────── */

.tslr-form input[type="text"],
.tslr-form input[type="email"],
.tslr-form input[type="tel"],
.tslr-form input[type="number"],
.tslr-form textarea {
    width: 100% !important;
    height: 5.2rem;
    box-sizing: border-box !important;
    padding: 0 2rem;
    background: #fff;
    font-size: 1.5rem;
    font-family: "eina02-regularuploaded_file", Arial, sans-serif;
    border: none;
    border-radius: 8px;
    color: #010101;
    -webkit-appearance: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.tslr-form input[type="text"]:focus,
.tslr-form input[type="email"]:focus,
.tslr-form input[type="tel"]:focus,
.tslr-form input[type="number"]:focus,
.tslr-form textarea:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), inset 3px 0 0 #a855f7;
}

.tslr-form input::placeholder,
.tslr-form textarea::placeholder {
    color: #888;
    font-weight: 400;
    opacity: 1;
}

.tslr-form input:focus::placeholder,
.tslr-form textarea:focus::placeholder {
    opacity: 0.5;
}

/* ── Textarea ───────────────────────────────────────────────────── */

.tslr-form textarea {
    height: auto;
    min-height: 120px;
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
    resize: vertical;
    display: block;
}

/* ── Select dropdowns ───────────────────────────────────────────── */

.tslr-form select {
    width: 100% !important;
    height: 5.2rem;
    box-sizing: border-box !important;
    padding: 0 4rem 0 2rem;
    background: #fff;
    font-size: 1.5rem;
    font-family: "eina02-regularuploaded_file", Arial, sans-serif;
    border: none;
    border-radius: 8px;
    color: #010101;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.6rem center;
}

.tslr-form select:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), inset 3px 0 0 #a855f7;
}

.tslr-form select option[value=""] {
    color: #888;
}

/* ── Submit button ──────────────────────────────────────────────── */

.tslr-form input[type="submit"].wpcf7-submit {
    background: #2d2d2d;
    width: auto;
    height: auto;
    padding: 1.8rem 4.8rem;
    border: 2px solid #2d2d2d;
    border-radius: 6px;
    text-transform: uppercase;
    font-family: "eina03-bolduploaded_file", Arial, sans-serif;
    color: #fff;
    font-size: 1.3rem;
    letter-spacing: 2px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    box-shadow: none;
    transition: all 0.2s ease;
}

.tslr-form input[type="submit"].wpcf7-submit:hover {
    background: #444;
    border-color: #444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
    .tslr-form input[type="submit"].wpcf7-submit {
        width: 100%;
        margin-bottom: 3rem;
    }
}

/* ── SMS opt-in / acceptance checkbox ───────────────────────────── */
/*
 * The theme's main.css hides native checkboxes (display:none) and renders
 * a fake one via span::before/::after. We use Option A: native checkbox
 * only. Override the theme to show the real input and kill the pseudo-elements.
 */

.tslr-form .field-row--dark {
    margin-top: 2rem;
    margin-bottom: 0 !important;
    gap: 0 !important;
}

.tslr-form .field-row--dark br {
    display: none;
}

.tslr-form .tslr-sms-optin {
    margin-bottom: 1.2rem;
}

.tslr-form .tslr-sms-optin .wpcf7-form-control-wrap {
    margin-bottom: 0 !important;
}

/* Label: flex row so checkbox + text sit side by side */
.tslr-form .tslr-sms-optin .wpcf7-list-item label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px;
}

/* Show the native checkbox, override theme's display:none */
.tslr-form .tslr-sms-optin input[type="checkbox"] {
    display: block !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    margin: 2px 0 0 0 !important;
    flex-shrink: 0;
    accent-color: #a855f7;
    cursor: pointer;
}

/* Kill the theme's pseudo-element fake checkbox */
.tslr-form .tslr-sms-optin input[type="checkbox"] + span::before,
.tslr-form .tslr-sms-optin input[type="checkbox"] + span::after {
    display: none !important;
}

/* Label text: white on purple background, no left padding (theme adds 30px for fake checkbox) */
.tslr-form .tslr-sms-optin .wpcf7-list-item-label {
    color: #fff;
    font-size: 1.4rem;
    line-height: 1.5;
    font-family: "eina02-regularuploaded_file", Arial, sans-serif;
    padding-left: 0 !important;
    flex: 1;
}

/* Footer notes */
.tslr-form .field-row--dark .small-area-notes {
    color: #fff;
    font-family: "eina03-bolduploaded_file", Arial, sans-serif;
    font-size: 1.3rem;
    line-height: 1.3;
    display: block;
}

.tslr-form .field-row--dark .small-area-notes a {
    color: #fff;
    text-decoration: underline;
}

.tslr-form .field-row--dark .small-area-notes a:hover {
    text-decoration: none;
}

/* ── Searchable advisor dropdown ────────────────────────────────── */

/* Hide native select and its fancySelect wrapper — replaced by type-ahead */


.tslr-advisor-search-wrap {
    position: relative;
    width: 100%;
}

.tslr-advisor-search-input {
    width: 100% !important;
    height: 5.2rem;
    box-sizing: border-box !important;
    padding: 0 4rem 0 2rem;
    background: #fff;
    font-size: 1.5rem;
    font-family: "eina02-regularuploaded_file", Arial, sans-serif;
    border: none;
    border-radius: 8px;
    color: #010101;
    -webkit-appearance: none;
    cursor: text;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='5' cy='5' r='3.5' stroke='%23888' stroke-width='1.2' fill='none'/%3E%3Cline x1='7.5' y1='7.5' x2='10.5' y2='10.5' stroke='%23888' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.6rem center;
}

.tslr-advisor-search-input:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), inset 3px 0 0 #a855f7;
}

.tslr-advisor-search-input::placeholder {
    color: #888;
    font-weight: 400;
    opacity: 1;
}

.tslr-advisor-search-input:focus::placeholder {
    opacity: 0.5;
}

.tslr-advisor-search-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    -webkit-overflow-scrolling: touch;
}

.tslr-advisor-search-list.tslr-advisor-search-open {
    display: block;
}

.tslr-advisor-search-item {
    padding: 10px 2rem;
    font-size: 1.5rem;
    font-family: "eina02-regularuploaded_file", Arial, sans-serif;
    color: #010101;
    cursor: pointer;
    transition: background 0.1s ease;
}

.tslr-advisor-search-item:hover,
.tslr-advisor-search-item--active {
    background: #f3e8ff;
}

.tslr-advisor-search-item--default {
    color: #888;
    border-bottom: 1px solid #eee;
}

/* ── Cruise line field: hidden by default ───────────────────────── */

.tslr-form .tslr-cruise-line-wrap {
    display: none;
}

.tslr-form .tslr-cruise-line-wrap.tslr-cruise-visible {
    display: flex;
}

/* ── Validation: amber/gold error system ────────────────────────── */

.tslr-form .wpcf7-not-valid {
    border: 2px solid #F5A623 !important;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2) !important;
    border-radius: 8px;
}

.tslr-form .wpcf7-not-valid-tip {
    position: absolute !important;
    bottom: -18px !important;
    left: 0 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    z-index: 1;
}

/* ── Spinner ────────────────────────────────────────────────────── */

.tslr-form .wpcf7-submit.has-spinner .wpcf7-spinner {
    margin-left: 1rem;
}