/**
 * Trustify home calculator — matches theme calculator layout (IDs/handlers unchanged)
 */

/* Loader hook for home.js — never blocks the page (same behaviour as tenant theme) */
.tf-page-home #loading.tf-home-loading-hook,
.tf-page-home .tf-home-loading-hook {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: none !important;
    z-index: -1 !important;
}
.tf-page-home #calculator_container.is-calculator-loading {
    position: relative;
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.tf-page-home #calculator_container.is-calculator-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid rgba(40, 74, 102, 0.15);
    border-top-color: var(--tf-primary, #284A66);
    border-radius: 50%;
    animation: tf-calc-spin 0.75s linear infinite;
    z-index: 2;
}
@keyframes tf-calc-spin {
    to { transform: rotate(360deg); }
}

/* Prevent legacy styles from clipping or constraining calculator height */
.tf-page-home #home,
.tf-page-home .tf-home-hero,
.tf-page-home .tf-home-hero__inner,
.tf-page-home .tf-home-hero__calc,
.tf-page-home .tf-home-hero__calc-panel,
.tf-page-home #send_calculator_form {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.tf-page-home .tf-home-hero__calc {
    width: 100%;
    min-width: 0;
    max-width: min(100%, 400px);
    margin-left: auto;
    justify-self: end;
    padding: 0 0 24px;
}

.tf-page-home .tf-home-hero__calc-panel {
    width: 100%;
    overflow: visible !important;
}

.tf-page-home #calculator_container,
.tf-page-home #calculator_container > .col {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.tf-page-home #calculator_container {
    margin: 0 0 16px;
    padding: 22px 22px 32px;
    background: linear-gradient(165deg, #f2f7fb 0%, #e8f1f8 100%);
    border-radius: 20px;
    border: 1px solid rgba(40, 74, 102, 0.1);
    border-top: 4px solid var(--tf-primary, #284A66);
    box-shadow:
        0 16px 32px rgba(40, 74, 102, 0.1),
        0 6px 12px rgba(40, 74, 102, 0.06);
    position: relative;
    z-index: 2;
}

.tf-page-home #calculator_container #rec_countries > .col,
.tf-page-home #calculator_container #rec_payment_method > .col {
    width: 100% !important;
    max-width: 100%;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.tf-page-home #calculator_container strong#sendmoney_title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tf-primary, #284A66) !important;
    margin: 0 0 16px;
    padding-bottom: 14px;
    display: block;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(40, 74, 102, 0.12);
    font-family: var(--tf-font, 'Inter', sans-serif);
}

.tf-page-home #calculator_container label,
.tf-page-home #calculator_container .lead {
    color: #64748b !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tf-page-home #calculator_container > .col > .row {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
}

.tf-page-home #calculator_container > .col > .row#calc_sending_amount_row {
    margin-bottom: 8px !important;
}

.tf-page-home #calculator_container > .col > .row#exchange_rates,
.tf-page-home #calculator_container > .col > .row#fee_row,
.tf-page-home #calculator_container > .col > .row#promo_row,
.tf-page-home #calculator_container > .col > .row#total_row,
.tf-page-home #calculator_container > .col > .row.center {
    margin-bottom: 0 !important;
    padding-bottom: 6px;
}

.tf-page-home #calculator_container > .col > .row.center:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 8px;
}

.tf-page-home #calculator_container #exchange_rates > .col,
.tf-page-home #calculator_container #fee_row > .col {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(40, 74, 102, 0.08);
    border-radius: 10px;
    padding: 10px 12px !important;
}

.tf-page-home #calculator_container .green-text,
.tf-page-home #calculator_container #fee_amount.green-text,
.tf-page-home #calculator_container #calculated_amount.green-text,
.tf-page-home #calculator_container #exchange_rate {
    color: var(--tf-primary, #284A66) !important;
}

.tf-page-home #calculator_container #promo_code {
    color: var(--tf-primary, #284A66);
    cursor: pointer;
}

