/* Shared compact controls for customer-facing storefront and authentication forms. */
body.f2n-storefront input.form-control,
body.f2n-storefront select.form-control:not([multiple]):not([size]),
body.f2n-storefront select.form-select:not([multiple]):not([size]),
body.f2n-storefront .form-control.file-amount,
body.f2n-storefront .bootstrap-select > .dropdown-toggle,
body.f2n-storefront .input-group-text,
body.f2n-auth input.form-control,
body.f2n-auth select.form-control:not([multiple]):not([size]),
body.f2n-auth select.form-select:not([multiple]):not([size]),
body.f2n-auth .form-control.file-amount,
body.f2n-auth .bootstrap-select > .dropdown-toggle,
body.f2n-auth .input-group-text {
    min-height: 40px;
    height: 40px;
    padding: 6px 12px;
    line-height: 1.35;
}

/* Bootstrap Select positions its displayed value independently of the button. */
body.f2n-storefront .bootstrap-select > .dropdown-toggle .filter-option,
body.f2n-storefront .bootstrap-select > .dropdown-toggle .filter-option-inner,
body.f2n-auth .bootstrap-select > .dropdown-toggle .filter-option,
body.f2n-auth .bootstrap-select > .dropdown-toggle .filter-option-inner {
    display: flex;
    height: 100%;
    align-items: center;
}

body.f2n-storefront .bootstrap-select > .dropdown-toggle .filter-option-inner-inner,
body.f2n-auth .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
    width: 100%;
    line-height: 1.35;
}

/* Keep unselected dropdown prompts visually consistent with input placeholders. */
body.f2n-storefront .bootstrap-select > .dropdown-toggle.bs-placeholder,
body.f2n-storefront .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner,
body.f2n-auth .bootstrap-select > .dropdown-toggle.bs-placeholder,
body.f2n-auth .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner,
body.f2n-storefront select.form-control:required:invalid,
body.f2n-storefront select.form-select:required:invalid,
body.f2n-auth select.form-control:required:invalid,
body.f2n-auth select.form-select:required:invalid {
    font-weight: 400 !important;
}

body.f2n-storefront textarea.form-control,
body.f2n-storefront select.form-control[multiple],
body.f2n-storefront select.form-control[size],
body.f2n-storefront select.form-select[multiple],
body.f2n-storefront select.form-select[size],
body.f2n-auth textarea.form-control,
body.f2n-auth select.form-control[multiple],
body.f2n-auth select.form-control[size],
body.f2n-auth select.form-select[multiple],
body.f2n-auth select.form-select[size] {
    padding: 6px 12px;
    line-height: 1.35;
}

body.f2n-storefront .input-group-prepend > .btn,
body.f2n-storefront .input-group-append > .btn,
body.f2n-auth .input-group-prepend > .btn,
body.f2n-auth .input-group-append > .btn {
    min-height: 40px;
    height: 40px;
    padding: 6px 12px;
    line-height: 1.35;
}

body.f2n-storefront .form-control.file-amount,
body.f2n-auth .form-control.file-amount {
    display: flex;
    align-items: center;
}

/* Consistent motion and feedback for storefront and authentication actions. */
body.f2n-storefront button,
body.f2n-storefront .btn,
body.f2n-auth button,
body.f2n-auth .btn {
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease,
        border-color .18s ease, color .18s ease, opacity .18s ease;
}

body.f2n-storefront button:not(:disabled):hover,
body.f2n-storefront .btn:not(:disabled):hover,
body.f2n-auth button:not(:disabled):hover,
body.f2n-auth .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(62, 39, 28, .14);
}

body.f2n-storefront button:not(:disabled):active,
body.f2n-storefront .btn:not(:disabled):active,
body.f2n-auth button:not(:disabled):active,
body.f2n-auth .btn:not(:disabled):active {
    transform: translateY(0) scale(.98);
    box-shadow: 0 3px 9px rgba(62, 39, 28, .12);
}

body.f2n-storefront button:focus-visible,
body.f2n-storefront .btn:focus-visible,
body.f2n-auth button:focus-visible,
body.f2n-auth .btn:focus-visible {
    outline: 3px solid rgba(23, 105, 170, .28);
    outline-offset: 2px;
}

body.f2n-storefront .f2n-is-loading,
body.f2n-auth .f2n-is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    cursor: wait !important;
    opacity: .88;
}

