/* ============================================================
   TRAKANALYTICA DATA LAB — MAIN STYLESHEET
   General/shared styles only.
   Header styles → css/header.css
   Footer styles → css/footer.css
   Page styles   → css/<page>.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,300;1,9..40,400&display=swap');

:root {
    /* Core Palette - Light Mode */
    --bg-base: #f8f8fc;
    --bg-surface: #f1f1f7;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f4ff;

    /* Brand */
    --accent-primary: #6d28d9;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #5b21b6;
    --accent-glow: rgba(109, 40, 217, 0.18);
    --accent-glow-soft: rgba(109, 40, 217, 0.07);

    /* Text */
    --text-primary: #14142b;
    --text-secondary: #4a4a6a;
    --text-muted: #8080a0;
    --text-accent: #6d28d9;

    /* Borders */
    --border-subtle: rgba(109, 40, 217, 0.1);
    --border-medium: rgba(109, 40, 217, 0.2);
    --border-strong: rgba(109, 40, 217, 0.38);

    /* Category Colors */
    --health: #0891b2;
    --health-glow: rgba(8, 145, 178, 0.1);
    --economic: #059669;
    --economic-glow: rgba(5, 150, 105, 0.1);
    --survey: #d97706;
    --survey-glow: rgba(217, 119, 6, 0.1);
    --training: #7c3aed;
    --training-glow: rgba(124, 58, 237, 0.1);

    /* Spacing */
    --section-py: 96px;
    --container-max: 1600px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 600; }
p { color: var(--text-secondary); line-height: 1.75; }
strong { color: var(--text-primary); font-weight: 600; }

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 48px;
}

/* ===== SECTIONS ===== */
.section { padding: var(--section-py) 0; }
.alt-section { background: var(--bg-surface); }

.section-header { margin-bottom: 56px; }
.section-header.centered { text-align: center; }
.section-header.centered .section-desc { max-width: 620px; margin: 0 auto; }

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-bottom: 12px;
    padding: 5px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    background: var(--accent-glow-soft);
}

.section-title { margin-bottom: 16px; }
.section-desc { font-size: 1.05rem; color: var(--text-secondary); }

.gradient-text {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== FORM INPUTS ===== */
.form-input {
    padding: 11px 16px;
    border: 1.5px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1;
}
.form-input:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px var(--accent-glow-soft);
}
.form-input::placeholder { color: var(--text-muted); }

.hero-search-bar {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}
.hero-search-bar form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 520px;
}
.hero-search-bar .form-input { flex: 1; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow);
    filter: brightness(1.08);
}
.btn-outline {
    background: white;
    color: var(--text-primary);
    border-color: var(--border-medium);
}
.btn-outline:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: var(--accent-glow-soft);
    transform: translateY(-2px);
}
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 15px 32px; font-size: 1rem; }

/* ===== SHARED PAGE HERO ===== */
.page-hero {
    position: relative;
    padding: 80px 0 72px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}
.page-hero-bg {
    position: absolute; inset: 0;
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { margin: 12px 0 20px; }
.page-hero p { font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== FLASH / TOAST ===== */
/* (Flash banner styles live inline in footer.php; no duplicates needed here) */

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== AUTH PAGES ===== */
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; background: #fff; border-radius: 20px; padding: 40px; box-shadow: 0 8px 40px rgba(0,0,0,.08); border: 1px solid var(--border-subtle); }
@media (max-width: 520px) {
    .auth-card { padding: 28px 20px; border-radius: 12px; }
}

/* ===== FORMS ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; gap: 12px; }
}

/* ===== TABLES ===== */
@media (max-width: 768px) {
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }
}

/* ===== RESPONSIVE — GENERAL ===== */
@media (max-width: 1200px) {
    .container { padding: 0 32px; }
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    h1 { font-size: clamp(1.8rem, 8vw, 2.5rem); }
    h2 { font-size: clamp(1.4rem, 6vw, 1.8rem); }
    .section { padding: 48px 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 20px; }
}