/* ==========================================================================
   Marketplace — core theme
   Palette: primary  #121315 (dark charcoal)
            secondary #d3af37 (gold)
   Bootstrap is heavily overridden so the site never looks like a default
   Bootstrap template. No Bootstrap blue anywhere.
   ========================================================================== */

:root {
    /* Brand */
    --mp-ink:          #121315;   /* primary — dark charcoal            */
    --mp-ink-2:        #1a1c1f;   /* raised surface                     */
    --mp-ink-3:        #232629;   /* card / panel                       */
    --mp-ink-4:        #2e3236;   /* hover surface                      */
    --mp-gold:         #d3af37;   /* secondary — gold                   */
    --mp-gold-2:       #e8c860;   /* gold hover                         */
    --mp-gold-3:       #a98a24;   /* gold pressed                       */
    --mp-gold-soft:    rgba(211, 175, 55, 0.14);

    /* Neutrals */
    --mp-white:        #ffffff;
    --mp-text:         #e9e7e2;
    --mp-text-dim:     #a7a9ad;
    --mp-text-mute:    #7c8085;
    --mp-line:         #32363b;
    --mp-line-soft:    #26292d;

    /* Semantic (kept gold/charcoal — never Bootstrap blue) */
    --mp-success:      #4fae7a;
    --mp-warning:      #e0a63a;
    --mp-danger:       #d95757;
    --mp-info:         #6ba8d8;
    --mp-secondary:    #8b9096;

    /* Shape + depth */
    --mp-radius:       14px;
    --mp-radius-sm:    9px;
    --mp-radius-lg:    22px;
    --mp-shadow-sm:    0 2px 6px rgba(0, 0, 0, .25);
    --mp-shadow:       0 10px 30px rgba(0, 0, 0, .35);
    --mp-shadow-lg:    0 24px 60px rgba(0, 0, 0, .45);

    /* Type */
    --mp-font:         "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --mp-font-display: "Georgia", "Times New Roman", serif;

    --mp-header-h:     68px;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.app-body {
    margin: 0;
    font-family: var(--mp-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--mp-text);
    background:
        radial-gradient(1200px 600px at 12% -8%, rgba(211,175,55,.10), transparent 60%),
        radial-gradient(900px 500px at 96% 4%, rgba(211,175,55,.06), transparent 55%),
        var(--mp-ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-main { min-height: 55vh; }

a { color: var(--mp-gold); text-decoration: none; transition: color .18s ease; }
a:hover, a:focus { color: var(--mp-gold-2); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--mp-font);
    font-weight: 700;
    color: var(--mp-white);
    letter-spacing: -.015em;
}

hr { border: 0; border-top: 1px solid var(--mp-line); opacity: 1; }

::selection { background: var(--mp-gold); color: var(--mp-ink); }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--mp-gold); color: var(--mp-ink);
    padding: 10px 16px; border-radius: 0 0 var(--mp-radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    --bs-btn-border-radius: 999px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .62rem 1.35rem;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(211, 175, 55, .35); }

.btn-gold {
    background: linear-gradient(135deg, var(--mp-gold) 0%, var(--mp-gold-2) 100%);
    color: var(--mp-ink);
    border: 1px solid transparent;
    box-shadow: 0 6px 18px rgba(211, 175, 55, .28);
}
.btn-gold:hover, .btn-gold:focus {
    background: linear-gradient(135deg, var(--mp-gold-2) 0%, var(--mp-gold) 100%);
    color: var(--mp-ink);
}

.btn-outline-gold {
    background: transparent;
    color: var(--mp-gold);
    border: 1px solid rgba(211, 175, 55, .55);
}
.btn-outline-gold:hover, .btn-outline-gold:focus {
    background: var(--mp-gold-soft);
    color: var(--mp-gold-2);
    border-color: var(--mp-gold);
}

.btn-outline-light {
    border-color: var(--mp-line);
    color: var(--mp-text);
    background: transparent;
}
.btn-outline-light:hover, .btn-outline-light:focus {
    background: rgba(255,255,255,.06);
    color: var(--mp-white);
    border-color: rgba(255,255,255,.35);
}

.btn-dark { background: var(--mp-ink-3); color: var(--mp-text); border: 1px solid var(--mp-line); }
.btn-dark:hover { background: var(--mp-ink-4); color: var(--mp-white); }

/* --------------------------------------------------------------------------
   Header / navbar
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(18, 19, 21, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--mp-line-soft);
}

.site-navbar { min-height: var(--mp-header-h); padding: .35rem 0; }

.navbar-brand.brand-text,
.brand-text {
    font-family: var(--mp-font);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    color: var(--mp-white);
}
.brand-text:hover { color: var(--mp-gold); }

.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--mp-gold), var(--mp-gold-3));
    color: var(--mp-ink); font-size: .95rem;
    box-shadow: 0 4px 14px rgba(211, 175, 55, .35);
    flex: 0 0 auto;
}

.site-navbar .nav-link {
    color: var(--mp-text-dim);
    font-weight: 600;
    font-size: .95rem;
    padding: .5rem .85rem;
    border-radius: 999px;
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus { color: var(--mp-white); background: rgba(255,255,255,.05); }

.navbar-toggler {
    border: 1px solid var(--mp-line);
    border-radius: 10px;
    padding: .4rem .6rem;
}
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(211,175,55,.3); }

.avatar-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--mp-gold-soft);
    border: 1px solid rgba(211,175,55,.45);
    color: var(--mp-gold); font-weight: 700; font-size: .8rem;
}

/* Uploaded portrait in the public navigation must never set header dimensions. */
.site-navbar .nav-avatar {
    display: inline-block;
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 25%;
    overflow: hidden;
    border: 1px solid rgba(211,175,55,.45);
}

.dropdown-menu {
    background: var(--mp-ink-3);
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius-sm);
    box-shadow: var(--mp-shadow);
    padding: .5rem;
}
.dropdown-item { color: var(--mp-text); border-radius: 7px; padding: .45rem .7rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--mp-gold-soft); color: var(--mp-white); }
.dropdown-item-text { padding: .25rem .7rem; }
.dropdown-divider { border-color: var(--mp-line); opacity: 1; }

