:root {
    --bg: #0b1220;
    --panel: #0f172a;
    --muted: #94a3b8;
    --text: #e5e7eb;
    --accent: #f59e0b;
    --accent2: #3b82f6;
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.navbar {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    margin-bottom: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.btn {
    border-radius: 12px;
}

.navbar .btn {
    border-radius: 9999px;
}

.nav-glass {
    backdrop-filter: saturate(140%) blur(6px);
}

.nav-logo {
    height: 34px;
    width: auto;
    display: block;
}

.navbar .nav-link {
    color: var(--text) !important;
    opacity: .85;
}

.navbar .nav-link:hover {
    color: #fff !important;
    opacity: 1;
}

/* Active nav link highlight */
.navbar .nav-link.active {
    color: #fff !important;
    opacity: 1;
    background: rgba(59, 130, 246, .15);
    border-radius: 9999px;
    padding-left: 10px;
    padding-right: 10px;
}

.navbar .nav-link .fa {
    opacity: .9;
}

.btn-orange {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #111827 !important;
}

.btn-orange:hover {
    filter: brightness(0.95);
}

/* Navbar buttons - subtle glow */
.navbar .btn:hover,
.navbar .btn:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}

.btn-blue {
    background: var(--accent2) !important;
    border-color: var(--accent2) !important;
    color: #fff !important;
}

.btn-blue:hover {
    filter: brightness(0.95);
}

.btn-outline-blue {
    border-color: var(--accent2) !important;
    color: var(--accent2) !important;
    background: transparent !important;
}

.btn-outline-blue:hover {
    background: var(--accent2) !important;
    color: #fff !important;
}

.btn-outline-orange {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: transparent !important;
}

.btn-outline-orange:hover {
    background: var(--accent) !important;
    color: #111827 !important;
}

a {
    color: var(--accent2);
}

a:hover {
    color: #60a5fa;
}

.public-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.public-content {
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.public-footer {
    border-top: 1px solid rgba(255, 255, 255, .06);
    color: var(--muted);
}

/* Wider container for external pages (50% larger than Bootstrap defaults) */
@media (min-width: 576px) {
    .container {
        max-width: 810px;
    }
}

/* 540 * 1.5 */
@media (min-width: 768px) {
    .container {
        max-width: 1080px;
    }
}

/* 720 * 1.5 */
@media (min-width: 992px) {
    .container {
        max-width: 1440px;
    }
}

/* 960 * 1.5 */
@media (min-width: 1200px) {
    .container {
        max-width: 1710px;
    }
}

/* 1140 * 1.5 */
@media (min-width: 1400px) {
    .container {
        max-width: 1980px;
    }
}

/* 1320 * 1.5 */

/* Landing specific */
.hero-dark {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    height: 100%;
    padding: 24px;
    gap: 24px;
}

@media (min-width: 1200px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

.hero-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.hero-side {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.sc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    color: #e5e7eb;
}

.sc-title {
    font-weight: 700;
    letter-spacing: .02em;
}

.sc-chart {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.sc-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.sc-chat-log {
    flex: 1;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 10px;
    padding: 10px;
    background: #0b1220;
}

.sc-chat-input {
    display: flex;
    gap: 8px;
}

.sc-chat-input .form-control {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}

.badge-accent {
    background: #f59e0b;
    color: #111827;
}

.btn-accent {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #111827;
}

.btn-alt {
    border-color: #3b82f6;
    color: #3b82f6;
}

.note-muted {
    color: #94a3b8;
}

.chip {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: .75rem;
    color: #e5e7eb;
}

/* Public SmartChart dark overrides */
.public-smartchart .smart-chart-glass {
    background: transparent !important;
}

.public-smartchart .smart-select {
    background: #0b1220 !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
}

.public-smartchart .smart-select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .25) !important;
}

.public-smartchart .smart-toolbar .btn {
    background: #0b1220 !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
}

.public-smartchart .smart-chat-card {
    background: #0f172a !important;
    border-color: #1f2937 !important;
}

.public-smartchart #scChart {
    background: transparent !important;
}

/* Select2 dark theme overrides */
.chatbot-dark .select2-container--bootstrap-5 .select2-selection,
.chatbot-dark .select2-container--default .select2-selection--single,
.chatbot-dark .select2-container--default .select2-selection--multiple {
    background-color: #0b1220 !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
}

.chatbot-dark .select2-container--bootstrap-5 .select2-selection__rendered,
.chatbot-dark .select2-container--default .select2-selection__rendered {
    color: #e5e7eb !important;
}

.chatbot-dark .select2-container--bootstrap-5 .select2-selection__placeholder,
.chatbot-dark .select2-container--default .select2-selection__placeholder {
    color: #94a3b8 !important;
}

.chatbot-dark .select2-dropdown,
.chatbot-dark .select2-container .select2-dropdown {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
}

.chatbot-dark .select2-results__option {
    color: #e5e7eb !important;
}

.chatbot-dark .select2-results__option--highlighted {
    background-color: var(--accent2) !important;
    color: #ffffff !important;
}

.chatbot-dark .select2-search--dropdown .select2-search__field {
    background: #0b1220 !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
}

/* Promo widget (typewriter) */
.cb-promo {
    border: none;
    border-radius: 0;
    padding: 6px 0;
    margin-bottom: 10px;
    background: transparent;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    height: 32px;
}

.cb-promo .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 8px rgba(59, 130, 246, .6);
}

