/* ===================================================
   Sereno Lab - Design System + Components
   Phase 1A - Public Website
   =================================================== */

/* --- CSS Variables (fallbacks — overridden by PHP inline <style>) --- */
:root {
    --sl-primary:   #6366f1;
    --sl-secondary: #818cf8;
    --sl-bg:        #0f172a;
    --sl-surface:   #1e293b;
    --sl-text:      #e2e8f0;
    --sl-muted:     #94a3b8;
    --sl-radius:    12px;
    --sl-radius-sm: 8px;
    --sl-shadow:    0 4px 24px rgba(0,0,0,0.3);
    --sl-transition: 0.3s ease;
    --sl-max-width: 1200px;
    --sl-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--sl-font);
    background: var(--sl-bg);
    color: var(--sl-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--sl-primary); text-decoration: none; transition: color var(--sl-transition); }
a:hover { color: var(--sl-secondary); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* --- Utility --- */
.sl-container { max-width: var(--sl-max-width); margin: 0 auto; padding: 0 1.5rem; }
.sl-section { padding: 5rem 0; }
.sl-section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.sl-section-subtitle {
    text-align: center;
    color: var(--sl-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.sl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: var(--sl-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--sl-transition);
    text-decoration: none;
}
.sl-btn-primary {
    background: var(--sl-primary);
    color: #fff;
}
.sl-btn-primary:hover {
    background: var(--sl-secondary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.35);
}
.sl-btn-outline {
    background: transparent;
    color: var(--sl-primary);
    border: 2px solid var(--sl-primary);
}
.sl-btn-outline:hover {
    background: var(--sl-primary);
    color: #fff;
}
.sl-btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.sl-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 50px;
    color: var(--sl-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Navbar --- */
.sl-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--sl-transition);
    background: transparent;
}
.sl-navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    padding: 0.6rem 0;
}
.sl-navbar .sl-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sl-navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sl-text);
}
.sl-navbar-brand:hover { color: var(--sl-text); }
.sl-navbar-brand span { color: var(--sl-primary); }
.sl-navbar-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.sl-navbar-nav a {
    color: var(--sl-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--sl-transition);
}
.sl-navbar-nav a:hover,
.sl-navbar-nav a.active { color: var(--sl-text); }
.sl-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}
.sl-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--sl-text);
    transition: all var(--sl-transition);
}

/* Mobile menu */
@media (max-width: 768px) {
    .sl-hamburger { display: flex; }
    .sl-navbar-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--sl-surface);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right var(--sl-transition);
        box-shadow: -4px 0 20px rgba(0,0,0,0.5);
        z-index: 1001;
    }
    .sl-navbar-nav.open { right: 0; }
    .sl-navbar-nav a { font-size: 1.1rem; }
    .sl-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    .sl-mobile-overlay.open { display: block; }
}

/* --- Hero --- */
.sl-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(135deg, var(--sl-bg) 0%, #1a1a3e 50%, var(--sl-bg) 100%);
    position: relative;
    overflow: hidden;
}
.sl-hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}
.sl-hero-content { max-width: 700px; }
.sl-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}
.sl-hero h1 span { color: var(--sl-primary); }
.sl-hero p {
    font-size: 1.2rem;
    color: var(--sl-muted);
    margin-bottom: 2rem;
    max-width: 550px;
}
.sl-hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 768px) {
    .sl-hero h1 { font-size: 2.2rem; }
    .sl-hero p { font-size: 1rem; }
    .sl-hero { min-height: auto; padding: 8rem 0 4rem; }
}

/* --- Cards Grid --- */
.sl-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.sl-card {
    background: var(--sl-surface);
    border-radius: var(--sl-radius);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all var(--sl-transition);
}
.sl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sl-shadow);
    border-color: rgba(99,102,241,0.2);
}
.sl-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--sl-radius-sm);
    background: rgba(99,102,241,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}
.sl-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}
.sl-card p { color: var(--sl-muted); font-size: 0.95rem; }

/* --- Testimonials (placeholder) --- */
.sl-testimonial {
    background: var(--sl-surface);
    border-radius: var(--sl-radius);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
}
.sl-testimonial::before {
    content: '\201C';
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 3rem;
    color: var(--sl-primary);
    opacity: 0.3;
    line-height: 1;
}
.sl-testimonial p { color: var(--sl-muted); font-style: italic; margin-bottom: 1rem; padding-top: 1.5rem; }
.sl-testimonial-author { font-weight: 600; font-size: 0.9rem; }
.sl-testimonial-role { color: var(--sl-muted); font-size: 0.8rem; }

