/**
 * Registration & sign-up (register page + .hg-signup-modal lightbox),
 * plus Ask a Question modal (CF7 #trip-ask-a-question-modal) dropdown/chevron fixes.
 * Depends on child-style3 in functions.php.
 */

/* intl-tel: dropdown appended to body — above Tourmaster overlay (10001) and inside body overflow contexts */
html.tourmaster-lightbox-on .iti.iti--container {
    z-index: 100050 !important;
}

html.tourmaster-lightbox-on .iti.iti--container .iti__country-list {
    z-index: 1 !important;
}

/* ========================================
   Registration / sign-up — modern card UI
   (register page + .hg-signup-modal lightbox)
   ======================================== */
/* Match booking / payment traveller forms: full readable width + 1.6rem fields */
.tourmaster-template-wrapper .tourmaster-page-content .tourmaster-register-form,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-register-form {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.question-modal .wpcf7-form-indicator{display:none;}
form.tourmaster-register-form.tourmaster-with-border {
    --hg-reg-bg: #ffffff;
    --hg-reg-surface: #f4f8fd;
    --hg-reg-text: #202020;
    --hg-reg-muted: #505050;
    --hg-reg-border: #e0e0e0;
    --hg-reg-primary: #0260c0;
    --hg-reg-primary-hover: #024a94;
    --hg-reg-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --hg-reg-shadow-hover: 0 8px 32px rgba(2, 96, 192, 0.15);
    --hg-reg-radius: 0;
    --hg-reg-radius-input: 0;
    --hg-reg-focus: rgba(2, 96, 192, 0.2);
    --hg-reg-input-min-h: 48px;

    background: var(--hg-reg-bg) !important;
    border: 1px solid var(--hg-reg-border) !important;
    border-radius: var(--hg-reg-radius) !important;
    box-shadow: var(--hg-reg-shadow) !important;
    padding: 2rem 1.5rem 2.25rem !important;
    transition: box-shadow 0.35s ease, border-color 0.25s ease;
}

.term_and_conditions .wpcf7-list-item-label:before,.term_and_conditions .wpcf7-list-item input:checked ~ .wpcf7-list-item-label:after{display:none}

@media (min-width: 768px) {
    form.tourmaster-register-form.tourmaster-with-border {
        padding: 2.75rem 3rem 3rem !important;
    }
}

form.tourmaster-register-form.tourmaster-with-border:focus-within {
    border-color: rgba(2, 96, 192, 0.35) !important;
    box-shadow: var(--hg-reg-shadow), 0 0 0 3px var(--hg-reg-focus) !important;
}

/* Intro — full registration page only (modal stays compact without body copy) */
.tourmaster-template-wrapper .tourmaster-register-form .tourmaster-register-message {
    display: block !important;
    font-size: 1.6rem !important;
    line-height: 1.55 !important;
    color: var(--hg-reg-muted) !important;
    margin-bottom: 2rem !important;
    padding: 1rem 1.25rem !important;
    background: var(--hg-reg-surface) !important;
    border-radius: 0 !important;
    border: 1px solid var(--hg-reg-border) !important;
}

.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-register-form .tourmaster-register-message {
    display: none !important;
}

/* Server-side registration errors (injected at top of form) — Tourmaster .tourmaster-notification-box.tourmaster-failure */
.tourmaster-register-form .tourmaster-register-server-error {
    margin: 0 0 1.5rem !important;
    font-size: 1.5rem !important;
    line-height: 1.45 !important;
}

.tourmaster-register-form .tourmaster-register-form-fields {
    padding-top: 0.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem 2rem;
}

/* Two-column layout: Birth date | Email, Phone | Nationality (DOM order); contact address full width */
@media (min-width: 768px) {
    .tourmaster-register-form .tourmaster-register-form-fields {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 2.25rem;
        align-items: start;
    }

    .tourmaster-register-form .tourmaster-register-form-fields > .tourmaster-profile-field-username {
        grid-column: 1;
    }

    .tourmaster-register-form .tourmaster-register-form-fields > .tourmaster-profile-field-password {
        grid-column: 2;
    }

    .tourmaster-register-form .tourmaster-register-form-fields > .tourmaster-profile-field-contact_address {
        grid-column: 1 / -1;
    }
}

.tourmaster-register-form .tourmaster-profile-field {
    margin-bottom: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tourmaster-register-form .tourmaster-profile-field .tourmaster-tail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tourmaster-register-form .tourmaster-profile-field .tourmaster-head {
    margin-bottom: 0.65rem !important;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    line-height: 1.35;
    color: var(--hg-reg-text) !important;
    font-family: inherit;
}

.tourmaster-register-form .tourmaster-profile-field .tourmaster-req {
    font-size: 1.8rem !important;
    color: #e33f3f !important;
}

.tourmaster-register-form .tourmaster-profile-field input[type="text"],
.tourmaster-register-form .tourmaster-profile-field input[type="email"],
.tourmaster-register-form .tourmaster-profile-field input[type="password"],
.tourmaster-register-form .tourmaster-profile-field input[type="tel"] {
    box-sizing: border-box !important;
    width: 100% !important;
    font-size: 1.6rem !important;
    line-height: 1.35 !important;
    min-height: var(--hg-reg-input-min-h) !important;
    height: auto !important;
    padding: 12px 17px !important;
    color: var(--hg-reg-text) !important;
    background: var(--hg-reg-bg) !important;
    border: 1px solid var(--hg-reg-border) !important;
    border-radius: var(--hg-reg-radius-input) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

.tourmaster-register-form .tourmaster-profile-field input::placeholder {
    color: #888;
}

.tourmaster-register-form .tourmaster-profile-field input:hover,
.tourmaster-register-form .tourmaster-profile-field select:hover,
.tourmaster-register-form .tourmaster-profile-field textarea:hover {
    border-color: #c5c5c5 !important;
}

.tourmaster-register-form .tourmaster-profile-field input:focus,
.tourmaster-register-form .tourmaster-profile-field select:focus,
.tourmaster-register-form .tourmaster-profile-field textarea:focus {
    outline: none !important;
    border-color: var(--hg-reg-primary, #0260c0) !important;
    box-shadow: 0 0 0 3px var(--hg-reg-focus, rgba(2, 96, 192, 0.22)) !important;
}

.tourmaster-register-form .tourmaster-profile-field select {
    box-sizing: border-box !important;
    width: 100% !important;
    font-size: 1.6rem !important;
    line-height: 1.35 !important;
    min-height: var(--hg-reg-input-min-h) !important;
    height: auto !important;
    padding: 12px 17px !important;
    color: var(--hg-reg-text) !important;
    background: var(--hg-reg-bg) !important;
    border: 1px solid var(--hg-reg-border) !important;
    border-radius: var(--hg-reg-radius-input) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.tourmaster-register-form .tourmaster-profile-field textarea {
    box-sizing: border-box !important;
    width: 100% !important;
    font-size: 1.6rem !important;
    line-height: 1.5 !important;
    padding: 12px 17px !important;
    min-height: 125px;
    resize: vertical;
    color: var(--hg-reg-text) !important;
    background: var(--hg-reg-bg) !important;
    border: 1px solid var(--hg-reg-border) !important;
    border-radius: var(--hg-reg-radius-input) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.tourmaster-register-form .tourmaster-profile-field .tourmaster-combobox-wrap select {
    padding: 12px 40px 12px 17px !important;
    min-height: var(--hg-reg-input-min-h) !important;
}

.tourmaster-register-form .tourmaster-profile-field .tourmaster-combobox-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: var(--hg-reg-radius-input, 10px);
}

/* intl-tel — full width; input inset clears flag + arrow
   Profile phone uses type="text" + id signup-contact-number (not type=tel) — must override generic text input padding */
.tourmaster-register-form .tourmaster-profile-field-phone .intl-tel-input,
.tourmaster-register-form .tourmaster-profile-field-phone .iti,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .intl-tel-input,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .iti,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .intl-tel-input,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

.tourmaster-register-form .tourmaster-profile-field-phone .iti__tel-input,
.tourmaster-register-form .tourmaster-profile-field-phone .intl-tel-input input,
.tourmaster-register-form .tourmaster-profile-field-phone .iti input[type="tel"],
.tourmaster-register-form .tourmaster-profile-field-phone .iti input[type="text"],
.tourmaster-register-form .tourmaster-profile-field-phone .iti #signup-contact-number,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .iti__tel-input,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .intl-tel-input input,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .iti input[type="tel"],
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .iti input[type="text"],
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti__tel-input,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .intl-tel-input input,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti input[type="tel"],
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti input[type="text"],
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti #signup-contact-number,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti #signup-contact-number-modal,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti #signup-contact-number-modal-mobile {
    box-sizing: border-box !important;
    font-size: 1.6rem !important;
    line-height: 1.35 !important;
    min-height: var(--hg-reg-input-min-h, 48px) !important;
    height: auto !important;
    /* Left: flag + arrow + intl dial; type=text was using generic 12px 17px and overlapped flag */
    padding: 12px 14px 12px 45px !important;
    margin: 0 !important;
    border-radius: var(--hg-reg-radius-input, 0) !important;
    border: 1px solid var(--hg-reg-border, #e0e0e0) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.tourmaster-register-form .tourmaster-profile-field-phone .intl-tel-input.iti,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .intl-tel-input.iti,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .intl-tel-input.iti {
    min-height: var(--hg-reg-input-min-h, 48px);
    border-radius: var(--hg-reg-radius-input, 0);
}

.tourmaster-register-form .tourmaster-profile-field-phone .iti__flag-container,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .iti__flag-container,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti__flag-container {
    z-index: 2;
}

.tourmaster-register-form .tourmaster-profile-field-phone .iti__selected-flag,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-phone .iti__selected-flag,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-profile-field-phone .iti__selected-flag {
    padding: 0 6px 0 8px !important;
    border-radius: 0;
}

/* Birth date: Year → Month → Day; compact row; chevron on right (register + edit profile) */
.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-date-select,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-date-select {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px 8px;
    max-width: 100%;
    direction: ltr;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-date-select > .tourmaster-combobox-wrap,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-date-select > .tourmaster-combobox-wrap {
    margin: 0 !important;
    flex: 0 0 auto;
    min-width: 0;
    position: relative;
    overflow: visible;
}

/* Dropdown chevron — booking-style (tourmaster-combobox-wrap:after) */
.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-combobox-wrap:after,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-combobox-wrap:after {
    font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", fontAwesome !important;
    content: "\f078" !important;
    font-weight: 900;
    font-size: 14px;
    line-height: 20px;
    color: #afafaf;
    position: absolute;
    right: 16px;
    top: 50%;
    margin-top: -10px;
    transform: none;
    pointer-events: none;
    z-index: 2;
}

/* Day column: narrow box; chevron flush to inner right (plugin .tourmaster-form-field uses right:16px) */
.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date.tourmaster-combobox-wrap,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date.tourmaster-combobox-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date.tourmaster-combobox-wrap:after,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date.tourmaster-combobox-wrap:after {
    position: absolute !important;
    right: 4px !important;
    left: auto !important;
    top: 50% !important;
    margin-top: 0 !important;
    transform: translateY(-50%) !important;
    font-size: 12px !important;
    line-height: 1 !important;
    width: 1.1em;
    text-align: center;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-combobox-wrap select,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-combobox-wrap select {
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 0;
    min-height: 48px !important;
    height: auto !important;
    font-size: 1.6rem !important;
    padding: 12px 40px 12px 17px !important;
    border-radius: 0 !important;
    border: 1px solid #e0e0e0 !important;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-year,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-year {
    flex: 0 0 92px;
    width: 92px !important;
    max-width: 92px;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-month {
    flex: 0 1 118px;
    width: 118px !important;
    max-width: 118px;
    min-width: 88px;
}

.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-month {
    flex: 0 1 200px;
    width: 200px !important;
    max-width: 200px;
    min-width: 160px;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date {
    flex: 0 0 64px;
    width: 64px !important;
    max-width: 64px;
}

.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date {
    flex: 0 0 64px;
    width: 64px !important;
    max-width: 64px;
}

.tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date.tourmaster-combobox-wrap select,
.tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date.tourmaster-combobox-wrap select {
    /* Match year/month: label left, chevron right (center + narrow box put glyph visually on the wrong side in WebKit) */
    padding: 12px 26px 12px 8px !important;
    text-align: left !important;
    font-size: 1.45rem !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: var(--hg-reg-bg, #fff) !important;
}

@media (max-width: 576px) {
    .tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date,
    .tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-month,
    .tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-year,
    .tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date,
    .tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-month,
    .tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-year {
        flex: 1 1 100%;
        width: 100% !important;
        max-width: none;
        margin: 0 0 6px 0 !important;
    }

    .tourmaster-register-form .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date,
    .tourmaster-edit-profile-wrap .tourmaster-profile-field-birth_date .tourmaster-form-field-alt-date {
        margin-bottom: 0 !important;
    }
}

.tourmaster-register-form .tourmaster-register-term {
    margin-top: 1rem;
    margin-bottom: 0;
    padding: 1.25rem 0.25rem 0.25rem 0.25rem;
    font-size: 1.6rem !important;
    line-height: 1.55;
    color: var(--hg-reg-text);
}

.tourmaster-register-form .tourmaster-register-term a {
    color: var(--hg-reg-primary) !important;
    text-decoration: underline;
}

.tourmaster-register-form .tourmaster-register-term input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    margin-right: 0.65rem;
    accent-color: #0260c0;
    vertical-align: middle;
    cursor: pointer;
}

.tourmaster-register-form .tourmaster-register-term .tourmaster-notification-box {
    margin-top: 0.5rem;
}

.tourmaster-register-form input.tourmaster-register-submit,
.tourmaster-register-form .tourmaster-register-submit.tourmaster-button {
    display: block;
    width: 100%;
    margin-top: 1.75rem !important;
    margin-bottom: 0.25rem;
    padding: 15px 28px !important;
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0;
    text-transform: none !important;
    color: #fff !important;
    background: #0260c0 !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s ease, opacity 0.2s ease !important;
}

.tourmaster-register-form .tourmaster-register-submit:hover,
.tourmaster-register-form .tourmaster-register-submit:focus {
    background: #024a94 !important;
    opacity: 1;
    outline: none;
}

.tourmaster-register-form .tourmaster-register-submit:active {
    opacity: 0.92;
}

/* Sits after </form> — sibling of the form, not inside it */
.tourmaster-template-wrapper .tourmaster-register-bottom,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-register-bottom {
    max-width: 900px;
    margin: 2rem auto 0;
    padding: 1.75rem 1.5rem;
    text-align: center;
    font-size: 1.6rem;
    line-height: 1.5;
    color: #202020;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0;
}

.tourmaster-template-wrapper .tourmaster-register-bottom-title,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-register-bottom-title {
    margin: 0 0 0.5rem !important;
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: #202020 !important;
}

.tourmaster-template-wrapper .tourmaster-register-bottom-link,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-register-bottom-link {
    font-weight: 600;
    color: #0260c0 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.tourmaster-template-wrapper .tourmaster-register-bottom-link:hover,
.tourmaster-lightbox-content-wrap.hg-signup-modal .tourmaster-register-bottom-link:hover {
    color: #024a94 !important;
    text-decoration: underline !important;
}

/* ========================================
   Ask a Question popup — #trip-ask-a-question-modal (footer.php + CF7 shortcode)
   Scoped by ID so these rules always win over generic .question-modal / CF7 / Goodlayers.
   Goodlayers injects: <div class="wpcf7-form-indicator"><i class="fa fa-angle-down"></i></div>
   after each select — position over the field, not below.
   ======================================== */
#trip-ask-a-question-modal .modal-body form .wpcf7-form-control-wrap {
    position: relative;
    display: block;
}

#trip-ask-a-question-modal .modal-body form .wpcf7-form-control-wrap select,
#trip-ask-a-question-modal .modal-body form select.wpcf7-select {
    width: 100%;
    padding-right: 2.25rem;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
}

#trip-ask-a-question-modal .modal-body form .wpcf7-form-control-wrap .wpcf7-form-indicator {
    position: absolute !important;
    right: 0.75rem;
    top: 50%;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
    margin: 0 !important;
    padding: 0;
    width: auto;
    height: auto;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#trip-ask-a-question-modal .modal-body form .wpcf7-form-control-wrap .wpcf7-form-indicator .fa-angle-down {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    line-height: 1;
    font-size: 1rem;
}

#trip-ask-a-question-modal .modal-body form .wpcf7-form-control-wrap > .fa-angle-down {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
    line-height: 1;
    font-size: 1rem;
}

#trip-ask-a-question-modal .modal-body form .form-group:not(.form-check) > .fa-angle-down {
    position: absolute;
    right: 0.75rem;
    top: 1.25rem;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
    line-height: 1;
    font-size: 1rem;
}

/* Dropdown list panel matches trigger width; stays above modal content */
#trip-ask-a-question-modal .tail-select {
    display: block;
    width: 100%;
    max-width: 100%;
}

#trip-ask-a-question-modal .tail-select .select-dropdown {
    width: 100% !important;
    min-width: 100%;
    left: 0 !important;
    right: auto;
    box-sizing: border-box;
    z-index: 2000;
}

#trip-ask-a-question-modal .tail-select .select-label .label-inner {
    max-width: none;
}
