/* ============================================================================
   AQM BD — Quality Control & Inspection
   Premium enterprise stylesheet
   ============================================================================ */

:root {
    --qc-red: #E1251B;
    --qc-red-dark: #B91C14;
    --qc-red-light: #FF4D42;
    --qc-dark: #1A1A1A;
    --qc-dark-alt: #242424;
    --qc-gray-900: #111111;
    --qc-gray-800: #1E1E1E;
    --qc-gray-700: #2D2D2D;
    --qc-gray-600: #4A4A4A;
    --qc-gray-400: #999999;
    --qc-gray-300: #BBBBBB;
    --qc-gray-200: #E0E0E0;
    --qc-gray-100: #F5F5F5;
    --qc-white: #FFFFFF;
    --qc-amber: #F59E0B;
    --qc-green: #22C55E;
    --qc-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --qc-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    --qc-radius: 8px;
    --qc-radius-lg: 12px;
    --qc-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --qc-shadow-lg: 0 4px 20px rgba(0,0,0,0.10), 0 8px 32px rgba(0,0,0,0.06);
    --qc-shadow-xl: 0 8px 40px rgba(0,0,0,0.12), 0 16px 48px rgba(0,0,0,0.08);
    --qc-transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
    font-family: var(--qc-font);
    color: var(--qc-dark);
    background: var(--qc-gray-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Top Bar (lang switcher) ── */
.top-bar {
    background: var(--qc-dark);
    border-bottom: 1px solid var(--qc-gray-700);
    padding: 6px 0;
}
.top-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}
.lang-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 8px;
    color: var(--qc-gray-400);
    font-size: 13px;
    cursor: pointer;
    transition: var(--qc-transition);
    font-family: var(--qc-font);
}
.lang-btn:hover { color: var(--qc-white); border-color: var(--qc-gray-600); }
.lang-btn.active { color: var(--qc-white); border-color: var(--qc-red); background: rgba(225,37,27,0.15); }

/* ── Header ── */
.site-header {
    background: var(--qc-dark);
    padding: 28px 0 24px;
    text-align: center;
    position: relative;
}
.site-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--qc-red);
}
.header-logo {
    height: 48px;
    margin: 0 auto 12px;
    filter: brightness(0) invert(1);
}
.header-title {
    color: var(--qc-white);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.header-subtitle {
    color: var(--qc-gray-400);
    font-size: 13px;
    margin-top: 4px;
    letter-spacing: 1px;
}

/* ── Section Nav (sticky) ── */
.section-nav {
    background: var(--qc-white);
    border-bottom: 1px solid var(--qc-gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.section-nav .container {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.section-nav .container::-webkit-scrollbar { display: none; }
.nav-section-link {
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--qc-gray-600);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: var(--qc-transition);
    cursor: pointer;
}
.nav-section-link:hover { color: var(--qc-dark); }
.nav-section-link.active {
    color: var(--qc-red);
    border-bottom-color: var(--qc-red);
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--qc-gray-900) 0%, var(--qc-dark) 50%, var(--qc-gray-800) 100%);
    padding: 64px 0;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(225,37,27,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--qc-red), transparent);
}
.hero-content { position: relative; z-index: 1; }
.hero-tagline {
    color: var(--qc-red);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 12px;
}
.hero h2 {
    color: var(--qc-white);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}
.hero-desc {
    color: var(--qc-gray-300);
    font-size: 16px;
    max-width: 600px;
    margin-bottom: 40px;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 700px;
}
.stat-card {
    text-align: center;
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--qc-radius);
}
.stat-num {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--qc-red);
    line-height: 1;
}
.stat-label {
    display: block;
    color: var(--qc-gray-400);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* ── Calculator Section ── */
.section {
    padding: 64px 0;
}
.section-dark {
    background: var(--qc-gray-100);
}
.section-header {
    margin-bottom: 40px;
}
.section-label {
    color: var(--qc-red);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 8px;
}
.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--qc-dark);
    margin-bottom: 8px;
}
.section-desc {
    color: var(--qc-gray-600);
    font-size: 15px;
    max-width: 600px;
}

