/* ═══════════════════════════════════════════════════════════════════
   INTRALAB IO — Design System CSS
   Guia de estilos para webapps da Intralab IO
   Versão: 1.0
   ═══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────
   1. DESIGN TOKENS
   ───────────────────────────────────────────── */

:root {

    /* ── Brand Blues ── */
    --blue-dark:      #1a3a5c;
    --blue-mid:       #2d6ca3;
    --blue-primary:   #4a90c4;
    --blue-light:     #6aafe0;
    --blue-lighter:   #9fcbee;
    --blue-pale:      #e8f2fb;
    --blue-bg:        #f3f8fd;

    /* ── Accent ── */
    --accent:         #00b4d8;
    --accent-light:   rgba(0, 180, 216, 0.12);

    /* ── Neutrals ── */
    --white:          #ffffff;
    --gray-50:        #f8fafc;
    --gray-100:       #f1f5f9;
    --gray-200:       #e2e8f0;
    --gray-300:       #cbd5e1;
    --gray-400:       #94a3b8;
    --gray-500:       #64748b;
    --gray-600:       #475569;
    --gray-700:       #334155;
    --gray-800:       #1e293b;

    /* ── Semantic ── */
    --color-success:  #059669;
    --color-warning:  #d97706;
    --color-error:    #dc2626;
    --color-info:     var(--blue-primary);

    /* ── Typography ── */
    --font-display:   'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono:      'Space Mono', 'JetBrains Mono', monospace;

    --text-xs:        0.75rem;     /* 12px */
    --text-sm:        0.85rem;     /* ~14px */
    --text-base:      0.95rem;     /* ~15px */
    --text-md:        1.05rem;     /* ~17px */
    --text-lg:        1.2rem;      /* ~19px */
    --text-xl:        1.5rem;      /* 24px */
    --text-2xl:       1.8rem;      /* ~29px */
    --text-3xl:       2.2rem;      /* ~35px */
    --text-4xl:       clamp(2.4rem, 4.5vw, 3.5rem);

    --leading-tight:  1.15;
    --leading-normal: 1.7;
    --leading-relaxed:1.8;

    --tracking-tight: -1.5px;
    --tracking-normal:-0.5px;
    --tracking-wide:   1px;
    --tracking-wider:  2px;

    /* ── Spacing ── */
    --space-1:  0.25rem;   /* 4px */
    --space-2:  0.5rem;    /* 8px */
    --space-3:  0.75rem;   /* 12px */
    --space-4:  1rem;      /* 16px */
    --space-5:  1.25rem;   /* 20px */
    --space-6:  1.5rem;    /* 24px */
    --space-8:  2rem;      /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
    --space-section: 100px;

    /* ── Layout ── */
    --max-width:      1200px;
    --content-padding:2rem;
    --nav-height:     72px;

    /* ── Borders ── */
    --radius-xs:  6px;
    --radius-sm:  8px;
    --radius:     10px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  20px;
    --radius-full:9999px;

    /* ── Shadows ── */
    --shadow-xs:  0 1px 2px rgba(26, 58, 92, 0.04);
    --shadow-sm:  0 1px 3px rgba(26, 58, 92, 0.06);
    --shadow:     0 4px 20px rgba(26, 58, 92, 0.08);
    --shadow-md:  0 8px 30px rgba(26, 58, 92, 0.10);
    --shadow-lg:  0 12px 40px rgba(26, 58, 92, 0.12);
    --shadow-xl:  0 20px 50px rgba(26, 58, 92, 0.16);

    /* ── Transitions ── */
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --duration:   0.3s;
    --transition: var(--duration) var(--ease);
}


/* ─────────────────────────────────────────────
   2. RESET & BASE
   ───────────────────────────────────────────── */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 8px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-display);
    font-size: var(--text-base);
    color: var(--gray-600);
    background: var(--white);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg, video {
    display: block;
    max-width: 100%;
}

a {
    color: var(--blue-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--blue-dark);
}


