/* Add Customer / KYC onboarding — scoped to page root */

.add-customer-kyc {
    padding-bottom: 0;
    margin-bottom: 0;
}

.add-customer-kyc .tab-content,
.add-customer-kyc .tab-pane.active {
    padding-bottom: 0;
    margin-bottom: 0;
}

.add-customer-kyc .tab-pane.active > *:last-child,
.add-customer-kyc form > *:last-child {
    margin-bottom: 0;
}

/*
 * Neutralize the global `.field-validation-valid` rule from `site.css`
 * (`position: absolute; bottom: -20px;`) only inside this page so:
 *  - empty valid spans collapse via `display: none` instead of being absolutely
 *    positioned 20px below the control (which produced ghost gaps and pushed
 *    later messages into the wrong slot when our JS wrote into them);
 *  - error messages always render in document flow under their field via the
 *    `.field-validation-error` class our JS toggles on writes.
 *
 * Other pages still use the absolute layout from `site.css`. Do NOT remove the
 * global rule — only override it here.
 */
.add-customer-kyc .field-validation-valid {
    position: static;
    bottom: auto;
    display: none;
}
.add-customer-kyc .field-validation-error {
    position: static;
    bottom: auto;
    display: block;
}

/* Invalid dropdowns: SumoSelect hides the native <select>, so the red border must sit on the
   visible wrapper's caption box. The validator's highlight/unhighlight mirrors is-invalid /
   input-validation-error onto `.SumoSelect`. */
.add-customer-kyc .SumoSelect.is-invalid > .CaptionCont,
.add-customer-kyc .SumoSelect.input-validation-error > .CaptionCont {
    border: 2px solid #dc3545;
}

/* Placeholders: small, subtle */
.add-customer-kyc .form-control::placeholder,
.add-customer-kyc textarea.form-control::placeholder {
    text-transform: none;
    color: #adb5bd;
    font-size: 0.625rem;
    opacity: 1;
}
.add-customer-kyc .maker-draft-action { cursor: pointer; font-size: 1.05rem; }
.add-customer-kyc .maker-draft-action:hover { opacity: 0.85; }

/* KYC stepper: no full-bleed line; connectors only between steps; validated = green tick */
#dvAddCustomerStepper {
    /* overflow-x: hidden; */
    max-width: 100%;
}
#dvAddCustomerStepper .kyc-stepper {
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}
#dvAddCustomerStepper .kyc-stepper::before,
#dvAddCustomerStepper .kyc-stepper .nav-link::before {
    display: none !important;
    content: none !important;
}
#dvAddCustomerStepper .kyc-stepper .nav-item {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    position: relative;
}
#dvAddCustomerStepper .kyc-stepper .nav-item.kyc-show-rail::after {
    content: "";
    position: absolute;
    top: 11px;
    left: calc(50% + 11px);
    right: calc(-50% + 11px);
    height: 2px;
    background: #d6d6d6;
    z-index: 0;
}
#dvAddCustomerStepper .kyc-stepper .nav-link {
    border: none;
    background: transparent !important;
    padding: 0;
}
#dvAddCustomerStepper .kyc-stepper .step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d6d6d6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    font-size: 11px;
}
#dvAddCustomerStepper .kyc-stepper .nav-link.active .step-dot {
    background: #1F4E79;
    color: #fff;
}
#dvAddCustomerStepper .kyc-stepper .nav-link.active .step-label {
    color: #1F4E79;
    font-weight: 600;
}
#dvAddCustomerStepper .kyc-stepper .nav-link.step-done .step-dot {
    background: #198754;
    color: #fff;
}
#dvAddCustomerStepper .kyc-stepper .nav-link.step-done .step-label {
    color: #198754;
    font-weight: 600;
}
#dvAddCustomerStepper .kyc-stepper .nav-link.step-incomplete .step-dot {
    background: #d9534f;
    color: #fff;
}
#dvAddCustomerStepper .kyc-stepper .nav-link.step-incomplete .step-label {
    color: #d9534f;
    font-weight: 600;
}
#dvAddCustomerStepper .kyc-stepper .step-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}
/* Every stepper tab is clickable; override the global .disable pointer-events block
   for tabs inside the wizard so the maker can jump between steps freely. */
