/* QAS Website 5.0 – Main Stylesheet */
:root {
    --primary: #4B5FAE;
    --secondary: #607CC3;
    --accent: #7F92D8;
    --dark: #0F172A;
    --light-bg: #F4F7FF;
    --success: #00A86B;
    --warning: #FF8C00;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    color: var(--dark);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: white; }

/* ── Typography ──────────────────────────────────── */
.display-heading {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(75,95,174,0.10);
    border: 1px solid rgba(75,95,174,0.20);
    padding: 0.3rem 0.9rem;
    border-radius: 100px;
}

/* ── Gradient Text ──────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-blue {
    background: linear-gradient(135deg, #3a50a0 0%, #6480cc 35%, #a0b0f0 55%, #5570c0 75%, #3a50a0 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

.gradient-text {
    background: linear-gradient(135deg, #4B5FAE 0%, #7F92D8 50%, #4B5FAE 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ── Glassmorphism ───────────────────────────────── */
.glass {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
}

.glass-dark {
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15));
    opacity: 0;
    transition: opacity 0.2s;
}
.btn-primary:hover { background: var(--secondary); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(75,95,174,0.35); }
.btn-primary:hover::before { opacity: 1; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.6875rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s;
}
.btn-outline:hover { background: var(--primary); color: white; transform: translateY(-2px); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
    padding: 0.6875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
}
.btn-ghost:hover { background: rgba(75,95,174,0.08); color: var(--primary); }

/* ── Cards ───────────────────────────────────────── */
.card {
    background: white;
    border-radius: 1.25rem;
    border: 1.5px solid #dde4f5;
    padding: 1.75rem;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(75,95,174,0.06);
}
.card:hover { border-color: var(--primary); box-shadow: 0 20px 60px rgba(75,95,174,0.16); transform: translateY(-4px); }

.card-elevated {
    background: white;
    border-radius: 1.5rem;
    border: 1.5px solid #dde4f5;
    box-shadow: 0 4px 24px rgba(75,95,174,0.08);
    padding: 2rem;
    transition: all 0.3s;
}
.card-elevated:hover { box-shadow: 0 24px 60px rgba(75,95,174,0.18); transform: translateY(-6px); }

/* ── Hero ────────────────────────────────────────── */
#hero-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(75,95,174,0.1);
    border: 1px solid rgba(75,95,174,0.2);
    color: var(--primary);
    padding: 0.375rem 1rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── Ecosystem Nodes ─────────────────────────────── */
.ecosystem-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.3s;
}
.ecosystem-node:hover { transform: scale(1.1); z-index: 10; }
.ecosystem-node .node-icon {
    width: 56px; height: 56px;
    background: white;
    border: 2px solid rgba(75,95,174,0.2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(75,95,174,0.15);
    transition: all 0.3s;
}
.ecosystem-node:hover .node-icon { border-color: var(--primary); box-shadow: 0 8px 30px rgba(75,95,174,0.3); }
.ecosystem-node .node-label { font-size: 0.6875rem; font-weight: 600; color: var(--dark); white-space: nowrap; }

/* Animated data stream lines */
@keyframes dataFlow {
    0% { stroke-dashoffset: 100; opacity: 0.3; }
    50% { opacity: 1; }
    100% { stroke-dashoffset: -100; opacity: 0.3; }
}
.data-stream { animation: dataFlow 2.5s linear infinite; stroke-dasharray: 8 4; }
.data-stream-delay-1 { animation-delay: 0.5s; }
.data-stream-delay-2 { animation-delay: 1s; }
.data-stream-delay-3 { animation-delay: 1.5s; }
.data-stream-delay-4 { animation-delay: 2s; }

/* ── Journey Timeline ────────────────────────────── */
.journey-stage {
    flex: 1;
    min-width: 280px;
    padding: 2rem;
    border-radius: 1.5rem;
    background: white;
    border: 2px solid #e8edf7;
    transition: all 0.4s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.journey-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(75,95,174,0.05), rgba(127,146,216,0.1));
    opacity: 0;
    transition: opacity 0.4s;
}
.journey-stage.active, .journey-stage:hover { border-color: var(--primary); box-shadow: 0 20px 50px rgba(75,95,174,0.15); }
.journey-stage.active::before, .journey-stage:hover::before { opacity: 1; }
.stage-number {
    width: 40px; height: 40px;
    background: rgba(75,95,174,0.1);
    border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.125rem; color: var(--primary);
    margin-bottom: 1rem;
    transition: all 0.3s;
}
.journey-stage.active .stage-number, .journey-stage:hover .stage-number {
    background: var(--primary); color: white;
}