/* ─────────────────────────────────────────────
   3. TIPOGRAFIA
   ───────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--blue-dark);
    line-height: var(--leading-tight);
}

h1 {
    font-size: var(--text-4xl);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
}

h2 {
    font-size: clamp(var(--text-2xl), 3.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -1px;
}

h3 {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: var(--tracking-normal);
}

h4 {
    font-size: var(--text-lg);
    font-weight: 700;
}

h5 {
    font-size: var(--text-md);
    font-weight: 700;
}

h6 {
    font-size: var(--text-base);
    font-weight: 700;
}

p {
    color: var(--gray-500);
    line-height: var(--leading-relaxed);
}

small {
    font-size: var(--text-sm);
    color: var(--gray-400);
}

strong, b {
    color: var(--blue-dark);
    font-weight: 700;
}

/* Texto com destaque na cor primária */
.text-highlight {
    color: var(--blue-primary);
}

/* Texto com gradiente (hero) */
.text-gradient {
    background: linear-gradient(135deg, var(--blue-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Labels técnicos (section labels, tags) */
.text-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--blue-primary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

/* Números / stats */
.text-mono {
    font-family: var(--font-mono);
}


/* ─────────────────────────────────────────────
   4. LAYOUT UTILITIES
   ───────────────────────────────────────────── */

.container {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
}

.section {
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
}

.section-alt {
    background: var(--gray-50);
}

.section-dark {
    background: var(--blue-dark);
    color: var(--white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
    color: var(--white);
}

.section-dark p {
    color: rgba(255, 255, 255, 0.7);
}

.section-dark .text-label {
    color: var(--blue-lighter);
}

/* Grid system */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }


/* ─────────────────────────────────────────────
   5. BOTÕES
   ───────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 14px 28px;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary — fundo azul escuro */
.btn-primary {
    background: var(--blue-dark);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--blue-mid);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Secondary — fundo azul primário */
.btn-secondary {
    background: var(--blue-primary);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--blue-mid);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Outline — borda cinza */
.btn-outline {
    background: transparent;
    color: var(--blue-dark);
    border: 2px solid var(--gray-200);
}

.btn-outline:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

/* Ghost — sem borda, sem fundo */
.btn-ghost {
    background: transparent;
    color: var(--blue-primary);
    padding: 14px 16px;
}

.btn-ghost:hover {
    background: var(--blue-pale);
    color: var(--blue-dark);
}

/* Accent — para seções escuras (Lucy) */
.btn-accent {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-accent:hover {
    background: var(--accent);
    color: var(--blue-dark);
}

/* White — para CTAs em fundo escuro */
.btn-white {
    background: var(--white);
    color: var(--blue-dark);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Tamanhos */
.btn-sm {
    padding: 10px 20px;
    font-size: var(--text-sm);
}

.btn-lg {
    padding: 18px 36px;
    font-size: var(--text-md);
}

/* Disabled */
.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}


/* ─────────────────────────────────────────────
   6. CARDS
   ───────────────────────────────────────────── */

.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    transition: all var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-lighter);
}

/* Card compacto */
.card-compact {
    padding: var(--space-8) var(--space-6);
}

/* Card em fundo escuro */
.card-dark {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-dark:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Card com destaque top bar */
.card-featured {
    position: relative;
    overflow: hidden;
}

.card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.card-featured:hover::before {
    opacity: 1;
}


/* ─────────────────────────────────────────────
   7. BADGES & TAGS
   ───────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--blue-mid);
    box-shadow: var(--shadow-xs);
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--blue-pale);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--blue-mid);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.tag-accent {
    background: var(--accent-light);
    color: var(--accent);
}

.tag-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--color-success);
}

.tag-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--color-warning);
}

.tag-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-error);
}


/* ─────────────────────────────────────────────
   8. ICON CONTAINERS
   ───────────────────────────────────────────── */

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--blue-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-box svg {
    width: 26px;
    height: 26px;
    stroke: var(--blue-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-box-sm {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.icon-box-sm svg {
    width: 20px;
    height: 20px;
}

.icon-box-lg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
}

.icon-box-lg svg {
    width: 32px;
    height: 32px;
}


/* ─────────────────────────────────────────────
   9. FORMULÁRIOS
   ───────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.form-input,
.form-textarea,
.form-select {
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-700);
    font-family: var(--font-display);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    transition: all var(--transition);
    outline: none;
    width: 100%;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 196, 0.12);
    background: var(--white);
}

.form-input:disabled,
.form-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 110px;
}

/* Variante de input com erro */
.form-input.error,
.form-textarea.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 2px;
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-error);
    margin-top: 2px;
}

/* Checkbox & Radio customizados */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--gray-600);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-primary);
    cursor: pointer;
}


