/* ============================================================
   Qtech — Enterprise B2B SaaS design system
   Full-width, navy-anchored, corporate-blue-accented.
   ============================================================ */

:root {
    /* Brand palette — corporate blue #0071BC IS the base identity.
       The "dark" ramp is a deep→bright blue family (no slate) so every
       dark surface (hero, bands, footer, admin sidebar) reads as blue. */
    --navy-950: #013a5c;   /* deepest blue — footer, sidebar, darkest bands */
    --navy-900: #00517f;
    --navy-800: #0067a6;
    --navy-700: #0071BC;   /* the bright base identity */
    --slate-600: #2f4a63;  /* blue-grey body text on light surfaces */

    --corporate-blue: #0071BC;   /* brand blue — focus + primary CTA */
    --corporate-blue-600: #005b96;
    --corporate-blue-050: #e6f1f9;
    --on-blue: #ffffff;          /* text/icons on blue fills */

    /* Neutral content surfaces — light blue-tinted, high contrast vs the blue */
    --surface: #eef4fa;   /* page background behind panels (light blue tint) */
    --surface-alt: #f8fafc; /* lightest alt section background */
    --panel: #ffffff;     /* content panels/cards stay white for readability */
    --border: #d7e3ef;    /* subtle blue-tinted layout boundaries */
    --border-strong: #c3d5e6;

    /* Typography colors */
    --text: #0f1c30;
    --muted: #5a6b82;
    --on-dark: #ffffff;
    --on-dark-muted: #E0F2FE;   /* crisp light tint — high contrast on solid blue */

    /* Structure */
    --wrap: 1360px;
    --gutter: clamp(1.25rem, 4vw, 4rem);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(10, 28, 51, .06), 0 8px 24px rgba(10, 28, 51, .06);
    --shadow-lg: 0 24px 60px rgba(10, 28, 51, .16);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1 0 auto; }

/* ---- Typographic hierarchy ---- */
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 700; }
.display { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.03em; }
.h-section { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; }
.eyebrow {
    text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
    font-weight: 700; color: var(--corporate-blue); margin-bottom: .9rem;
}

/* ============================================================
   STRICT CONTRAST — any supporting text/label/caption sitting on
   the solid corporate-blue (hero, page-hero, dark bands) must use
   a high-contrast light tone, never a dark or same-hue-blue tone.
   ============================================================ */