.tf-page-home #calculator_container button.general-btn.get_started,
.tf-page-home #calculator_container .promo-btn {
    background-color: var(--tf-primary, #284A66) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: var(--tf-font, 'Inter', sans-serif);
}

.tf-page-home #calculator_container button.general-btn.get_started {
    width: 100%;
    max-width: 100%;
    padding: 14px 20px !important;
    margin-top: 10px;
    margin-bottom: 6px;
    box-shadow: 0 4px 14px rgba(40, 74, 102, 0.25);
}

.tf-page-home #calculator_container button.general-btn.get_started:hover,
.tf-page-home #calculator_container .promo-btn:hover {
    background-color: var(--tf-primary-dark, #1C3549) !important;
    box-shadow: 0 6px 18px rgba(40, 74, 102, 0.3);
}

.tf-page-home #calculator_container input.custom-input:focus,
.tf-page-home #calculator_container select.custom-input:focus {
    border-bottom-color: var(--tf-primary, #284A66) !important;
    box-shadow: 0 1px 0 0 var(--tf-primary, #284A66) !important;
    outline: none;
}

.tf-page-home #calculator_container .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--tf-primary, #284A66) !important;
}

.tf-page-home #calculator_container .select2-container {
    width: 100% !important;
}

/* Recipient country & delivery method */
.tf-page-home #calculator_container #rec_countries .select2-container--default .select2-selection--single,
.tf-page-home #calculator_container #rec_payment_method .select2-container--default .select2-selection--single {
    border: 1px solid #b8c4d4 !important;
    border-bottom: 1px solid #b8c4d4 !important;
    border-radius: 10px !important;
    height: 3.5rem !important;
    min-height: 3.5rem !important;
    margin-bottom: 0 !important;
    background: rgba(255, 255, 255, 0.72) !important;
    box-shadow: inset 0 1px 2px rgba(40, 74, 102, 0.05);
}

.tf-page-home #calculator_container #rec_countries .select2-container--default .select2-selection--single .select2-selection__rendered,
.tf-page-home #calculator_container #rec_payment_method .select2-container--default .select2-selection--single .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    line-height: normal !important;
    padding: 0 28px 0 12px !important;
    font-size: 1rem;
    color: #1e293b;
}

.tf-page-home #calculator_container #rec_countries .select2-container--default .select2-selection--single .select2-selection__arrow,
.tf-page-home #calculator_container #rec_payment_method .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 3.5rem !important;
    right: 10px;
}

.tf-page-home #calculator_container #rec_countries .select2-container--default.select2-container--open .select2-selection--single,
.tf-page-home #calculator_container #rec_payment_method .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--tf-primary, #284A66) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(40, 74, 102, 0.12);
}

/* Flag + label inside Select2 */
.tf-page-home #calculator_container #rec_countries .the_prefix,
.tf-page-home #calculator_container #rec_payment_method .the_prefix {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center !important;
    margin: 0 !important;
    width: 100%;
}

.tf-page-home #calculator_container #rec_countries .the_prefix.row,
.tf-page-home #calculator_container #rec_payment_method .the_prefix.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.tf-page-home #calculator_container #rec_countries .the_prefix > .col,
.tf-page-home #calculator_container #rec_payment_method .the_prefix > .col {
    float: none !important;
    width: auto !important;
    flex: 0 0 auto;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0;
}

.tf-page-home #calculator_container #country_flag,
.tf-page-home #calculator_container #icon_flag {
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.tf-page-home #calculator_container #country_flag img,
.tf-page-home #calculator_container #icon_flag img,
.tf-page-home #calculator_container #cnflag,
.tf-page-home #calculator_container #icnflag {
    display: block;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    object-fit: contain;
}

.tf-page-home #calculator_container #country_name,
.tf-page-home #calculator_container #method_name {
    display: flex !important;
    align-items: center !important;
    margin: 0 0 0 8px !important;
    padding: 0 !important;
    text-align: left !important;
    line-height: 1.25 !important;
}