/* --------------------------------------------------------------------------
   Flash alerts
   -------------------------------------------------------------------------- */

.flash-wrap { padding-top: 1rem; }
.alert { border-radius: var(--mp-radius-sm); border: 1px solid transparent; font-size: .95rem; }
.alert-success { background: rgba(79,174,122,.12); border-color: rgba(79,174,122,.4); color: #cfe9dc; }
.alert-danger  { background: rgba(217,87,87,.12);  border-color: rgba(217,87,87,.4);  color: #f3d3d3; }
.alert-warning { background: rgba(224,166,58,.12); border-color: rgba(224,166,58,.4); color: #f4e3c4; }
.alert-info    { background: rgba(107,168,216,.12);border-color: rgba(107,168,216,.4);color: #d3e6f5; }
.btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .6; }

/* --------------------------------------------------------------------------
   Badges + ratings
   -------------------------------------------------------------------------- */

.badge-status,
.badge.bg-primary, .badge.bg-secondary, .badge.bg-success,
.badge.bg-danger, .badge.bg-warning, .badge.bg-info, .badge.bg-dark {
    display: inline-flex; align-items: center; gap: .3em;
    padding: .38em .8em;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.badge-primary   { background: rgba(211,175,55,.16); color: var(--mp-gold);   border-color: rgba(211,175,55,.4); }
.badge-secondary { background: rgba(139,144,150,.16);color: var(--mp-text-dim);border-color: rgba(139,144,150,.4); }
.badge-success   { background: rgba(79,174,122,.16); color: #8fd9b6;           border-color: rgba(79,174,122,.4); }
.badge-danger    { background: rgba(217,87,87,.16);  color: #f0a0a0;           border-color: rgba(217,87,87,.4); }
.badge-warning   { background: rgba(224,166,58,.16); color: #f0cc85;           border-color: rgba(224,166,58,.4); }
.badge-info      { background: rgba(107,168,216,.16);color: #a9d0ee;           border-color: rgba(107,168,216,.4); }
.badge-dark      { background: rgba(255,255,255,.08);color: var(--mp-text-dim); border-color: var(--mp-line); }

.rating-stars { color: var(--mp-gold); letter-spacing: .06em; font-size: .85rem; }
.rating-value { color: var(--mp-white); font-weight: 700; font-size: .85rem; }
.rating-count { color: var(--mp-text-mute); font-size: .8rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.25));
    border-top: 1px solid var(--mp-line-soft);
    margin-top: 3rem;
}
.footer-heading {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--mp-gold);
    margin-bottom: .9rem;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--mp-text-dim); font-size: .93rem; }
.footer-links a:hover { color: var(--mp-gold); padding-left: 3px; }
.footer-rule { border-top: 1px solid var(--mp-line-soft); }

/* --------------------------------------------------------------------------
   Homepage hero (Phase 1 install screen)
   -------------------------------------------------------------------------- */

.hero-install { padding: 3.5rem 0; }

.hero-kicker {
    font-size: .78rem;
    letter-spacing: .22em;
    color: var(--mp-gold);
    font-weight: 700;
    margin-bottom: .75rem;
}
.hero-title {
    font-family: var(--mp-font);
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.05;
    font-weight: 800;
    background: linear-gradient(120deg, var(--mp-white) 30%, var(--mp-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-lead {
    font-size: clamp(1.02rem, 2vw, 1.2rem);
    color: var(--mp-text-dim);
    max-width: 46ch;
}
.hero-checklist { list-style: none; margin: 0; padding: 0; }
.hero-checklist li {
    display: flex; align-items: center; gap: .6rem;
    color: var(--mp-text-dim); font-size: .95rem; margin-bottom: .5rem;
}
.hero-checklist i { color: var(--mp-gold); font-size: .85rem; }

.install-card {
    background: linear-gradient(160deg, var(--mp-ink-3), var(--mp-ink-2));
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow-lg);
    overflow: hidden;
}
.install-card-head {
    display: flex; align-items: center; gap: .5rem;
    padding: .8rem 1.1rem;
    background: rgba(0,0,0,.35);
    border-bottom: 1px solid var(--mp-line);
}
.install-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mp-line); }
.install-dot:nth-child(1) { background: #d95757; }
.install-dot:nth-child(2) { background: #e0a63a; }
.install-dot:nth-child(3) { background: #4fae7a; }
.install-title {
    margin-left: auto;
    font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--mp-text-mute);
}
.install-table { width: 100%; border-collapse: collapse; }
.install-table th, .install-table td {
    padding: .75rem 1.1rem; text-align: left; font-size: .92rem;
    border-bottom: 1px solid var(--mp-line-soft);
}
.install-table th { color: var(--mp-text-mute); font-weight: 600; width: 38%; }
.install-table td { color: var(--mp-text); }
.install-table tr:last-child th, .install-table tr:last-child td { border-bottom: 0; }
.install-note {
    padding: .9rem 1.1rem;
    background: var(--mp-gold-soft);
    border-top: 1px solid rgba(211,175,55,.28);
    font-size: .9rem; color: var(--mp-text);
}

.phase-strip { background: rgba(0,0,0,.28); border-top: 1px solid var(--mp-line-soft); }
.phase-step {
    display: flex; flex-direction: column; gap: .2rem;
    padding: .85rem 1rem;
    background: var(--mp-ink-3);
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius-sm);
    height: 100%;
}
.phase-step.is-done { border-color: rgba(211,175,55,.55); background: var(--mp-gold-soft); }
.phase-num { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mp-gold); font-weight: 700; }
.phase-label { font-size: .88rem; color: var(--mp-text-dim); }
.phase-step.is-done .phase-label { color: var(--mp-white); }

/* --------------------------------------------------------------------------
   Error pages
   -------------------------------------------------------------------------- */

.error-page { min-height: 62vh; display: flex; align-items: center; }
.error-page > .container { width: 100%; }
.error-code {
    font-family: var(--mp-font);
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 .5rem;
    background: linear-gradient(120deg, rgba(211,175,55,.9), rgba(211,175,55,.25));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-title { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.error-text { color: var(--mp-text-dim); max-width: 52ch; margin-inline: auto; }

/* --------------------------------------------------------------------------
   Mobile bottom navigation (Phase 4 completes it)
   -------------------------------------------------------------------------- */

.mobile-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    display: flex; justify-content: space-around;
    background: rgba(18,19,21,.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--mp-line);
    padding: .45rem 0 calc(.45rem + env(safe-area-inset-bottom));
}
.mnav-item {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    font-size: .68rem; color: var(--mp-text-mute);
    padding: .25rem .5rem; min-width: 62px; border-radius: 10px;
}
.mnav-item i { font-size: 1.05rem; }
.mnav-item.is-active, .mnav-item:hover { color: var(--mp-gold); }
body { padding-bottom: 0; }
@media (max-width: 991.98px) {
    body.app-body { padding-bottom: 76px; }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-control, .form-select {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius-sm);
    color: var(--mp-white);
    padding: .68rem .9rem;
    font-size: .97rem;
}
/* Native option menus need their own colors on every page and every select;
   otherwise the browser may show white options with light text until hover. */
select { color-scheme: light; }
select option,
select optgroup {
    background-color: #fff !important;
    color: #121315 !important;
    text-shadow: none !important;
}
.form-control:focus, .form-select:focus {
    background: rgba(255,255,255,.06);
    border-color: var(--mp-gold);
    color: var(--mp-white);
    box-shadow: 0 0 0 3px rgba(211,175,55,.22);
}
.form-control::placeholder { color: var(--mp-text-mute); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--mp-danger); }
.form-control.is-valid { border-color: var(--mp-success); }
.form-label { color: var(--mp-text-dim); font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.form-text { color: var(--mp-text-mute); font-size: .82rem; }
.invalid-feedback { color: #f0a0a0; font-size: .84rem; }

.input-group-text {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--mp-line);
    color: var(--mp-gold);
    border-radius: var(--mp-radius-sm);
}

/* --------------------------------------------------------------------------
   Cards + tables
   -------------------------------------------------------------------------- */

.card {
    background: linear-gradient(160deg, var(--mp-ink-3), var(--mp-ink-2));
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow-sm);
    color: var(--mp-text);
}
.card-header {
    background: rgba(0,0,0,.22);
    border-bottom: 1px solid var(--mp-line);
    color: var(--mp-white);
    font-weight: 700;
    border-radius: var(--mp-radius) var(--mp-radius) 0 0 !important;
}
.card-footer { background: rgba(0,0,0,.18); border-top: 1px solid var(--mp-line); }

.table { --bs-table-bg: transparent; color: var(--mp-text); margin-bottom: 0; }
.table > thead > tr > th {
    background: rgba(0,0,0,.25);
    color: var(--mp-text-dim);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    border-bottom: 1px solid var(--mp-line);
    padding: .8rem .9rem;
    white-space: nowrap;
}
.table > tbody > tr > td {
    border-color: var(--mp-line-soft);
    padding: .85rem .9rem;
    vertical-align: middle;
}
.table > tbody > tr:hover > td { background: rgba(255,255,255,.03); }

.table-responsive { border: 1px solid var(--mp-line); border-radius: var(--mp-radius-sm); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.text-muted { color: var(--mp-text-mute) !important; }
.text-secondary { color: var(--mp-text-dim) !important; }

.section-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: .4rem;
}
.section-sub { color: var(--mp-text-dim); margin-bottom: 1.75rem; }

.eyebrow {
    display: inline-block;
    font-size: .74rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--mp-gold); font-weight: 700; margin-bottom: .6rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .site-header { background: rgba(18,19,21,.96); }
    .site-navbar .nav-link { padding: .65rem .9rem; }
    .hero-install { padding: 2rem 0; }
    .footer-links a:hover { padding-left: 0; }
}

@media (max-width: 575.98px) {
    body.app-body { font-size: 15.5px; }
    .btn { padding: .58rem 1.1rem; }
    .install-table th, .install-table td { padding: .6rem .9rem; }
}

/* Popup campaign modal (dependency-free: no Bootstrap JS needed) ------------- */
.popup-veil {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.72);
}
.popup-veil[hidden] { display: none; }
body.popup-open { overflow: hidden; }
.popup-card {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    background: linear-gradient(160deg, var(--mp-ink-3), var(--mp-ink-2));
    border: 1px solid rgba(211,175,55,.45);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    padding: 1.6rem 1.6rem 1.4rem;
}
.popup-head h2 { font-size: 1.3rem; margin: 0 0 .8rem; color: var(--mp-white); }
.popup-body { color: var(--mp-text); font-size: .95rem; }
.popup-body > :first-child { margin-top: 0; }
.popup-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.popup-actions .btn { flex: 1 1 auto; }