/* ─────────────────────────────────────────────
   10. TABELAS
   ───────────────────────────────────────────── */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}

.table td {
    padding: var(--space-3) var(--space-4);
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover {
    background: var(--blue-pale);
}


/* ─────────────────────────────────────────────
   11. NAVBAR (estrutura de referência)
   ───────────────────────────────────────────── */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    padding: 0 var(--content-padding);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gray-200);
    transition: box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.navbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-500);
    transition: color var(--transition);
}

.navbar-link:hover {
    color: var(--blue-dark);
}


/* ─────────────────────────────────────────────
   12. LISTAS DE FEATURES (check items)
   ───────────────────────────────────────────── */

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-base);
    color: var(--gray-600);
    line-height: 1.6;
}

.check-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--blue-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}

.check-icon svg {
    width: 12px;
    height: 12px;
    stroke: var(--blue-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}


/* ─────────────────────────────────────────────
   13. ANIMAÇÕES & TRANSIÇÕES
   ───────────────────────────────────────────── */

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Fade in up */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Pulse (indicadores de status) */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* Spin (loading) */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}


/* ─────────────────────────────────────────────
   14. UTILITÁRIOS
   ───────────────────────────────────────────── */

/* Cores de texto */
.text-dark     { color: var(--blue-dark); }
.text-primary  { color: var(--blue-primary); }
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--gray-400); }
.text-body     { color: var(--gray-500); }
.text-white    { color: var(--white); }
.text-success  { color: var(--color-success); }
.text-warning  { color: var(--color-warning); }
.text-error    { color: var(--color-error); }

/* Backgrounds */
.bg-white      { background: var(--white); }
.bg-alt        { background: var(--gray-50); }
.bg-pale       { background: var(--blue-pale); }
.bg-dark       { background: var(--blue-dark); }
.bg-primary    { background: var(--blue-primary); }

/* Bordas */
.border        { border: 1px solid var(--gray-200); }
.border-blue   { border: 1px solid var(--blue-lighter); }

/* Arredondamento */
.rounded-sm    { border-radius: var(--radius-sm); }
.rounded       { border-radius: var(--radius); }
.rounded-md    { border-radius: var(--radius-md); }
.rounded-lg    { border-radius: var(--radius-lg); }
.rounded-xl    { border-radius: var(--radius-xl); }
.rounded-full  { border-radius: var(--radius-full); }

/* Sombras */
.shadow-sm     { box-shadow: var(--shadow-sm); }
.shadow        { box-shadow: var(--shadow); }
.shadow-md     { box-shadow: var(--shadow-md); }
.shadow-lg     { box-shadow: var(--shadow-lg); }

/* Texto */
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.text-right    { text-align: right; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono     { font-family: var(--font-mono); }
.uppercase     { text-transform: uppercase; letter-spacing: var(--tracking-wide); }

/* Overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Visualmente escondido (acessibilidade) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* ─────────────────────────────────────────────
   15. RESPONSIVIDADE
   ───────────────────────────────────────────── */

@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --content-padding: 1.25rem;
        --space-section: 64px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    h1 {
        letter-spacing: -1px;
    }
}