/* --- FAQ Accordion --- */
.sl-faq-list { max-width: 800px; margin: 0 auto; }
.sl-faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sl-faq-question {
    width: 100%;
    padding: 1.25rem 0;
    background: none;
    border: none;
    color: var(--sl-text);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--sl-font);
}
.sl-faq-question:hover { color: var(--sl-primary); }
.sl-faq-icon {
    font-size: 1.25rem;
    transition: transform var(--sl-transition);
    color: var(--sl-primary);
    flex-shrink: 0;
    margin-left: 1rem;
}
.sl-faq-item.open .sl-faq-icon { transform: rotate(45deg); }
.sl-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}
.sl-faq-item.open .sl-faq-answer {
    max-height: 500px;
}
.sl-faq-answer-inner {
    padding: 0 0 1.25rem 0;
    color: var(--sl-muted);
    line-height: 1.7;
}

/* --- Footer --- */
.sl-footer {
    background: var(--sl-surface);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 3rem 0 1.5rem;
}
.sl-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.sl-footer-brand { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.sl-footer-brand span { color: var(--sl-primary); }
.sl-footer-desc { color: var(--sl-muted); font-size: 0.9rem; max-width: 300px; }
.sl-footer h4 { font-size: 0.95rem; margin-bottom: 1rem; color: var(--sl-text); }
.sl-footer ul li { margin-bottom: 0.5rem; }
.sl-footer ul a { color: var(--sl-muted); font-size: 0.9rem; }
.sl-footer ul a:hover { color: var(--sl-primary); }
.sl-footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--sl-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .sl-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .sl-footer-desc { max-width: none; margin: 0 auto; }
}

/* --- Plans Page --- */
/* Toggle switch (PIX / Cartao) */
.sl-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}
.sl-toggle-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--sl-muted);
    transition: color var(--sl-transition);
}
.sl-toggle-label.active { color: var(--sl-text); }
.sl-toggle {
    position: relative;
    width: 56px;
    height: 30px;
    cursor: pointer;
}
.sl-toggle input { display: none; }
.sl-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--sl-primary);
    border-radius: 50px;
    transition: background var(--sl-transition);
}
.sl-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--sl-transition);
}
.sl-toggle input:checked + .sl-toggle-slider::before {
    transform: translateX(26px);
}

/* Plan cards */
.sl-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 1024px) {
    .sl-plans-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .sl-plans-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
}
.sl-plan-card {
    background: var(--sl-surface);
    border-radius: var(--sl-radius);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    position: relative;
    transition: all var(--sl-transition);
}
.sl-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sl-shadow);
}
.sl-plan-card.popular {
    border-color: var(--sl-primary);
    box-shadow: 0 0 30px rgba(99,102,241,0.2);
}
.sl-plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sl-primary);
    color: #fff;
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.sl-plan-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}
.sl-plan-desc {
    color: var(--sl-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    min-height: 40px;
}
.sl-plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.sl-plan-price .currency { font-size: 1.2rem; vertical-align: super; }
.sl-plan-period {
    color: var(--sl-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.sl-plan-setup {
    color: var(--sl-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: var(--sl-radius-sm);
}
.sl-plan-features {
    text-align: left;
    margin-bottom: 1.5rem;
}
.sl-plan-features li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--sl-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sl-plan-features li .check {
    color: var(--sl-primary);
    font-weight: bold;
    flex-shrink: 0;
}
.sl-plan-features li .cross {
    color: #475569;
    flex-shrink: 0;
}
.sl-plan-cta { width: 100%; }
.sl-plan-card.popular .sl-plan-cta {
    background: var(--sl-primary);
    color: #fff;
}

/* --- Comparison Table --- */
.sl-comparison-wrapper {
    overflow-x: auto;
    margin-top: 4rem;
}
.sl-comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}
.sl-comparison-table th,
.sl-comparison-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}
.sl-comparison-table th {
    background: var(--sl-surface);
    font-weight: 700;
    position: sticky;
    top: 0;
}
.sl-comparison-table td:first-child {
    text-align: left;
    color: var(--sl-muted);
    font-weight: 500;
}
.sl-comparison-table tr:hover td {
    background: rgba(99,102,241,0.05);
}

/* --- Tooltip (Comparison Table) --- */
.sl-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(99,102,241,0.15);
    color: var(--sl-primary);
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.4rem;
    cursor: help;
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
}
.sl-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--sl-surface);
    color: var(--sl-text);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.6rem 0.85rem;
    border-radius: var(--sl-radius-sm);
    border: 1px solid rgba(99,102,241,0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    white-space: normal;
    width: 260px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}
.sl-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(99,102,241,0.2);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 11;
}
.sl-tooltip:hover::after,
.sl-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* --- Animations --- */
@keyframes sl-fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.sl-animate {
    opacity: 0;
    animation: sl-fadeInUp 0.6s ease forwards;
}
.sl-animate-delay-1 { animation-delay: 0.1s; }
.sl-animate-delay-2 { animation-delay: 0.2s; }
.sl-animate-delay-3 { animation-delay: 0.3s; }
.sl-animate-delay-4 { animation-delay: 0.4s; }