#dvAddCustomerStepper .kyc-stepper .nav-link,
#dvAddCustomerStepper .kyc-stepper .nav-link.disable {
    pointer-events: auto !important;
    cursor: pointer;
}

/* Split file control — gray “Choose File” | white filename (single bordered control) */
.add-customer-kyc .kyc-split-file-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 0;
}
/* Row: split control + preview only (helper text sits below this row). */
.add-customer-kyc .kyc-split-file-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}
.add-customer-kyc .kyc-split-file-row__input {
    flex: 1 1 auto;
    min-width: 0;
}
.add-customer-kyc .kyc-split-file {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    min-height: calc(1.5em + 0.75rem + 2px);
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
}
.add-customer-kyc .kyc-split-file-wrap:has(input[type="file"].is-invalid) .kyc-split-file {
    border-color: #dc3545;
}
.add-customer-kyc .kyc-split-file__choose {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.375rem 0.875rem;
    background: #e9ecef;
    border: none;
    border-right: 1px solid #ced4da;
    font-size: 0.875rem;
    font-weight: 400;
    color: #212529;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
    line-height: 1.5;
}
.add-customer-kyc .kyc-split-file__choose:hover {
    background: #dee2e6;
}
/* Keyboard focus ring — the label is focusable (tabindex=0) so Tab + Enter opens the picker. */
.add-customer-kyc .kyc-split-file__choose:focus-visible {
    outline: 2px solid #1F4E79;
    outline-offset: -2px;
    background: #dee2e6;
}
.add-customer-kyc .kyc-split-file__name {
    flex: 1 1 auto;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* White strip: visually distinct from bg-light readonly fields; “Choose File” reads as the action */
    background-color: #fff;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    color: #212529;
    cursor: default;
}
.add-customer-kyc .kyc-split-file__name::placeholder {
    color: #6c757d;
    opacity: 1;
}
.add-customer-kyc .kyc-file-preview-btn {
    flex: 0 0 auto;
    align-self: stretch;
    width: calc(1.5em + 0.75rem + 2px);
    min-width: calc(1.5em + 0.75rem + 2px);
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    box-sizing: border-box;
}

/* Filename display (also used inside split control) */
.add-customer-kyc .kyc-file-path-display {
    min-width: 0;
    font-size: 0.875rem;
}

/* Initial page load: master dropdowns fetch (GetAllKycDropdownData + resume division) */
.add-customer-kyc-init-loader {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}
.add-customer-kyc-init-loader.d-none {
    display: none !important;
}
.add-customer-kyc-init-loader__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}
.add-customer-kyc-init-loader__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    filter: drop-shadow(0 0.15rem 0.35rem rgba(8, 70, 147, 0.18));
}

.add-customer-kyc-init-loader__spinner {
    width: 2.5rem;
    height: 2.5rem;
}

/* File rows, BO cards, loading overlay */
.add-customer-kyc .kyc-file-input { width: 89%; }
.add-customer-kyc .kyc-bo-surface { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 0.25rem; }
.maker-draft-panel-border { border-color: #dee2e6 !important; }
#makerDraftTableShell { min-height: 4rem; }
#makerDraftLoadingOverlay { top: 0; left: 0; z-index: 2; background: rgba(255, 255, 255, 0.72); }

.add-customer-kyc .kyc-bo-header { color: #084693; }

/* Modals + previews (some modals render outside .add-customer-kyc) */
.modal-dialog.kyc-preview-dialog { max-width: 700px; width: 100%; }
/* Clip the zoomed-in preview (img/iframe) to the modal so it can't spill over the rest of
   the page — the zoom/rotate controls resize the element beyond its normal box. */
#dvGSTDocViewImage .modal-body { max-height: 70vh; overflow: auto; -webkit-overflow-scrolling: touch; }
h5.kyc-modal-title-sm { font-size: 14px; }
h5.kyc-modal-title-md { font-size: 18px; }
p.kyc-pan-confirm-title { font-size: 14px; font-weight: 700; color: #073b76; }
.kyc-pan-confirm-scroll { max-height: 300px; overflow-y: auto; }
img.kyc-doc-preview, .kyc-doc-preview { max-width: 100%; width: 100%; max-height: 420px; }
.form-field {
    margin-bottom: .7rem;
}

/* Branch tab — locked location summary cards */
#dvBranchLocation .kyc-bo-sum-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: #5c6c7c;
    margin-bottom: 0.2rem;
}
#dvBranchLocation .kyc-bo-sum-value {
    font-size: 0.95rem;
    color: #1a2b3c;
    line-height: 1.35;
}
#dvBranchLocation .kyc-bo-nfo-section {
    letter-spacing: 0.02em;
}
#dvBranchLocation .kyc-bo-locked-card {
    border-color: rgba(0, 94, 120, 0.12) !important;
}
#dvBranchLocation.kyc-bo-single-locked .kyc-bo-locked-card {
    box-shadow: 0 0.35rem 1rem rgba(0, 80, 100, 0.07) !important;
}