.cb-promo .text {
    font-size: 1.1rem;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
}

.cb-promo .cursor {
    display: inline-block;
    width: 8px;
    background: #e5e7eb;
    animation: blink 1s steps(2, start) infinite;
    margin-left: 2px;
}

@keyframes blink {
    to {
        visibility: hidden;
    }
}

/* Auth forms */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 120px);
}

.auth-card {
    width: 100%;
    max-width: 520px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #0f172a;
    border-radius: 12px;
    padding: 20px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    /* room for thin scrollbar */
}

.auth-card h3 {
    margin: 0 0 8px 0;
    color: #e5e7eb;
}

.auth-sub {
    color: #94a3b8;
    margin-bottom: 14px;
}

.auth-field {
    margin-bottom: 10px;
}

.auth-field .form-control {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.auth-link {
    color: #93c5fd;
}

.auth-link:hover {
    color: #bfdbfe;
}

/* Light scrollbars for auth card */
.auth-card::-webkit-scrollbar {
    width: 6px;
}

.auth-card::-webkit-scrollbar-track {
    background: #0b1220;
}

.auth-card::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 3px;
}

.auth-card:hover::-webkit-scrollbar-thumb {
    background: #334155;
}

.or-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    margin: 10px 0;
}

.or-line .bar {
    flex: 1;
    height: 1px;
    background: #1f2937;
}

.btn-google {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #1f2937 !important;
}

.btn-google:hover {
    filter: brightness(0.95);
}

/* Register split layout */
.auth-split {
    display: flex;
    gap: 24px;
    align-items: stretch;
    height: calc(100vh - 120px);
}

.auth-split .reg-pane {
    flex: 1;
    display: flex;
}

.auth-split .reg-left {
    border: 1px solid rgba(255, 255, 255, .08);
    background: radial-gradient(800px 300px at 80% -10%, rgba(59, 130, 246, .12), transparent), #0f172a;
    border-radius: 12px;
}