/* Amount rows — you send / recipient gets */
.tf-page-home #calculator_container .tf-calc-amount-cell {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 3.5rem;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .sending_field {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    display: block;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field {
    flex: 0 0 28%;
    width: 28% !important;
    max-width: 120px;
    min-width: 100px;
    margin: 0 !important;
    display: block;
}

.tf-page-home #calculator_container .tf-calc-amount-cell #receive_currency_result {
    height: 100%;
    min-height: 3.5rem;
}

.tf-page-home #calculator_container .tf-calc-amount-cell input.custom-input {
    height: 3.5rem !important;
    margin: 0 !important;
    box-sizing: border-box;
    border: 1px solid #b8c4d4 !important;
    border-radius: 10px 0 0 10px !important;
    border-right: none !important;
    background: rgba(255, 255, 255, 0.82);
    padding: 0 14px;
    font-size: 1rem;
    width: 100%;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field select.custom-input {
    height: 3.5rem !important;
    width: 100% !important;
    border-radius: 0 10px 10px 0 !important;
    border-left: none !important;
    background: rgba(255, 255, 255, 0.65) !important;
    color: #1e293b !important;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .ddcommon,
.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .dd {
    width: 100% !important;
    height: 3.5rem !important;
    min-height: 3.5rem;
    margin: 0 !important;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .ddcommon .ddTitle,
.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .dd .ddTitle {
    margin-top: 0 !important;
    top: 0 !important;
    height: 100% !important;
    background-color: rgba(255, 255, 255, 0.65) !important;
    color: #1e293b !important;
    border: 1px solid #b8c4d4 !important;
    border-left: none !important;
    border-radius: 0 10px 10px 0 !important;
    box-sizing: border-box;
    position: relative;
    display: inline-block;
    width: 100%;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .dd .ddTitle .ddTitleText,
.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .ddcommon .ddTitle .ddTitleText {
    padding: 0 26px 0 6px !important;
    line-height: 3.5rem !important;
    height: 3.5rem !important;
    color: #1e293b !important;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .dd .arrow {
    margin-top: -8px !important;
}

.tf-page-home #calculator_container .tf-calc-amount-cell input.custom-input:focus,
.tf-page-home #calculator_container .tf-calc-amount-cell .currency_field .dd .ddTitle:focus {
    border-color: var(--tf-primary, #284A66) !important;
    box-shadow: 0 0 0 3px rgba(40, 74, 102, 0.12) !important;
}

/* Promo row */
.tf-page-home #calculator_container #promo_code_row .sending_field {
    width: 58%;
    display: inline-block;
    vertical-align: top;
}

.tf-page-home #calculator_container #promo_code_row .currency_field {
    width: 40%;
    display: inline-block;
    vertical-align: top;
}

.tf-page-home #calculator_container #promo_code_row input.custom-input {
    border-radius: 10px 0 0 10px !important;
    border-right: none !important;
    height: 3.5rem !important;
}

.tf-page-home #calculator_container #promo_code_row .promo-btn {
    width: 100%;
    height: 3.5rem;
    border-radius: 0 10px 10px 0 !important;
}

@media (max-width: 992px) {
    .tf-page-home .tf-home-hero__calc {
        max-width: 100%;
        margin-left: 0;
        justify-self: stretch;
        padding-bottom: 32px;
    }

    .tf-page-home #calculator_container {
        margin-top: 0;
    }
}

/* Delivery method icons: Select2 list is appended to body, not the calculator panel */
.select2-dropdown .select2-results__option .img-flag {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 8px 0 0 !important;
    vertical-align: middle;
    object-fit: contain;
    visibility: visible !important;
    flex-shrink: 0;
}
.tf-page-home #calculator_container #rec_payment_method .select2-selection__rendered .img-flag,
.tf-page-home #calculator_container #rec_payment_method .select2-selection__rendered #icnflag {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 8px 0 0 !important;
    object-fit: contain;
    visibility: visible !important;
}
