:root {
    --bg: #0b0b12;
    --surface: #141422;
    --surface-2: #1a1a2b;
    --text: #e8e8f0;
    --muted: #a6a6bf;
    --border: rgba(255,255,255,0.08);
    --accent: #7c4dff;        /* purple */
    --accent-700: #6f42e8;
    --accent-800: #5d36cf;
    --accent-900: #492aa8;
}

html, body {
    background: var(--bg);
    color: var(--text);
}

/* Modules and sections */
.module, .module-sm, .module-xs {
    background-color: var(--bg);
}
.module.bg-gray {
    background-color: var(--surface);
}

/* Footer */
.footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
}

/* Headings and text */
h1, h2, h3, h4, h5, h6 { color: var(--text); }
.lead { color: var(--muted); }

/* Buttons - override old green */
.btn-base, .btn-base:focus {
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
}
.btn-base:hover {
    background: var(--accent-700);
    border-color: var(--accent-700);
    color: #fff;
}
.btn-outline-light {
    color: #fff;
    border: 2px solid rgba(255,255,255,0.7);
    background: transparent;
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-color: rgba(255,255,255,0.9);
}

/* Cards / Surfaces */
.card, .panel, .hero-card, .team-card {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
}

/* Inputs */
.form-control {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(124,77,255,0.25);
    background: var(--surface-2);
    color: var(--text);
}

/* Global placeholder color on dark theme */
.form-control::placeholder { color: rgba(232,232,240,0.62) !important; }
.form-control::-webkit-input-placeholder { color: rgba(232,232,240,0.62) !important; }
.form-control::-moz-placeholder { color: rgba(232,232,240,0.62) !important; opacity: 1; }
.form-control:-ms-input-placeholder { color: rgba(232,232,240,0.62) !important; }
.form-control::-ms-input-placeholder { color: rgba(232,232,240,0.62) !important; }

/* Contact section inputs: ensure contrast on dark background */
#contact .form-control {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
#contact .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124,77,255,0.25);
  background: var(--surface-2);
}
#contact .form-control::placeholder,
#contact .form-control::-webkit-input-placeholder,
#contact .form-control::-moz-placeholder,
#contact .form-control:-ms-input-placeholder,
#contact .form-control::-ms-input-placeholder {
  color: rgba(232,232,240,0.7) !important;
}

/* Accent outline button for secondary actions (used by register CTA) */
.btn-outline-accent {
  color: var(--accent);
  background: transparent;
  border: 2px solid var(--accent);
}
.btn-outline-accent:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-700);
}

/* Hero overlay stays dark, tighten contrast */
#hero.overlay-dark::before {
    background: linear-gradient(180deg, rgba(6, 6, 12, 0.50) 0%, rgba(6, 6, 12, 0.85) 100%);
}

/* Iconboxes on Learn More */
.iconbox-icon {
    color: var(--accent);
}
.iconbox {
    border-radius: 12px;
    padding: 12px 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
}

/* Links */
a { color: var(--accent); }
a:hover { color: var(--accent-700); }

/* Loader overrides: merge bg and use purple accent instead of green */
.page-loader {
  background: var(--bg, #0b0b12);
}
.page-loader .loader {
  border-color: rgba(255,255,255,0.09);
}
.page-loader .loader:after {
  /* top arc color = accent; others stay transparent */
  border-color: var(--accent, #7c4dff) transparent transparent transparent;
}

/* Setting background of modules */
modules.each(function () {
    var bg = $(this).attr('data-background');
    if (bg) {
        // normalize app-relative "~/" to "/"
        if (bg.indexOf('~/') === 0) bg = bg.replace('~/', '/');
        $(this).css('background-image', 'url(' + bg + ')');
    }
});