.auth-split .reg-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.reg-left-inner {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.reg-left h2 {
    color: #e5e7eb;
    font-weight: 700;
}

.reg-left p,
.reg-left .reg-points {
    color: #cbd5e1;
}

.reg-left .reg-points {
    margin: 0;
    padding-left: 18px;
}

.reg-left .reg-points li {
    margin-bottom: 6px;
}

/* How It Works (external, fixed-height) */
.howit-wrap {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.howit-main {
    flex: 1;
    overflow: auto;
    padding-right: 6px;
}

.howit-dark .card {
    background: #0f172a;
    border-color: #1f2937;
}

.howit-dark .card-title {
    color: #e5e7eb;
}

.howit-dark .carousel-indicators li {
    background-color: rgba(255, 255, 255, .4);
}

.howit-dark .carousel-indicators .active {
    background-color: #ffffff;
}

.howit-dark .btn-link {
    color: #e5e7eb;
}

.howit-dark .btn-link:hover {
    color: #ffffff;
}

/* Plans (external, fixed-height) */
.plans-wrap {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.plans-main {
    flex: 1;
    overflow: hidden;
}

.plans-dark .card {
    background: #0f172a;
    border-color: #1f2937;
}

.plans-dark h2,
.plans-dark h4 {
    color: #e5e7eb;
}

.plans-dark .text-muted {
    color: #94a3b8 !important;
}

.plans-carousel {
    position: relative;
}

.plans-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 360px);
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 8px 40px;
    /* room for arrows */
}

.plans-track::-webkit-scrollbar {
    display: none;
}

.plans-track {
    scrollbar-width: none;
}

.plan-card {
    position: relative;
    border-radius: 12px;
}

.plan-card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    border: 1px solid #1f2937;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
    border-color: #334155;
}

.plan-card .card-body {
    display: flex;
    flex-direction: column;
}

.badge-popular {
    position: absolute;
    top: 12px;
    right: -28px;
    background: var(--accent);
    color: #111827;
    padding: 6px 16px;
    transform: rotate(45deg);
    font-size: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .15);
}

.plans-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, .7);
    color: #e5e7eb;
    border: 1px solid #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.plans-prev {
    left: 6px;
}

.plans-next {
    right: 6px;
}

.plans-nav:hover {
    background: rgba(15, 23, 42, .9);
}

.display-4 {
    font-size: 2.2rem;
}

@media (min-width: 1200px) {
    .display-4 {
        font-size: 2.6rem;
    }
}

/* Compact, scrollable features list */
.plan-features {
    max-height: 30vh;
    overflow: auto;
    line-height: 1.3;
    font-size: .92rem;
    padding-right: 6px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.plan-features li {
    margin-bottom: 6px;
}

.plan-features::-webkit-scrollbar {
    width: 6px;
}

.plan-features::-webkit-scrollbar-track {
    background: #0b1220;
}

.plan-features::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 3px;
}

