/* Signup-only terms overlay — isolated from ClientArea Cart modal (#appTermsModal) */

.signup-terms-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 12, 28, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.signup-terms-overlay[hidden] {
    display: none !important;
}

.signup-terms-panel {
    width: 100%;
    max-width: 800px;
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    background: var(--auth-card-bg, #0f1535);
    border: 1px solid var(--auth-card-border, rgba(255, 255, 255, 0.12));
    border-radius: 1.25rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    color: var(--auth-text-primary, #f8faff);
    overflow: hidden;
}

.signup-terms-panel__header,
.signup-terms-panel__footer {
    flex-shrink: 0;
}

.signup-terms-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--auth-card-border, rgba(255, 255, 255, 0.12));
    background: linear-gradient(180deg, rgba(0, 19, 120, 0.12) 0%, transparent 100%);
}

.signup-terms-panel__header-text {
    min-width: 0;
}

.signup-terms-panel__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--auth-accent, #4f7cff);
    margin-bottom: 0.35rem;
}

.signup-terms-panel__badge .material-icons-outlined {
    font-size: 1rem;
}

.signup-terms-panel__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.5;
    word-break: break-word;
    color: var(--auth-text-primary, #f8faff);
}

.signup-terms-panel__header .btn-close {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

html[data-auth-theme="dark"] .signup-terms-panel__header .btn-close,
html[data-bs-theme="blue-theme"] .signup-terms-panel__header .btn-close {
    filter: var(--bs-btn-close-white-filter);
}

html[data-auth-theme="light"] .signup-terms-panel__header .btn-close,
html[data-bs-theme="light"] .signup-terms-panel__header .btn-close {
    filter: none;
}

.signup-terms-panel__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1.5rem 1.5rem;
}

.signup-terms-panel__content p {
    color: var(--auth-text-primary, #f8faff);
    line-height: 1.9;
    margin-bottom: 1rem;
}

.signup-terms-panel__content h2,
.signup-terms-panel__content h3,
.signup-terms-panel__content h4 {
    color: var(--auth-metallic-light, #e8eef7);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.signup-terms-panel__content h2:first-child,
.signup-terms-panel__content h3:first-child,
.signup-terms-panel__content h4:first-child {
    margin-top: 0;
}

.signup-terms-panel__content ul,
.signup-terms-panel__content ol {
    padding-right: 1.25rem;
    margin-bottom: 1rem;
    color: var(--auth-text-primary, #f8faff);
}

.signup-terms-panel__content a {
    color: var(--auth-accent, #4f7cff);
}

.signup-terms-panel__content .tac-note {
    background: rgba(255, 193, 7, 0.12);
    border-right: 4px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.signup-terms-panel__content .tac-note strong {
    color: #fbbf24;
}

.signup-terms-panel__error {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.signup-terms-panel__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--auth-card-border, rgba(255, 255, 255, 0.12));
    background: rgba(0, 0, 0, 0.12);
}

.signup-terms-panel__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--auth-text-muted, #94a3b8);
}

.signup-terms-panel__meta .material-icons-outlined {
    font-size: 1.1rem;
    opacity: 0.85;
}

html[data-auth-theme="light"] .signup-terms-overlay {
    background: rgba(15, 23, 42, 0.45);
}

html[data-auth-theme="light"] .signup-terms-panel__title {
    color: var(--auth-text-primary, #0a0f1c);
}

html[data-auth-theme="light"] .signup-terms-panel__content p,
html[data-auth-theme="light"] .signup-terms-panel__content li {
    color: var(--auth-text-primary, #0a0f1c);
}

html[data-auth-theme="light"] .signup-terms-panel__content h2,
html[data-auth-theme="light"] .signup-terms-panel__content h3,
html[data-auth-theme="light"] .signup-terms-panel__content h4 {
    color: var(--auth-metallic-light, #1a2338);
}

.js-signup-terms-trigger {
    cursor: pointer;
}

@media (max-width: 576px) {
    .signup-terms-overlay {
        padding: 0.65rem;
    }

    .signup-terms-panel {
        max-height: calc(100dvh - 1.3rem);
        border-radius: 1rem;
    }

    .signup-terms-panel__header,
    .signup-terms-panel__scroll,
    .signup-terms-panel__footer {
        padding-inline: 1rem;
    }
}
