/* ===== MILO WHITELABEL LANDING PAGE - MOBILE FIRST ===== */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Cores neutras */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Tipografia */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Espaçamentos */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Bordas */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transições */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    font-size: 16px;
    overflow-x: hidden;
}

/* ===== TIPOGRAFIA ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--gray-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--gray-700);
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-lg);
    font-weight: 300;
}

.header .highlight {
    background: rgba(255,255,255,0.2);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    display: inline-block;
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
}

/* ===== PROGRESS INDICATOR ===== */
.progress-indicator {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    padding: var(--space-sm) 0;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    transition: width var(--transition-normal);
    width: 0%;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-align: center;
    margin: 0;
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.main-content {
    padding: var(--space-xl) 0;
}

.content-section {
    margin-bottom: var(--space-3xl);
    scroll-margin-top: 80px; /* Account for sticky progress bar */
    animation: fadeInUp 0.6s ease-out;
}

.content-section:last-child {
    margin-bottom: var(--space-xl);
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Section headers with better spacing */
.content-section h2 {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--gray-200);
    position: relative;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

/* ===== ACCORDIONS OTIMIZADOS (ELEMENTOS EXPANSÍVEIS) ===== */
.accordion {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.accordion-item {
    border-bottom: 1px solid var(--gray-200);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    min-height: 44px; /* Minimum touch target size */
    padding: var(--space-lg);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    transition: all var(--transition-normal);
    position: relative;
    /* Ensure entire area is clickable */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.accordion-header:hover {
    background: var(--gray-50);
    transform: translateY(-1px);
}

.accordion-header:active {
    transform: translateY(0);
}

.accordion-header.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.accordion-header.active:hover {
    background: var(--primary-dark);
}

.accordion-icon {
    width: 24px; /* Increased for better touch target */
    height: 24px;
    transition: transform var(--transition-normal);
    flex-shrink: 0;
    margin-left: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
    background: white;
}

.accordion-content.active {
    max-height: 3000px; /* Increased for larger content */
}

.accordion-body {
    padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--gray-200);
}

/* Progressive disclosure animation */
.accordion-content.active .accordion-body > * {
    animation: slideInContent 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

.accordion-content.active .accordion-body > *:nth-child(1) { animation-delay: 0.1s; }
.accordion-content.active .accordion-body > *:nth-child(2) { animation-delay: 0.2s; }
.accordion-content.active .accordion-body > *:nth-child(3) { animation-delay: 0.3s; }
.accordion-content.active .accordion-body > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInContent {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-md);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    font-size: 1.25rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

/* ===== GRID RESPONSIVO ===== */
.grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

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

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

/* ===== TABELAS RESPONSIVAS ===== */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-900);
    position: sticky;
    top: 0;
}

.table tr:hover {
    background: var(--gray-50);
}

/* ===== BADGES E TAGS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-right: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--secondary-color);
    color: white;
}

.badge-warning {
    background: var(--accent-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-gray {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    gap: var(--space-sm);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* ===== PROGRESS BAR ===== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    transition: width var(--transition-slow);
}

/* ===== ESTATÍSTICAS ===== */
.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--gray-200);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-xl) 0;
    text-align: center;
    margin-top: var(--space-3xl);
}

/* ===== RESPONSIVIDADE ===== */

/* Tablet */
@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-xl);
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-tab {
        font-size: 1rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .header h1 {
        font-size: 3.5rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .main-content {
        padding: var(--space-2xl) 0;
    }
}

/* ===== ANIMAÇÕES ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== UTILITÁRIOS ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-gray { color: var(--gray-600); }
.text-success { color: var(--secondary-color); }
.text-warning { color: var(--accent-color); }
.text-danger { color: var(--danger-color); }

/* ===== SCROLL SUAVE ===== */
html {
    scroll-behavior: smooth;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .stat-card {
        padding: var(--space-md);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .progress-text {
        font-size: 0.7rem;
    }
    
    .card {
        padding: var(--space-md);
    }
    
    .accordion-header {
        padding: var(--space-md);
        font-size: 1rem;
    }
    
    .accordion-body {
        padding: var(--space-md);
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: var(--space-sm);
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
}

/* ===== PRINT STYLES ===== */
@media print {
    .progress-indicator,
    .footer,
    .btn {
        display: none !important;
    }
    
    .content-section {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: var(--space-lg);
    }
    
    .accordion-content {
        max-height: none !important;
        display: block !important;
    }
    
    .accordion-header {
        background: white !important;
        color: var(--gray-900) !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
        page-break-inside: avoid;
        margin-bottom: var(--space-md);
    }
    
    .header {
        background: white !important;
        color: var(--gray-900) !important;
    }
    
    .header h1 {
        color: var(--gray-900) !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
[data-theme="dark"] {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;
}

[data-theme="dark"] body {
    background-color: var(--gray-50);
    color: var(--gray-800);
}

[data-theme="dark"] .card,
[data-theme="dark"] .accordion,
[data-theme="dark"] .table-container,
[data-theme="dark"] .progress-indicator {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* Focus styles for better accessibility */
.accordion-header:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced focus for accordion headers */
.accordion-header:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1);
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --secondary-color: #008000;
        --danger-color: #ff0000;
        --gray-200: #000000;
        --gray-800: #000000;
        --gray-900: #000000;
    }
    
    .card,
    .accordion,
    .table-container {
        border: 2px solid #000000;
    }
}

/* ===== READING EXPERIENCE ENHANCEMENTS ===== */
/* Smooth section transitions */
.content-section {
    position: relative;
}

.content-section::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
}

.content-section:first-child::before {
    display: none;
}

/* Enhanced readability */
.content-section p {
    max-width: 65ch; /* Optimal reading width */
    line-height: 1.7;
}

/* Visual breathing room */
.content-section > *:not(:last-child) {
    margin-bottom: var(--space-lg);
}

/* Sticky section indicators (optional) */
.section-indicator {
    position: fixed;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: none; /* Hidden by default, can be enabled */
}

@media (min-width: 1200px) {
    .section-indicator {
        display: block;
    }
}

.section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    margin: var(--space-sm) 0;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.section-dot.active {
    background: var(--primary-color);
    transform: scale(1.5);
}

/* Improved accordion spacing for better reading flow */
.accordion + .accordion {
    margin-top: var(--space-xl);
}

/* Better visual hierarchy for nested content */
.accordion-body h4 {
    color: var(--primary-color);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
}

.accordion-body h5 {
    color: var(--gray-700);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

/* Enhanced mobile reading experience */
@media (max-width: 768px) {
    .content-section {
        margin-bottom: var(--space-2xl);
    }
    
    .content-section h2 {
        font-size: 1.5rem;
        margin-bottom: var(--space-lg);
    }
    
    .accordion-header {
        font-size: 1rem;
        padding: var(--space-md);
    }
    
    .accordion-body {
        padding: var(--space-md);
    }
    
    /* Larger touch targets on mobile */
    .accordion-header {
        min-height: 48px;
    }
    
    .accordion-icon {
        width: 28px;
        height: 28px;
    }
}