.plan-features:hover::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Checkout (external, fixed-height) */
.checkout-wrap {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.checkout-main {
    flex: 1;
    overflow: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.checkout-dark .card {
    background: #0f172a;
    border-color: #1f2937;
}

.checkout-dark .text-muted {
    color: #94a3b8 !important;
}

.checkout-dark .form-control,
.checkout-dark select.form-control,
.checkout-dark textarea.form-control {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}

.checkout-dark .input-group-append .btn {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}

.checkout-dark .card-header {
    border-color: #1f2937;
}

/* Dark dropdown */
.dropdown-menu-dark {
    background: #0f172a;
    border: 1px solid #1f2937;
    z-index: 100;
}

.dropdown-menu-dark .dropdown-item {
    color: #e5e7eb;
}

.dropdown-menu-dark .dropdown-item i {
    opacity: .9;
}

.dropdown-menu-dark .dropdown-item:hover {
    background: #111827;
    color: #fff;
}

.dropdown-menu-dark .dropdown-divider {
    border-color: #1f2937;
}

/* Market Overview (external, fixed-height) */
.market-wrap { height: calc(100vh - 120px); display:flex; flex-direction:column; }
.market-main { flex:1; overflow:auto; overflow-x:hidden; padding-right:6px; }
.market-dark .card { background:#0f172a; border-color:#1f2937; }
.market-dark .text-muted { color:#94a3b8 !important; }
.market-dark .dash-sticky-filters { background:#0f172a !important; box-shadow: 0 2px 10px rgba(0,0,0,.35) !important; }
.market-dark .dash-sticky-tabs { background:#0f172a !important; box-shadow: 0 2px 10px rgba(0,0,0,.35) !important; }
/* Neutralize any pro/blur overlays */
.market-dark .pro-blur,
.market-dark .pro-lock,
.market-dark .locked,
.market-dark .overlay-blur,
.market-dark [data-pro-blur],
.market-dark [data-locked="true"] {
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
.market-dark .pro-overlay,
.market-dark .locked-overlay,
.market-dark .paywall-overlay,
.market-dark .veil,
.market-dark .blur-veiled { display:none !important; }

/* Profile tabs (dark) */
.profile-tabs .list-group-item {
    background: #0f172a;
    color: #e5e7eb;
    border-color: #1f2937;
}
.profile-tabs .list-group-item.active,
.profile-tabs .list-group-item:hover {
    background: rgba(59, 130, 246, .15);
    color: #fff;
}

/* Receipt uploader */
.receipt-uploader {
    cursor: pointer;
    border: 1px dashed #334155;
    border-radius: 10px;
    padding: 12px;
    background: #0b1220;
    color: #94a3b8;
    text-align: center;
    position: relative;
}

.receipt-uploader:hover {
    border-color: #3b82f6;
    color: #cbd5e1;
}

.receipt-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
}

.receipt-preview {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.receipt-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.receipt-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #1f2937;
    background: rgba(15, 23, 42, .9);
    color: #e5e7eb;
    line-height: 24px;
    text-align: center;
}

.receipt-remove:hover {
    background: rgba(15, 23, 42, 1);
}

/* Avatar uploader (register) */
.avatar-uploader {
    cursor: pointer;
    border: 1px dashed #334155;
    border-radius: 10px;
    padding: 10px;
    background: #0b1220;
    color: #94a3b8;
    text-align: center;
    position: relative;
}

.avatar-uploader:hover {
    border-color: #3b82f6;
    color: #cbd5e1;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
}

.avatar-preview {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.avatar-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.avatar-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #1f2937;
    background: rgba(15, 23, 42, .9);
    color: #e5e7eb;
    line-height: 24px;
    text-align: center;
}

.avatar-remove:hover {
    background: rgba(15, 23, 42, 1);
}

/* How It Works carousel - hide internal scrollbars */
#howCarousel,
#howCarousel .carousel-inner,
#howCarousel .carousel-item {
    overflow: hidden;
}

#howCarousel {
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
}

#howCarousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

#howCarousel img {
    width: 100%;
    height: auto;
    display: block;
}

/* Tour modal dark styles and larger imagery */
.tour-modal .modal-content {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.tour-modal .modal-header,
.tour-modal .modal-footer {
    border: 0;
    background: transparent;
}

.tour-modal .how-tour-img {
    max-height: 72vh;
    object-fit: cover;
}

/* Backdrop blur for modal */
.modal-backdrop.show {
    background-color: rgba(5, 10, 20, 0.55);
    backdrop-filter: blur(14px) saturate(110%);
    -webkit-backdrop-filter: blur(14px) saturate(110%);
}

/* Tone down carousel control glare in tour */
.tour-modal .carousel-control-prev,
.tour-modal .carousel-control-next {
    opacity: .7;
}

.tour-modal .carousel-control-prev:hover,
.tour-modal .carousel-control-next:hover {
    opacity: .9;
}

/* Hide carousel controls in tour */
.tour-modal .carousel-control-prev,
.tour-modal .carousel-control-next {
    display: none !important;
}

/* Fallback: blur underlying page when tour modal is open */
.public-container.backdrop-blur {
    filter: blur(14px) saturate(110%);
    -webkit-filter: blur(14px) saturate(110%);
}