/* ── Stats Counter ───────────────────────────────── */
.stat-counter { font-variant-numeric: tabular-nums; }

/* ── Dashboard Mock ──────────────────────────────── */
.dashboard-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e8edf7;
    padding: 1.25rem;
}
.metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
}
.metric-up { background: rgba(0,168,107,0.1); color: var(--success); }
.metric-down { background: rgba(255,140,0,0.1); color: var(--warning); }

/* ── Automation Pyramid ──────────────────────────── */
.pyramid-layer {
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}
.pyramid-layer:hover { filter: brightness(1.1); }
.pyramid-layer .layer-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 1rem;
    background: var(--dark);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    width: 260px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 10;
}
.pyramid-layer:hover .layer-tooltip { opacity: 1; pointer-events: auto; }

/* ── Industry Cards ──────────────────────────────── */
.industry-panel {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    background: var(--dark);
    min-height: 160px;
    cursor: pointer;
    transition: all 0.4s;
}
.industry-panel:hover { transform: translateY(-8px); box-shadow: 0 30px 80px rgba(0,0,0,0.3); }
.industry-panel-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--dark));
    opacity: 0.9;
    transition: opacity 0.4s;
}
.industry-panel:hover .industry-panel-bg { opacity: 0.8; }
.industry-panel-content { position: relative; z-index: 2; height: 100%; padding: 2rem; display: flex; flex-direction: column; justify-content: flex-end; }
.industry-hover-details { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.industry-panel:hover .industry-hover-details { max-height: 300px; }

/* ── Case Study Cards ────────────────────────────── */
.kpi-before-after {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

/* ── Partners Grid ───────────────────────────────── */
.partner-logo {
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem 2rem;
    border: 1px solid #e8edf7;
    border-radius: 1rem;
    font-weight: 700;
    color: #6b7280;
    font-size: 0.875rem;
    transition: all 0.3s;
    background: white;
}
.partner-logo:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 8px 24px rgba(75,95,174,0.12); }

/* ── Assessment Tool ─────────────────────────────── */
.assessment-step { display: none; }
.assessment-step.active { display: block; }
.score-ring-progress {
    transition: stroke-dashoffset 1s ease;
}

/* ── Forms ───────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: var(--dark);
    background: white;
    transition: all 0.2s;
    outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,95,174,0.1); }
.form-input:hover:not(:focus) { border-color: #cbd5e1; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.375rem; }
.form-group { margin-bottom: 1.25rem; }

/* ── Admin Panel ─────────────────────────────────── */
.admin-sidebar { width: 260px; min-height: 100vh; background: var(--dark); }
.admin-nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.admin-nav-item:hover, .admin-nav-item.active { background: rgba(75,95,174,0.2); color: white; }
.admin-nav-item.active { background: var(--primary); color: white; }

/* ── Animations ──────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.7s cubic-bezier(0.4,0,0.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left { opacity: 0; transform: translateX(-30px); transition: all 0.7s cubic-bezier(0.4,0,0.2,1); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(30px); transition: all 0.7s cubic-bezier(0.4,0,0.2,1); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.stagger > * { opacity: 0; transform: translateY(20px); transition: all 0.6s cubic-bezier(0.4,0,0.2,1); }
.stagger.visible > *:nth-child(1)  { opacity:1; transform:none; transition-delay: 0ms; }
.stagger.visible > *:nth-child(2)  { opacity:1; transform:none; transition-delay: 100ms; }
.stagger.visible > *:nth-child(3)  { opacity:1; transform:none; transition-delay: 200ms; }
.stagger.visible > *:nth-child(4)  { opacity:1; transform:none; transition-delay: 300ms; }
.stagger.visible > *:nth-child(5)  { opacity:1; transform:none; transition-delay: 400ms; }
.stagger.visible > *:nth-child(6)  { opacity:1; transform:none; transition-delay: 500ms; }
.stagger.visible > *:nth-child(7)  { opacity:1; transform:none; transition-delay: 600ms; }
.stagger.visible > *:nth-child(8)  { opacity:1; transform:none; transition-delay: 700ms; }
.stagger.visible > *:nth-child(9)  { opacity:1; transform:none; transition-delay: 800ms; }
.stagger.visible > *:nth-child(10) { opacity:1; transform:none; transition-delay: 900ms; }

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Page Loader ─────────────────────────────────── */
#page-loader.hidden { opacity: 0; pointer-events: none; transition: opacity 0.4s; }

/* ════════════════════════════════════════════════════
   RESPONSIVE — all breakpoints
════════════════════════════════════════════════════ */

/* ── Large tablets & small desktops (≤1024px) ─────── */
@media (max-width: 1024px) {
    /* Admin: slide sidebar off-canvas */
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 200;
        transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow-y: auto;
    }
    .admin-sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,0.4); }
    .admin-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
        backdrop-filter: blur(2px);
    }
    .admin-overlay.open { display: block; }
    /* Admin main fills full width when sidebar hidden */
    .admin-main-wrap { margin-left: 0 !important; width: 100% !important; }
}