/* Branch tab — active slot form: one less wrapper per field (col + .form-field merged) */
.add-customer-kyc #dvBranchLocation .kyc-bo-active-fields .row {
    --bs-gutter-y: 0.5rem;
}
.add-customer-kyc #dvBranchLocation .kyc-bo-active-fields .form-field > .form-label {
    margin-bottom: 0.25rem;
}

/* Related Party, GST registered, Branch type — pill radios (match .btn_primary / Form Number Generate: #0ab39c) */
.add-customer-kyc .related-party-pill-group,
.add-customer-kyc .gst-registered-pill-group,
.add-customer-kyc .bo-branch-type-pill-group,
.add-customer-kyc .meeting-type-pill-group,
.add-customer-kyc .meeting-with-pill-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.add-customer-kyc .related-party-pill-item,
.add-customer-kyc .gst-registered-pill-item,
.add-customer-kyc .bo-branch-type-pill-item,
.add-customer-kyc .meeting-type-pill-item,
.add-customer-kyc .meeting-with-pill-item {
    position: relative;
}
.add-customer-kyc .bo-branch-type-pill-group {
    justify-content: flex-start;
}
.add-customer-kyc .radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid #cccccc;
    color: #6c757d;
    background-color: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.add-customer-kyc .radio-pill .radio-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #cccccc;
    background-color: transparent;
    box-sizing: border-box;
    box-shadow: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.add-customer-kyc .radio-pill .radio-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}
/* Selected: teal body (.btn_primary), white dot + label, thin darker border */
.add-customer-kyc .radio-pill.active {
    border: 1px solid #087a6a;
    color: #fff;
    background-color: #0ab39c;
}
/* Selected dot: fill = pill border (#087a6a), white ring, dark green outer ring */
.add-customer-kyc .radio-pill.active .radio-dot {
    border: 2px solid #fff;
    background-color: #087a6a;
    box-shadow: 0 0 0 2px #065f52;
}
.add-customer-kyc .radio-pill:focus-visible {
    outline: 2px solid rgba(10, 179, 156, 0.45);
    outline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────────
   Field-level validation toasts (Final Submit feedback)
   One toast per missing/invalid field, auto-dismiss after 5 seconds.
   ────────────────────────────────────────────────────────────────── */
.kyc-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 360px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    pointer-events: none;
}
.kyc-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    background-color: #fdecec;
    border: 1px solid #f5c2c2;
    border-left: 4px solid #d9534f;
    color: #842029;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: 0.85rem;
    line-height: 1.3;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.kyc-toast--show {
    opacity: 1;
    transform: translateX(0);
}
.kyc-toast__icon {
    flex: 0 0 auto;
    font-size: 0.95rem;
    line-height: 1.3;
}
.kyc-toast__msg {
    flex: 1 1 auto;
    word-break: break-word;
}
.kyc-toast__close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0;
    margin-left: 0.25rem;
    cursor: pointer;
    opacity: 0.7;
}
.kyc-toast__close:hover {
    opacity: 1;
}