.f2n-button-spinner,
.auth-submit-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: f2n-button-spin .65s linear infinite;
}

@keyframes f2n-button-spin {
    to { transform: rotate(360deg); }
}

/* One accessible password control per field; native reveal controls are hidden. */
body.f2n-storefront input[data-f2n-password="true"]::-ms-reveal,
body.f2n-storefront input[data-f2n-password="true"]::-ms-clear,
body.f2n-storefront input[data-f2n-password="true"]::-webkit-credentials-auto-fill-button,
body.f2n-storefront input[data-f2n-password="true"]::-webkit-textfield-decoration-container,
body.f2n-auth input[data-f2n-password="true"]::-ms-reveal,
body.f2n-auth input[data-f2n-password="true"]::-ms-clear,
body.f2n-auth input[data-f2n-password="true"]::-webkit-credentials-auto-fill-button,
body.f2n-auth input[data-f2n-password="true"]::-webkit-textfield-decoration-container {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.f2n-password-field {
    position: relative;
}

body.f2n-storefront .f2n-password-field > .form-control,
body.f2n-auth .f2n-password-field > .form-control {
    padding-right: 3rem !important;
}

.f2n-password-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    z-index: 3;
    display: inline-flex;
    width: 2.35rem;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    transform: translateY(-50%) !important;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b5e56;
    font-size: 1.2rem;
    line-height: 1;
    box-shadow: none !important;
}

.f2n-password-toggle:hover {
    transform: translateY(-50%) scale(1.05) !important;
    background: rgba(75, 38, 24, .08) !important;
    color: #2b211c;
}

.f2n-password-toggle:active {
    transform: translateY(-50%) scale(.95) !important;
}

[dir="rtl"] .f2n-password-field > .form-control {
    padding-right: .75rem !important;
    padding-left: 3rem !important;
}

[dir="rtl"] .f2n-password-toggle {
    right: auto;
    left: .35rem;
}

@media (prefers-reduced-motion: reduce) {
    body.f2n-storefront button,
    body.f2n-storefront .btn,
    body.f2n-auth button,
    body.f2n-auth .btn,
    .f2n-password-toggle {
        transition: none;
    }

    .f2n-button-spinner,
    .auth-submit-spinner {
        animation-duration: 1.2s;
    }
}

/* --- Sectioned forms (customer KYC / encashment bank) --------------------
   Long verification forms are grouped with real <fieldset>/<legend> so the
   grouping is announced to screen readers, not just drawn. Bootstrap's reboot
   makes a legend full-width and float-free already, but it also scales its
   font, so the size is restated here. */
body.f2n-storefront .f2n-form-section {
    margin: 0 0 12px;
    padding: 13px 15px 1px;
    border: 1px solid #e7ded1;
    border-radius: 14px;
    background: #fff;
}

body.f2n-storefront .f2n-form-section:last-of-type {
    margin-bottom: 12px;
}

/* A <legend> renders in the fieldset's border area. Bootstrap's reboot floats
   it at width 100%, which is what keeps it inside the padding box - so the
   float has to survive here, and the flex layout goes on an inner span
   instead. Setting display:flex on the legend itself drops the float and the
   header escapes above the card. */
body.f2n-storefront .f2n-form-section-legend {
    float: left;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 0 10px;
    border-bottom: 1px solid #f0e8dd;
    font-size: inherit;
    line-height: 1.4;
}

body.f2n-storefront .f2n-form-legend-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Clear the floated legend so the field grid starts below it. */
body.f2n-storefront .f2n-form-section > .row {
    clear: both;
}

/* Step chip. Decorative - the legend text carries the meaning, and the chip
   is aria-hidden in the markup. */
body.f2n-storefront .f2n-form-step {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fbe9e3;
    color: #c1442a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

body.f2n-storefront .f2n-form-section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 0;
}

body.f2n-storefront .f2n-form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #241a15;
}

body.f2n-storefront .f2n-form-section-meta {
    font-size: 12px;
    font-weight: 600;
    color: #93857b;
    letter-spacing: 0.02em;
}

body.f2n-storefront .f2n-form-section-hint {
    flex: 1 1 100%;
    font-size: 13px;
    color: #6a5b52;
}

/* Consent line and submit share one footer block so the action never floats
   directly against the last field. */
body.f2n-storefront .f2n-form-submit {
    padding: 14px 15px;
    border: 1px solid #e7ded1;
    border-radius: 14px;
    background: #f8f5f0;
}