.calc-card {
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow-lg);
    overflow: hidden;
}
.calc-body { padding: 32px; }
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.calc-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--qc-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.calc-field select,
.calc-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--qc-gray-200);
    border-radius: var(--qc-radius);
    font-size: 15px;
    font-family: var(--qc-font);
    color: var(--qc-dark);
    background: var(--qc-white);
    transition: var(--qc-transition);
    appearance: none;
    -webkit-appearance: none;
}
.calc-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.calc-field select:focus,
.calc-field input:focus {
    outline: none;
    border-color: var(--qc-red);
    box-shadow: 0 0 0 3px rgba(225,37,27,0.1);
}
.calc-field input::placeholder { color: var(--qc-gray-400); }

.calc-full { grid-column: 1 / -1; }

.btn-calculate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--qc-red);
    color: var(--qc-white);
    border: none;
    padding: 14px 32px;
    border-radius: var(--qc-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--qc-font);
    cursor: pointer;
    transition: var(--qc-transition);
}
.btn-calculate:hover { background: var(--qc-red-dark); transform: translateY(-1px); }
.btn-calculate:active { transform: translateY(0); }

/* Results */
.calc-results {
    margin-top: 28px;
    display: none;
}
.calc-results.visible { display: block; }
.results-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--qc-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--qc-gray-200);
}
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--qc-gray-100);
    border-radius: var(--qc-radius);
    border-left: 3px solid var(--qc-gray-200);
}
.result-item.total {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #FFF5F5, #FFF0F0);
    border-left-color: var(--qc-red);
    font-weight: 700;
    font-size: 16px;
}
.result-label { color: var(--qc-gray-600); font-size: 13px; }
.result-value { font-weight: 600; color: var(--qc-dark); font-family: var(--qc-mono); }
.result-item.total .result-label { color: var(--qc-red-dark); font-size: 14px; }
.result-item.total .result-value { color: var(--qc-red); font-size: 18px; }

/* ── Map Section ── */
.map-wrapper {
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow);
    padding: 32px;
    position: relative;
}
.map-svg {
    width: 100%;
    height: auto;
    max-height: 500px;
}
.map-svg .country-bg { fill: var(--qc-gray-200); stroke: var(--qc-white); stroke-width: 0.5; }
.map-svg .country-active {
    fill: var(--qc-red);
    stroke: var(--qc-white);
    stroke-width: 1;
    cursor: pointer;
    transition: fill var(--qc-transition);
}
.map-svg .country-active:hover { fill: var(--qc-red-light); }

/* Map markers */
.map-marker {
    cursor: pointer;
    transition: transform var(--qc-transition);
}
.map-marker:hover { transform: scale(1.3); }
.map-marker circle { fill: var(--qc-red); stroke: var(--qc-white); stroke-width: 1.5; }
.map-marker text {
    fill: var(--qc-dark);
    font-size: 8px;
    font-weight: 600;
    font-family: var(--qc-font);
}

/* Country popup */
.country-popup {
    position: absolute;
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow-xl);
    border-top: 3px solid var(--qc-red);
    padding: 20px;
    min-width: 260px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.country-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.popup-close {
    position: absolute;
    top: 8px; right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--qc-gray-400);
    cursor: pointer;
    line-height: 1;
}
.popup-close:hover { color: var(--qc-dark); }
.popup-country {
    font-size: 18px;
    font-weight: 700;
    color: var(--qc-dark);
    margin-bottom: 12px;
}
.popup-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--qc-gray-100);
    font-size: 13px;
}
.popup-row:last-child { border-bottom: none; }
.popup-row-label { color: var(--qc-gray-600); }
.popup-row-value { font-weight: 600; color: var(--qc-dark); }
.popup-specialties {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--qc-gray-200);
}
.popup-specialties-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--qc-gray-400);
    margin-bottom: 6px;
}
.popup-tag {
    display: inline-block;
    background: var(--qc-gray-100);
    color: var(--qc-gray-600);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 2px 2px 2px 0;
}
.popup-select-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    background: var(--qc-red);
    color: var(--qc-white);
    border: none;
    border-radius: var(--qc-radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--qc-font);
    cursor: pointer;
    transition: var(--qc-transition);
}
.popup-select-btn:hover { background: var(--qc-red-dark); }