/* ── Tablets (≤768px) ──────────────────────────────── */
@media (max-width: 768px) {
    /* Typography */
    .display-heading { letter-spacing: -0.02em; }

    /* Hero: hide ecosystem diagram, show full copy */
    #ecosystem-diagram { display: none !important; }

    /* Buttons: full-width stacked on phones */
    .hero-copy .flex.flex-wrap.gap-4 { flex-direction: column; }
    .hero-copy .btn-primary,
    .hero-copy .btn-outline { width: 100%; justify-content: center; }

    /* Mini stats: tighter on mobile */
    .hero-copy .grid.grid-cols-3 { gap: 1rem; }

    /* Journey stages: full width, no min-width overflow */
    .journey-stage { min-width: 100%; flex: none; }

    /* Ecosystem nodes (if shown) */
    .ecosystem-node .node-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .ecosystem-node .node-label { font-size: 0.625rem; }

    /* Pyramid tooltips: appear above, not to the right */
    .pyramid-layer .layer-tooltip {
        left: 50%;
        right: auto;
        top: auto;
        bottom: calc(100% + 8px);
        transform: translateX(-50%);
        margin-left: 0;
        width: min(260px, 90vw);
    }

    /* Industry panels: shorter on mobile */
    .industry-panel { min-height: 260px; }

    /* KPI before/after: stack vertically */
    .kpi-before-after { grid-template-columns: 1fr; text-align: center; }

    /* Cards: less padding */
    .card-elevated { padding: 1.25rem; border-radius: 1rem; }
    .card { padding: 1.25rem; border-radius: 1rem; }

    /* Forms: full width fields */
    .form-input { font-size: 1rem; } /* prevents iOS zoom */

    /* Admin header toggle button visible */
    .admin-menu-btn { display: flex !important; }

    /* Partner logos: smaller padding */
    .partner-logo { padding: 0.875rem 1rem; font-size: 0.75rem; }

    /* Tables: horizontal scroll */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-responsive table { min-width: 600px; }
}

/* ── Mobile phones (≤480px) ───────────────────────── */
@media (max-width: 480px) {
    /* Tighter section padding */
    section.py-24 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    section.py-20 { padding-top: 3rem; padding-bottom: 3rem; }
    section.py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

    /* Hero heading smaller */
    #hero h1 { font-size: 2.5rem !important; }

    /* Certification badges: stack */
    #hero .flex.flex-wrap.items-center.gap-3 { flex-direction: column; align-items: flex-start; }

    /* Stats grid */
    .hero-copy .grid.grid-cols-3 { grid-template-columns: repeat(3,1fr); gap: 0.5rem; }

    /* Industry panels */
    .industry-panel { min-height: 220px; }
    .industry-panel-content { padding: 1.25rem; }

    /* Journey stage */
    .journey-stage { padding: 1.25rem; }

    /* Card elevation */
    .card-elevated { padding: 1rem; }

    /* Back-to-top + WhatsApp: prevent overlap */
    #back-to-top { bottom: 5rem; left: 1rem; }
    a[aria-label="Chat on WhatsApp"] { bottom: 1.5rem; right: 1rem; }

    /* Topbar: hide tagline text on very small screens */
    #topbar .text-brand-300 { display: none; }

    /* Admin table: tighter cells */
    .admin-main-wrap table th,
    .admin-main-wrap table td { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
}

/* ── Extra small (≤360px) ─────────────────────────── */
@media (max-width: 360px) {
    #hero h1 { font-size: 2rem !important; }
    .btn-primary, .btn-outline { padding: 0.625rem 1rem; font-size: 0.875rem; }
}

/* ── Touch: disable hover transforms on touch devices ─ */
@media (hover: none) {
    .card:hover, .card-elevated:hover { transform: none; }
    .industry-panel:hover { transform: none; }
    .btn-primary:hover, .btn-outline:hover { transform: none; }
    /* Show industry hover details by default on touch */
    .industry-hover-details { max-height: 300px !important; }
}

/* ── Landscape phones ─────────────────────────────── */
@media (max-width: 768px) and (orientation: landscape) {
    #hero { min-height: auto; padding-top: 5rem; padding-bottom: 3rem; }
    #hero h1 { font-size: 2.25rem !important; }
}
