/* Upgrade / sign-in dialog for plan limits (assets/js/access.js) and locked states. */
.bambu-access-modal[hidden] {
    display: none;
}

.bambu-access-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bambu-access-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 14, 33, 0.6);
    opacity: 0;
    transition: opacity 180ms ease;
}

.bambu-access-dialog {
    position: relative;
    width: 420px;
    max-width: 100%;
    padding: 36px 32px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px -28px rgba(5, 14, 33, 0.5);
    text-align: center;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 180ms ease-out, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bambu-access-modal.is-open .bambu-access-backdrop {
    opacity: 1;
}

.bambu-access-modal.is-open .bambu-access-dialog {
    opacity: 1;
    transform: none;
}

.bambu-access-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background-color 160ms ease-out;
}

.bambu-access-x::before,
.bambu-access-x::after {
    content: "";
    position: absolute;
    top: 15px;
    left: 9px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: #64748b;
    transform: rotate(45deg);
}

.bambu-access-x::after {
    transform: rotate(-45deg);
}

.bambu-access-x:hover {
    background: #f1f5f9;
}

/* Padlock: pops in, gives one "locked" wiggle, and a single ring spreads from it. */
.bambu-access-icon {
    position: relative;
    display: inline-flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #f0fdfa;
    box-shadow: inset 0 0 0 1px #ccfbf1;
    color: #0f766e;
}

.bambu-access-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(59, 162, 149, 0.35);
    opacity: 0;
}

.bambu-access-icon svg {
    overflow: visible;
}

.bambu-access-shackle,
.bambu-access-body {
    transform-box: fill-box;
}

.bambu-access-shackle {
    transform-origin: 85% 100%;
}

.bambu-access-body {
    transform-origin: 50% 0;
}

.bambu-access-modal.is-open .bambu-access-icon {
    animation: bambu-access-pop 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bambu-access-modal.is-open .bambu-access-icon::after {
    animation: bambu-access-ring 900ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both;
}

.bambu-access-modal.is-open .bambu-access-icon svg {
    animation: bambu-access-wiggle 520ms cubic-bezier(0.36, 0, 0.2, 1) 300ms both;
}

.bambu-access-modal.is-open .bambu-access-shackle {
    animation: bambu-access-shackle 520ms cubic-bezier(0.36, 0, 0.2, 1) 300ms both;
}

@keyframes bambu-access-pop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: none; }
}

@keyframes bambu-access-ring {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 162, 149, 0.35); }
    100% { opacity: 0; box-shadow: 0 0 0 14px rgba(59, 162, 149, 0); }
}

@keyframes bambu-access-wiggle {
    0%, 100% { transform: none; }
    20% { transform: rotate(-9deg); }
    45% { transform: rotate(7deg); }
    70% { transform: rotate(-3deg); }
}

/* The shackle tugs up as if someone tried to open it, then drops back. */
@keyframes bambu-access-shackle {
    0%, 100% { transform: none; }
    30% { transform: translateY(-2.5px); }
    60% { transform: translateY(0.5px); }
}

.bambu-access-title {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.bambu-access-message {
    margin: 0 auto 24px;
    max-width: 34ch;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
    text-wrap: pretty;
}

.bambu-access-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bambu-access-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 9999px;
    background: linear-gradient(90deg, #43B263 0%, #3BA295 50%, #3B7AB5 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px -12px rgba(15, 118, 110, 0.7);
    transition: transform 160ms ease-out, box-shadow 160ms ease-out, filter 160ms ease-out;
}

.bambu-access-cta-arrow {
    transition: transform 160ms ease-out;
}

.bambu-access-cta:hover,
.bambu-access-cta:focus-visible,
.bambu-access-lock a.bambu-access-cta,
.bambu-access-dialog a.bambu-access-cta {
    color: #fff;
}

.bambu-access-cta:hover,
.bambu-access-cta:focus-visible {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -12px rgba(15, 118, 110, 0.8);
}

.bambu-access-cta:hover .bambu-access-cta-arrow,
.bambu-access-cta:focus-visible .bambu-access-cta-arrow {
    transform: translateX(3px);
}

.bambu-access-cta:focus-visible,
.bambu-access-later:focus-visible,
.bambu-access-x:focus-visible {
    outline: 2px solid #3BA295;
    outline-offset: 3px;
}

.bambu-access-later {
    padding: 10px;
    border: 0;
    border-radius: 9999px;
    background: none;
    color: #64748b;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 160ms ease-out;
}

.bambu-access-later:hover {
    color: #0f172a;
}

body.bambu-access-open {
    overflow: hidden;
}

/* Locked controls: a small padlock after the label. */
[data-access-prompt].filter-btn::after,
.bambu-access-locked-label::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    vertical-align: -1px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1zm2 0h6V7a3 3 0 0 0-6 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1zm2 0h6V7a3 3 0 0 0-6 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Locked part of a page (profile details, submission form…). */
.bambu-access-lock {
    position: relative;
    margin: 24px 0;
    padding: 32px 28px;
    border: 1px solid #d1fae5;
    border-radius: 18px;
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 60%, #eff6ff 100%);
    text-align: center;
}

.bambu-access-lock h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 19px;
}

.bambu-access-lock p {
    margin: 0 auto 18px;
    max-width: 520px;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
}

.bambu-access-lock .bambu-access-cta {
    display: inline-block;
    padding: 11px 26px;
}

/* "7 of 10 full profiles left this month" */
.bambu-access-meter {
    display: flex;
    width: fit-content;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: #f0fdf4;
    color: #047857;
    font-size: 13px;
    font-weight: 600;
}

.bambu-access-meter a {
    color: #3B7AB5;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .bambu-access-dialog {
        padding: 32px 20px 20px;
    }

    .bambu-access-lock {
        padding: 24px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bambu-access-backdrop,
    .bambu-access-dialog,
    .bambu-access-cta,
    .bambu-access-cta-arrow {
        transition: none;
    }

    .bambu-access-modal.is-open .bambu-access-icon,
    .bambu-access-modal.is-open .bambu-access-icon::after,
    .bambu-access-modal.is-open .bambu-access-icon svg,
    .bambu-access-modal.is-open .bambu-access-shackle {
        animation: none;
    }
}
