/* "A few details before you pay" GST/address compliance modal
   (Bim_ProductPurchase's buy-button.js -> openProfileModal). Loaded site-wide
   since the Buy Now / Pay button that opens it lives on both the PDP and the
   cart page. Previously had no CSS of its own at all -- plain Magento .field /
   label / .input-text markup inside the stock modal chrome.

   Scoped via the modal widget's own `modalClass: 'bim-pp-profile-popup'` option
   (set in buy-button.js) rather than guessing at an ancestor selector, since the
   header/footer are DOM siblings of the form, not descendants of it. */

.modal-popup.bim-pp-profile-popup {
    --pp-ink: #111827;
    --pp-muted: #52596b;
    --pp-border: #e3e6ee;
    --pp-light: #f6f7fa;
    --pp-blue: #0030b8;
}

.modal-popup.bim-pp-profile-popup .modal-inner-wrap {
    max-width: 640px !important;
    border-radius: 12px !important;
    box-shadow: 0 24px 64px rgba(17, 24, 39, 0.22) !important;
}

/* Header: flat, set off from the body by a tone step rather than a hairline rule */
.modal-popup.bim-pp-profile-popup .modal-header {
    padding: 26px 32px 18px !important;
    background: #ffffff;
}
.modal-popup.bim-pp-profile-popup .modal-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--pp-ink);
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.modal-popup.bim-pp-profile-popup .action-close {
    top: 20px !important;
    right: 20px !important;
    padding: 10px !important;
}
.modal-popup.bim-pp-profile-popup .action-close:before {
    color: var(--pp-muted) !important;
    font-size: 20px !important;
}
.modal-popup.bim-pp-profile-popup .action-close:hover:before {
    color: var(--pp-ink) !important;
}

.modal-popup.bim-pp-profile-popup .modal-content {
    padding: 4px 32px 8px !important;
    background: var(--pp-light);
}

.bim-pp-profile-modal .bim-pp-profile-error {
    background: #fdecc8;
    color: #7a4a00;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 600;
}

.bim-pp-profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    padding: 18px 0 4px;
}
.bim-pp-profile-form .field {
    margin: 0;
}
.bim-pp-profile-form .field--full {
    grid-column: 1 / -1;
}

.bim-pp-profile-form .field > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pp-ink);
    margin-bottom: 6px;
}
.bim-pp-profile-form .field.required > label:after {
    content: '*';
    color: #d1403f;
    margin-left: 4px;
}
.bim-pp-profile-form .field .note {
    font-size: 12px;
    color: var(--pp-muted);
    margin: 6px 0 0;
}

.bim-pp-profile-form .input-text,
.bim-pp-profile-form select.input-text {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--pp-border) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: var(--pp-ink);
    font-size: 14px;
    box-sizing: border-box;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
}
.bim-pp-profile-form .input-text:focus,
.bim-pp-profile-form select.input-text:focus {
    outline: none;
    border-color: var(--pp-blue) !important;
    box-shadow: 0 0 0 3px rgba(0, 48, 184, 0.14) !important;
}

/* GST block: a flat tone step, not a hairline box */
.bim-pp-profile-form .bim-pp2-gst-block {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
}
.bim-pp-profile-form .field.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
}
.bim-pp-profile-form .field.choice input[type="checkbox"] {
    margin: 3px 0 0;
    width: 16px;
    height: 16px;
    accent-color: var(--pp-blue);
    flex-shrink: 0;
}
.bim-pp-profile-form .field.choice label {
    margin: 0;
    font-weight: 500;
    font-size: 13px;
    color: var(--pp-ink);
}
.bim-pp-profile-form .bim-pp2-gst-registered-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 16px;
    margin-top: 16px;
}

/* Footer: flat, separated by the same tone step as the content area, no border line */
.modal-popup.bim-pp-profile-popup .modal-footer {
    padding: 18px 32px 28px !important;
    background: var(--pp-light);
    margin: 0 !important;
    text-align: left !important;
}
.modal-popup.bim-pp-profile-popup .modal-footer button {
    height: 48px;
    padding: 0 24px;
    border: none !important;
    border-radius: 8px;
    background: var(--pp-blue) !important;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: filter .2s, transform .15s;
}
.modal-popup.bim-pp-profile-popup .modal-footer button span {
    color: #ffffff;
}
.modal-popup.bim-pp-profile-popup .modal-footer button:hover,
.modal-popup.bim-pp-profile-popup .modal-footer button:focus-visible {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.modal-popup.bim-pp-profile-popup .modal-footer button:focus-visible {
    outline: 3px solid var(--pp-blue);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .modal-popup.bim-pp-profile-popup .modal-inner-wrap {
        width: 92% !important;
        max-width: 92% !important;
    }
    .bim-pp-profile-form,
    .bim-pp-profile-form .bim-pp2-gst-registered-fields {
        grid-template-columns: 1fr;
    }
    .modal-popup.bim-pp-profile-popup .modal-header,
    .modal-popup.bim-pp-profile-popup .modal-content,
    .modal-popup.bim-pp-profile-popup .modal-footer {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    .modal-popup.bim-pp-profile-popup .modal-header {
        padding-right: 52px !important;
    }
    .modal-popup.bim-pp-profile-popup .modal-title {
        font-size: 18px;
    }
    .modal-popup.bim-pp-profile-popup .action-close {
        top: 18px !important;
        right: 14px !important;
    }
}