/* Map legend */
.map-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--qc-gray-200);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--qc-gray-600);
}
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}
.legend-dot.active { background: var(--qc-red); }
.legend-dot.inactive { background: var(--qc-gray-200); }

/* ── Methodology ── */
.aql-card {
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow);
    padding: 28px;
    margin-bottom: 32px;
    border-left: 4px solid var(--qc-red);
}
.aql-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.aql-card p {
    color: var(--qc-gray-600);
    font-size: 14px;
    line-height: 1.7;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.step-card {
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow);
    padding: 24px 16px;
    text-align: center;
    position: relative;
}
.step-card::after {
    content: '\2192';
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--qc-gray-300);
    font-size: 18px;
}
.step-card:last-child::after { display: none; }
.step-num {
    width: 36px; height: 36px;
    background: var(--qc-red);
    color: var(--qc-white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}
.step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--qc-dark);
    line-height: 1.4;
}

.defects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.defect-card {
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow);
    padding: 20px;
    border-top: 3px solid;
}
.defect-card.critical { border-top-color: var(--qc-red); }
.defect-card.major { border-top-color: var(--qc-amber); }
.defect-card.minor { border-top-color: var(--qc-green); }
.defect-level {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.defect-card.critical .defect-level { color: var(--qc-red); }
.defect-card.major .defect-level { color: var(--qc-amber); }
.defect-card.minor .defect-level { color: var(--qc-green); }
.defect-aql {
    font-size: 22px;
    font-weight: 700;
    color: var(--qc-dark);
    margin-bottom: 6px;
}
.defect-desc {
    font-size: 13px;
    color: var(--qc-gray-600);
    line-height: 1.5;
}

/* ── Tools / CTA Section ── */
.cta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.cta-card {
    background: var(--qc-white);
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow);
    padding: 32px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: var(--qc-transition);
    cursor: pointer;
}
.cta-card:hover {
    box-shadow: var(--qc-shadow-lg);
    transform: translateY(-2px);
}
.cta-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--qc-red), var(--qc-red-dark));
    border-radius: var(--qc-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.cta-text h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--qc-dark);
    margin-bottom: 6px;
}
.cta-text p {
    font-size: 13px;
    color: var(--qc-gray-600);
    line-height: 1.5;
}
.cta-arrow {
    margin-left: auto;
    color: var(--qc-gray-300);
    font-size: 20px;
    align-self: center;
    transition: var(--qc-transition);
}
.cta-card:hover .cta-arrow { color: var(--qc-red); transform: translateX(4px); }

/* ── Footer ── */
.qc-footer {
    background: var(--qc-dark);
    color: var(--qc-gray-400);
    padding: 40px 0 24px;
    margin-top: 0;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-brand-text {
    font-size: 14px;
}
.footer-brand-text strong { color: var(--qc-white); }
.footer-links-list {
    display: flex;
    gap: 24px;
}
.footer-links-list a {
    color: var(--qc-gray-400);
    font-size: 13px;
    transition: var(--qc-transition);
}
.footer-links-list a:hover { color: var(--qc-white); }
.footer-copy {
    width: 100%;
    text-align: center;
    font-size: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--qc-gray-700);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .hero h2 { font-size: 28px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .calc-grid { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: repeat(3, 1fr); }
    .step-card:nth-child(3)::after { display: none; }
    .defects-grid { grid-template-columns: 1fr; }
    .cta-grid { grid-template-columns: 1fr; }
    .map-legend { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .section { padding: 40px 0; }
    .hero { padding: 40px 0; }
    .hero h2 { font-size: 24px; }
    .hero-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-num { font-size: 22px; }
    .header-title { font-size: 16px; }
    .nav-section-link { padding: 12px 16px; font-size: 13px; }
    .calc-body { padding: 20px; }
    .steps-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .step-card::after { display: none; }
    .step-card { padding: 16px 12px; }
    .map-wrapper { padding: 16px; }
    .cta-card { padding: 20px; flex-direction: column; text-align: center; }
    .cta-arrow { display: none; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links-list { flex-wrap: wrap; justify-content: center; }
    .country-popup { min-width: 220px; }
}
