﻿/* Scoped modal step transitions; supports Home and Maps vendor CSS */
#authModal .tab-content > .tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

    #authModal .tab-content > .tab-pane.active {
        display: block;
    }

        #authModal .tab-content > .tab-pane.active.show {
            opacity: 1;
            transform: translateY(0);
        }

#authModal .auth-submit:disabled {
    opacity: .72;
    cursor: wait;
}

#authModal .auth-input:focus {
    outline-offset: 2px;
}

#authModal #authAlert:not(.d-none) {
    animation: authNoticeIn .2s ease-out;
}

@keyframes authNoticeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #authModal .tab-content > .tab-pane {
        transition: none;
        transform: none;
    }

    #authModal #authAlert:not(.d-none) {
        animation: none;
    }
}

/* Keep Bootstrap button states in the original navy palette. */
#profileModal .btn-primary {
    --bs-btn-bg: var(--bs-dark, #0b1f3a);
    --bs-btn-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-hover-bg: var(--deep-panel, #102c4e);
    --bs-btn-hover-border-color: var(--deep-panel, #102c4e);
    --bs-btn-active-bg: var(--bs-dark, #0b1f3a);
    --bs-btn-active-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-disabled-bg: var(--bs-dark, #0b1f3a);
    --bs-btn-disabled-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-focus-shadow-rgb: 11, 31, 58;
}
#profileModal .btn-outline-primary {
    --bs-btn-color: var(--bs-dark, #0b1f3a);
    --bs-btn-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-hover-bg: var(--bs-dark, #0b1f3a);
    --bs-btn-hover-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-active-bg: var(--bs-dark, #0b1f3a);
    --bs-btn-active-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-disabled-color: var(--bs-dark, #0b1f3a);
    --bs-btn-disabled-border-color: var(--bs-dark, #0b1f3a);
    --bs-btn-focus-shadow-rgb: 11, 31, 58;
}

/* Reserve the page scrollbar space while Bootstrap locks modal scrolling. */
html {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}
.modal {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}
html::-webkit-scrollbar,
.modal::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
html::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
    background: #f1f5f9;
}
html::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border: 2px solid #f1f5f9;
    border-radius: 8px;
}
html::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
@supports (scrollbar-gutter: stable) {
    body.modal-open,
    body.modal-open #siteNav {
        padding-right: 0 !important;
    }
    .modal {
        scrollbar-gutter: stable;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Các thao tác trong modal là button, giữ giao diện liên kết. */
.auth-modal button.auth-link-sm {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    line-height: inherit;
    color: var(--bs-primary, #0d6efd);
    cursor: pointer;
    text-align: inherit;
}
.auth-modal button.auth-link-sm:hover { text-decoration: underline; }
.auth-modal button.auth-link-sm:focus-visible { outline: 2px solid #315b94; outline-offset: 4px; border-radius: 2px; }
.auth-modal button.auth-link-sm:disabled { cursor: default; text-decoration: none; }