body.f2n-storefront .f2n-form-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #4a3f38;
    cursor: pointer;
}

body.f2n-storefront .f2n-form-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 2px;
}

body.f2n-storefront .f2n-form-submit .btn {
    width: 100%;
}

@media (min-width: 576px) {
    body.f2n-storefront .f2n-form-submit .btn {
        width: auto;
        min-width: 220px;
    }
}

@media (max-width: 575px) {
    body.f2n-storefront .f2n-form-section {
        padding: 14px 14px 2px;
    }

    body.f2n-storefront .f2n-form-section-legend {
        gap: 10px;
        margin-bottom: 13px;
        padding-bottom: 11px;
    }

    body.f2n-storefront .f2n-form-submit {
        padding: 14px;
    }
}


/* --- Compact density for the KYC form -----------------------------------
   Scoped to .f2n-kyc-form rather than the shared control rules above, so
   trimming this long form does not shrink every storefront form. */
body.f2n-storefront .f2n-kyc-form .form-group {
    margin-bottom: 11px;
}

body.f2n-storefront .f2n-kyc-form label {
    margin-bottom: 3px;
    font-size: 13px;
    line-height: 1.35;
}

body.f2n-storefront .f2n-kyc-form input.form-control,
body.f2n-storefront .f2n-kyc-form select.form-control:not([multiple]):not([size]),
body.f2n-storefront .f2n-kyc-form .bootstrap-select > .dropdown-toggle {
    min-height: 36px;
    height: 36px;
    padding: 4px 11px;
}

body.f2n-storefront .f2n-kyc-form textarea.form-control {
    min-height: 58px;
    padding: 6px 11px;
}

/* Field-level helper and error text should sit against its input, not open
   another gap before the next field. */
body.f2n-storefront .f2n-kyc-form .form-group > small,
body.f2n-storefront .f2n-kyc-form .form-group > .text-danger {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
}

/* Upload guidance for the section it belongs to. */
body.f2n-storefront .f2n-kyc-form .f2n-upload-note {
    margin: 2px 0 9px;
    padding-top: 9px;
    border-top: 1px dashed #e7ded1;
    font-size: 12px;
    line-height: 1.4;
    color: #6a5b52;
}

body.f2n-storefront .f2n-kyc-form .f2n-upload-field .form-control-file {
    width: 100%;
    padding: 6px 0 0;
    font-size: 13px;
}

body.f2n-storefront .f2n-form-submit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

body.f2n-storefront .f2n-form-privacy {
    font-size: 12px;
    line-height: 1.4;
    color: #6a5b52;
}

/* --- Label help affordance ----------------------------------------------
   Long field guidance moves out of the flow and behind a help icon aligned to
   the right of its label, so the form stays tight. The bubble itself is the
   theme's Bootstrap tooltip. */
body.f2n-storefront .f2n-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

body.f2n-storefront .f2n-label-row label {
    margin-bottom: 0;
}

body.f2n-storefront .f2n-help-btn {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    padding: 0;
    border: 1px solid #dbcfc1;
    border-radius: 999px;
    background: #f8f5f0;
    color: #6a5b52;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body.f2n-storefront .f2n-help-btn:hover,
body.f2n-storefront .f2n-help-btn:focus-visible {
    background: #fbe9e3;
    border-color: #c1442a;
    color: #c1442a;
    outline: none;
}

body.f2n-storefront .f2n-help-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(193, 68, 42, 0.18);
}

/* On touch the icon is opened by tapping, so the hit area is expanded past
   the 19px glyph without disturbing the label's layout. */
@media (pointer: coarse) {
    body.f2n-storefront .f2n-help-btn::before {
        content: "";
        position: absolute;
        inset: -10px;
    }
}

/* Bubble, restyled from the theme's default. aiz-core.css sets
   .tooltip-inner's background with !important on a single-class selector, so
   specificity alone does not win here. */
body.f2n-storefront .tooltip .tooltip-inner {
    max-width: 260px;
    padding: 8px 11px;
    border-radius: 9px;
    background: #2b1710 !important;
    color: #fdf6ef !important;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
}

body.f2n-storefront .tooltip .arrow::before {
    border-top-color: #2b1710 !important;
    border-bottom-color: #2b1710 !important;
}

body.f2n-storefront .tooltip.show {
    opacity: 1;
}