.hero .eyebrow, .page-hero .eyebrow,
.section--dark .eyebrow, .section--darker .eyebrow { color: #E0F2FE; }

.page-hero .lead, .page-hero .breadcrumbs, .page-hero .muted, .page-hero__intro,
.hero .muted, .section--dark .muted, .section--darker .muted { color: #E0F2FE; }

.page-hero .breadcrumbs a, .page-hero .breadcrumbs a:hover,
.page-hero__intro a { color: #ffffff; text-decoration: underline; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); }
a { color: var(--corporate-blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Full-width structure ---- */
.section { width: 100%; padding: clamp(3.5rem, 7vw, 7rem) var(--gutter); }
.section--tight { padding-top: clamp(2rem, 4vw, 3.5rem); padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.section--dark { background: var(--navy-900); color: var(--on-dark); }
.section--darker { background: var(--navy-950); color: var(--on-dark); }
.section--surface { background: var(--surface); }
.section--panel { background: var(--panel); }
.section--dark h1, .section--dark h2, .section--darker h1, .section--darker h2 { color: #fff; }
.section--dark .lead, .section--darker .lead { color: var(--on-dark-muted); }

.wrap { max-width: var(--wrap); margin-inline: auto; width: 100%; }
.wrap--narrow { max-width: 820px; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.center { text-align: center; }
.stack-sm > * + * { margin-top: .35rem; }

/* ---- Top navigation (full-width, dark) ---- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(7, 20, 38, .92);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topbar__inner {
    max-width: var(--wrap); margin-inline: auto;
    padding: .85rem var(--gutter);
    display: flex; align-items: center; gap: 2rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: #fff; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark {
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--corporate-blue); color: #fff; font-weight: 800;
    display: grid; place-items: center; font-size: .95rem;
}
.nav { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.nav a {
    color: var(--on-dark-muted); font-weight: 600; font-size: .95rem;
    padding: .5rem .85rem; border-radius: 8px; transition: color .15s, background .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav a.is-active { color: #fff; }
.nav__cta {
    background: var(--corporate-blue) !important; color: #fff !important;
    padding: .55rem 1.1rem !important; margin-left: .4rem;
}
.nav__cta:hover { background: var(--corporate-blue-600) !important; }
@media (max-width: 780px) {
    .nav { gap: 0; flex-wrap: wrap; }
    .nav a { padding: .4rem .6rem; font-size: .88rem; }
}

/* ---- Buttons ---- */
.btn-qt {
    display: inline-flex; align-items: center; gap: .5rem;
    font-weight: 700; font-size: 1rem; padding: .8rem 1.6rem;
    border-radius: 10px; border: 1px solid transparent; cursor: pointer;
    transition: transform .05s ease, background .15s, border-color .15s; text-decoration: none;
}
.btn-qt:hover { text-decoration: none; }
.btn-qt:active { transform: translateY(1px); }
.btn-primary-qt { background: var(--corporate-blue); color: #fff; }
.btn-primary-qt:hover { background: var(--corporate-blue-600); color: #fff; }
.btn-ghost-qt { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-qt:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-outline-qt { background: transparent; color: var(--corporate-blue-600); border-color: var(--border-strong); }
.btn-outline-qt:hover { border-color: var(--corporate-blue); color: var(--corporate-blue-600); }

/* ---- Panels / cards ---- */
.panel {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.6rem;
    box-shadow: var(--shadow); height: 100%;
}
.panel--flat { box-shadow: none; }
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

.icon-badge {
    width: 48px; height: 48px; border-radius: 12px;
    display: grid; place-items: center; margin-bottom: 1rem;
    background: var(--corporate-blue-050); color: var(--corporate-blue); font-size: 1.3rem;
    border: 1px solid #f6d3d8;
}

/* ---- Hero ---- */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(0, 113, 188, .40), transparent 60%),
        linear-gradient(160deg, var(--navy-950), var(--navy-900) 55%, var(--navy-800));
    color: #fff; padding: clamp(4.5rem, 9vw, 8rem) var(--gutter) clamp(3.5rem, 7vw, 6rem);
}
.hero__inner { max-width: var(--wrap); margin-inline: auto; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }
.hero .lead { color: var(--on-dark-muted); max-width: 44ch; }
.hero__cta { display: flex; gap: .9rem; margin-top: 2rem; flex-wrap: wrap; }

/* ---- Stat / counter row ---- */
.stat { text-align: center; padding: 1.4rem 1rem; }
.stat__value { font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1; }
.stat__value .suffix { color: var(--corporate-blue); }
.stat__label { color: var(--on-dark-muted); margin-top: .5rem; font-weight: 600; font-size: .95rem; }
.stat-strip {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); overflow: hidden;
}
.stat-strip .stat + .stat { border-left: 1px solid rgba(255, 255, 255, .12); }
@media (max-width: 720px) {
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .stat-strip .stat:nth-child(odd) { border-left: none; }
    .stat-strip .stat:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .12); }
}

/* ---- Wrapping stat grid (home milestones, up to 10) ---- */
.stat-grid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 1px; background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); overflow: hidden;
}
.stat-grid .stat { background: var(--navy-950); }
@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- Product / feature cards ---- */
.feature-title { font-size: 1.2rem; margin: 0 0 .35rem; }
.muted { color: var(--muted); }
.tag {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--corporate-blue); background: var(--corporate-blue-050);
    padding: .25rem .55rem; border-radius: 999px; border: 1px solid #f6d3d8;
}

/* ---- Split / feature rows for module pages ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---- Testimonials ---- */
.quote { font-size: 1.15rem; line-height: 1.6; color: var(--text); }
.quote__author { margin-top: 1.1rem; font-weight: 700; }
.quote__meta { color: var(--muted); font-weight: 500; font-size: .9rem; }

/* ---- Forms on dark ---- */
.form-panel { background: var(--panel); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.5rem); box-shadow: var(--shadow); }
.form-control:focus, .form-select:focus {
    border-color: var(--corporate-blue); box-shadow: 0 0 0 .2rem rgba(0, 113, 188, .18);
}

/* ---- Footer ---- */
.site-footer { background: var(--navy-950); color: var(--on-dark-muted); padding: 3.5rem var(--gutter) 2rem; }
.site-footer__inner { max-width: var(--wrap); margin-inline: auto; }
.site-footer a { color: var(--on-dark-muted); }
.site-footer a:hover { color: #fff; }
.site-footer__bar { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .88rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1.1fr; gap: 2.5rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-head { color: #fff; font-weight: 700; margin-bottom: .7rem; }
.footer-social { display: flex; gap: 1rem; margin-top: 1.1rem; }
.footer-social a { font-weight: 600; }
.site-footer .stack-sm div { font-size: .92rem; }

/* ---- Page hero for module pages (About / Products) ---- */
.page-hero {
    background: linear-gradient(160deg, var(--navy-950), var(--navy-800));
    color: #fff; padding: clamp(3.5rem, 7vw, 6rem) var(--gutter);
}
.page-hero__inner { max-width: var(--wrap); margin-inline: auto; }
.breadcrumbs { color: var(--on-dark-muted); font-size: .85rem; margin-bottom: 1rem; }
.breadcrumbs a { color: var(--on-dark-muted); }

/* keep bootstrap focus ring subtle for any residual bootstrap buttons */
.btn:focus { box-shadow: 0 0 0 .2rem rgba(0, 113, 188, .2); }

/* ---- Brand logo ---- */
.brand__logo { height: 68px; width: auto; display: block; background: #fff; padding: 7px 14px; border-radius: 12px; }
.brand__logo--plain { background: transparent; padding: 0; }

/* ---- Hero artwork ---- */
.hero__art { width: 100%; max-width: 520px; margin-inline: auto; display: block;
    filter: drop-shadow(0 30px 55px rgba(0, 0, 0, .4)); }

/* ---- Trusted-by logo strip ---- */
.logo-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 900px) { .logo-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .logo-strip { grid-template-columns: repeat(2, 1fr); } }
.logo-strip img { max-height: 46px; max-width: 100%; margin-inline: auto; display: block;
    filter: grayscale(1); opacity: .6; transition: filter .2s, opacity .2s; }
.logo-strip img:hover { filter: none; opacity: 1; }

/* ---- Product media ---- */
.product-media { width: 100%; height: 190px; object-fit: contain; background: var(--surface);
    border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--border); }

/* ---- Auth screen (Admin login) ---- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 3rem var(--gutter);
    background:
        radial-gradient(1000px 500px at 50% -10%, rgba(0, 113, 188, .25), transparent 60%),
        linear-gradient(160deg, var(--navy-950), var(--navy-800)); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: clamp(1.6rem, 3vw, 2.4rem); }
.auth-card__brand { display: flex; justify-content: center; margin-bottom: 1.4rem; }
.auth-card__brand img { height: 46px; }
.auth-card h1 { text-align: center; font-size: 1.4rem; }
.auth-note { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1.2rem; }

/* ---- Visitor chat widget ---- */
.chat-fab {
    position: fixed; right: 22px; bottom: 22px; z-index: 60;
    width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--corporate-blue); color: #fff; font-size: 1.5rem;
    box-shadow: var(--shadow-lg); transition: transform .12s ease, background .15s;
}
.chat-fab:hover { background: var(--corporate-blue-600); transform: translateY(-2px); }
.chat-panel {
    position: fixed; right: 22px; bottom: 92px; z-index: 60;
    width: 350px; max-width: calc(100vw - 44px);
    height: 470px; max-height: calc(100vh - 130px);
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head { background: var(--navy-900); color: #fff; padding: .9rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.chat-head strong { font-size: .98rem; }
.chat-status { font-size: .74rem; color: var(--on-dark-muted); display: flex; align-items: center; gap: .38rem; margin-top: .2rem; }
.chat-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa7bd; display: inline-block; }
.chat-status.online .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.chat-status.online { color: #b7f7cd; }
.chat-head button { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.chat-intro { padding: 1rem; }
.chat-intro .form-control { margin-bottom: .6rem; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; background: var(--surface); }
.chat-foot { padding: .6rem; border-top: 1px solid var(--border); }
.chat-msg { margin-bottom: .5rem; display: flex; }
.chat-msg .bubble { padding: .5rem .75rem; border-radius: 12px; max-width: 80%; font-size: .9rem; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg.visitor { justify-content: flex-end; }
.chat-msg.visitor .bubble { background: var(--corporate-blue); color: #fff; }
.chat-msg.admin { justify-content: flex-start; }
.chat-msg.admin .bubble { background: #fff; border: 1px solid var(--border); color: var(--text); }
.chat-row { display: flex; gap: .4rem; }
.chat-row input { flex: 1; }

/* ============================================================
   Admin panel shell (sidebar dashboard)
   ============================================================ */
.qa { display: flex; min-height: 100vh; background: var(--surface); }

.qa-side {
    width: 248px; flex: none; background: var(--navy-950); color: var(--on-dark-muted);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.qa-side__brand {
    padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex; align-items: center; gap: .55rem;
}
.qa-side__brand img { height: 30px; background: #fff; padding: 4px 7px; border-radius: 7px; }
.qa-side__brand span { color: #fff; font-weight: 800; letter-spacing: -.01em; }

.qa-nav { padding: .6rem .55rem 1.5rem; overflow-y: auto; flex: 1; }
.qa-nav__label { text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; color: #607790; padding: .95rem .7rem .3rem; }
.qa-nav a {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    color: var(--on-dark-muted); padding: .55rem .7rem; border-radius: 9px;
    font-weight: 600; font-size: .92rem; text-decoration: none; margin-bottom: 1px;
}
.qa-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.qa-nav a.active { background: var(--corporate-blue); color: #fff; }
.qa-nav a.active .badge { background: #fff !important; color: var(--corporate-blue) !important; }

.qa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qa-top {
    background: #fff; border-bottom: 1px solid var(--border); padding: .8rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
}
.qa-top__title { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.qa-top__user { display: flex; align-items: center; gap: .9rem; font-size: .9rem; color: var(--muted); }
.qa-top__user .who { font-weight: 700; color: var(--text); }
.qa-content { padding: 1.75rem; max-width: 1200px; width: 100%; }
.qa-content > h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }

/* Beautified bootstrap bits inside admin content */
.qa-content .table { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 0; }
.qa-content .table > :not(caption) > * > * { padding: .85rem 1rem; }
.qa-content .table thead th {
    background: #f1f4f9; border-bottom: 1px solid var(--border);
    font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.qa-content .table tbody tr:hover { background: #fafbfe; }
.qa-content .btn-primary { background: var(--corporate-blue); border-color: var(--corporate-blue); font-weight: 600; }
.qa-content .btn-primary:hover { background: var(--corporate-blue-600); border-color: var(--corporate-blue-600); }
.qa-content .form-control:focus, .qa-content .form-select:focus {
    border-color: var(--corporate-blue); box-shadow: 0 0 0 .2rem rgba(0, 113, 188, .18);
}

/* Admin only: highlight the focused field yellow */
.qa-content input:not([type=checkbox]):not([type=radio]):focus,
.qa-content textarea:focus,
.qa-content select:focus,
.auth-card input:not([type=checkbox]):not([type=radio]):focus,
.auth-card textarea:focus,
.auth-card select:focus {
    background-color: #fff59d;
}
.qa-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); }
.qa-content form.col-md-6, .qa-content form.col-md-8, .qa-content .col-md-6 > form, .qa-content .col-md-8 > form { }

@media (max-width: 860px) {
    .qa { flex-direction: column; }
    .qa-side { width: 100%; height: auto; position: static; }
    .qa-nav { display: flex; flex-wrap: wrap; gap: .25rem; padding-bottom: .5rem; }
    .qa-nav__label { width: 100%; padding: .5rem .7rem .2rem; }
    .qa-content { padding: 1.1rem; }
}

/* ---- Prose (Privacy and other text pages) ---- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose p, .prose li { color: var(--slate-600); }
.prose ul { padding-left: 1.2rem; }
