/* ==========================================================================
   FinControl - Premium Landing Page Styles
   Theme: Pearl White (Branco Pérola), Gold (Dourado), and Obsidian Black (Preto)
   ========================================================================== */

/* --- Design Tokens & Variables --- */
:root {
    /* Color Palette - Pearl, Gold, and Black */
    --bg-dark: #fbfbf8;       /* Pearl White main background */
    --bg-medium: #ffffff;     /* Pure white for page blocks */
    --bg-light: #f3f1e7;      /* Warm pearl accent */
    
    /* Brand Colors */
    --primary: #111111;       /* Obsidian Black */
    --primary-glow: rgba(17, 17, 17, 0.15);
    
    --secondary: #c5a059;     /* Soft Champagne Gold */
    --secondary-glow: rgba(197, 160, 89, 0.35);
    
    --gold-metallic: linear-gradient(135deg, #dfc07d 0%, #b89742 50%, #967524 100%);
    --gold-hover: linear-gradient(135deg, #ebd298 0%, #c9a752 50%, #a6842f 100%);
    --gold-solid: #b89742;
    --gold-dark: #8c6c1f;
    
    /* Financial States (Styled within theme) */
    --color-profit: #b89742;  /* Gold represents profits/success in this theme */
    --color-profit-glow: rgba(184, 151, 66, 0.25);
    --color-expense: #7c2d12; /* Deep Rust / Crimson Red for elegant expenses */
    --color-expense-glow: rgba(124, 45, 18, 0.15);
    --color-warning: #d97706; /* Dark Amber */
    --color-warning-glow: rgba(217, 119, 6, 0.15);
    
    /* Text Colors */
    --text-black: #111111;
    --text-high: #242424;
    --text-med: #575757;
    --text-muted: #8c8c8c;
    
    /* Borders & Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(184, 151, 66, 0.18);
    --glass-border-hover: rgba(184, 151, 66, 0.4);
    --glass-glow: 0 12px 40px 0 rgba(184, 151, 66, 0.08);
    
    /* Layout Constants */
    --max-width: 1200px;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    
    /* Typography */
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-high);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Pearl & Gold Glowing Backgrounds --- */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.35;
    transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bg-glow-1 {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    animation: floatGlow1 20s infinite alternate ease-in-out;
}

.bg-glow-2 {
    bottom: -100px;
    left: -100px;
    background: radial-gradient(circle, #ebd298 0%, transparent 70%);
    animation: floatGlow2 25s infinite alternate ease-in-out;
}

.bg-glow-3 {
    top: 40%;
    left: 45%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--bg-light) 0%, transparent 70%);
    opacity: 0.5;
}

@keyframes floatGlow1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-100px, 80px) scale(1.1); }
}

@keyframes floatGlow2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(120px, -90px) scale(0.9); }
}

/* --- Premium Header & Progress System --- */
.header {
    width: 100%;
    padding: 20px 0;
    background: rgba(251, 251, 248, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    max-height: 52px;
}

.logo-icon-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply; /* Make white background transparent on pearl canvas */
    transition: transform 0.3s ease;
}

.logo-icon-img:hover {
    transform: scale(1.06) rotate(5deg);
}

.logo-text {
    font-family: var(--font-header);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-black);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.progress-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-grow: 1;
    max-width: 450px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(17, 17, 17, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(17, 17, 17, 0.02);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--gold-solid) 100%);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--color-profit-glow);
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-med);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Sound Button */
.sound-toggle {
    background: rgba(17, 17, 17, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-black);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(17, 17, 17, 0.08);
    border-color: var(--glass-border-hover);
    transform: scale(1.05);
}

.sound-toggle:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

/* --- Layout Grid System --- */
.main-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
    width: 100%;
}

/* --- Column 1: Quiz Cards & Funnel --- */
.quiz-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 520px;
}

/* Pearl Glass Card */
.quiz-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    box-shadow: var(--glass-glow);
    display: none;
    flex-direction: column;
    animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.quiz-card.active {
    display: flex;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Welcome Intro Styling */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(184, 151, 66, 0.1);
    border: 1px solid rgba(184, 151, 66, 0.25);
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    align-self: flex-start;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--gold-solid);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--gold-solid);
    animation: dotPulse 1.5s infinite ease-in-out;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
}

.hero-title {
    font-family: var(--font-header);
    font-size: 38px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-black);
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-med);
    margin-bottom: 32px;
}

.hero-benefits {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 36px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.benefit-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(184, 151, 66, 0.15);
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-item span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-high);
}

.hero-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Premium Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-header);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gold-metallic);
    color: var(--text-black);
    box-shadow: 0 4px 18px rgba(184, 151, 66, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--gold-hover);
    box-shadow: 0 6px 22px rgba(184, 151, 66, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
}

/* Button Glow Ripple */
.btn-glow-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: all 0.6s ease;
}

.btn-glow-effect:hover::before {
    left: 100%;
}

/* Back button in Quiz */
.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-med);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 24px;
    transition: color 0.3s ease, transform 0.2s ease;
    opacity: 0.8;
}

.btn-back:hover {
    color: var(--text-black);
    transform: translateX(-3px);
    opacity: 1;
}

/* Quiz Steps Interface Styles */
.quiz-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 44px;
    box-shadow: var(--glass-glow);
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.question-title {
    font-family: var(--font-header);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-black);
    margin-bottom: 8px;
}

.question-subtitle {
    font-size: 14px;
    color: var(--text-med);
    margin-bottom: 28px;
}

/* Option Grid */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Tighter gap to save vertical space */
    width: 100%;
}

.options-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.option-card {
    background: rgba(17, 17, 17, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 11px 18px; /* Tighter padding to prevent overflow */
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.option-card:hover {
    background: rgba(184, 151, 66, 0.05);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.option-card.selected {
    background: rgba(17, 17, 17, 0.05);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(17, 17, 17, 0.05);
}

.option-card.selected-success {
    background: rgba(184, 151, 66, 0.08);
    border-color: var(--gold-solid);
    box-shadow: 0 4px 15px rgba(184, 151, 66, 0.12);
}

/* Card Icons */
.option-icon {
    width: 30px; /* Reduced from 38px */
    height: 30px; /* Reduced from 38px */
    border-radius: 6px;
    background: rgba(17, 17, 17, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-black);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.option-card:hover .option-icon {
    background: rgba(184, 151, 66, 0.2);
    color: var(--gold-dark);
}

.option-card.selected .option-icon {
    background: var(--primary);
    color: var(--bg-medium);
}

.option-card.selected-success .option-icon {
    background: var(--gold-solid);
    color: var(--bg-medium);
}

.option-text {
    font-size: 13.5px; /* Reduced from 15px */
    font-weight: 600;
    color: var(--text-high);
    flex-grow: 1;
    line-height: 1.35;
}

/* Multi-select checkmark box */
.checkbox-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.option-card.selected .checkbox-box {
    border-color: var(--primary);
    background: var(--primary);
}

.checkbox-box svg {
    color: var(--bg-medium);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.option-card.selected .checkbox-box svg {
    opacity: 1;
}

/* Multi-select Action Buttons container */
.quiz-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* Click Ripple effect styling */
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(184, 151, 66, 0.2);
    transform: scale(0);
    animation: ripple 0.5s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- Transition Steps / Screen Feedback --- */
.screen-transition {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 10px;
}

.transition-illustration {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
}

.radar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 151, 66, 0.15) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    animation: radarRipple 2s infinite ease-out;
}

@keyframes radarRipple {
    0% { width: 40px; height: 40px; opacity: 1; }
    100% { width: 150px; height: 150px; opacity: 0; }
}

.transition-circle-decor {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110px;
    height: 110px;
    border: 2px dashed rgba(17, 17, 17, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: rotateDecor 15s infinite linear;
}

@keyframes rotateDecor {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.transition-icon-main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(184, 151, 66, 0.1);
    border: 1px solid var(--gold-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-dark);
    box-shadow: 0 4px 15px rgba(184, 151, 66, 0.2);
}

/* Loading Screens Progress (Step 10) */
.loading-list {
    width: 100%;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.loading-item {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.loading-item.active {
    opacity: 1;
}

.loading-item.active .loading-status-icon {
    color: var(--primary);
    animation: pulseIcon 1s infinite alternate;
}

.loading-item.completed {
    opacity: 1;
    color: var(--text-black);
}

.loading-item.completed .loading-status-icon {
    color: var(--gold-solid);
}

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

.loading-item span {
    font-size: 14px;
    font-weight: 600;
}

@keyframes pulseIcon {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

/* --- Step 11: The Personalized Offer --- */
.offer-header {
    text-align: center;
    margin-bottom: 24px;
}

.offer-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(17, 17, 17, 0.05);
    border: 1px solid rgba(17, 17, 17, 0.15);
    color: var(--text-black);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 12px;
}

.offer-bullet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(184, 151, 66, 0.03);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
}

.offer-bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bullet-check {
    color: var(--gold-solid);
    font-size: 16px;
    line-height: 1.4;
    font-weight: bold;
}

.offer-bullet-item p {
    font-size: 13.5px;
    color: var(--text-high);
}

.offer-bullet-item strong {
    color: var(--text-black);
}

/* Dynamic pain solver highlight card */
.personalization-highlight {
    background: linear-gradient(135deg, rgba(184, 151, 66, 0.08) 0%, rgba(17, 17, 17, 0.02) 100%);
    border: 1px solid rgba(184, 151, 66, 0.25);
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.p-highlight-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(184, 151, 66, 0.15);
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.p-highlight-text {
    font-size: 12.5px;
    color: var(--text-med);
    line-height: 1.4;
}

.p-highlight-text strong {
    color: var(--text-black);
}

/* Pricing Visual Block */
.pricing-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 17, 17, 0.02);
    border: 1px solid var(--glass-border);
    padding: 20px 24px;
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
}

.pricing-info {
    display: flex;
    flex-direction: column;
}

.pricing-strike {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: -2px;
}

.pricing-current {
    font-family: var(--font-header);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-black);
}

.pricing-current span {
    font-size: 16px;
    color: var(--gold-dark);
    font-weight: 700;
}

.pricing-badge {
    background: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--bg-medium);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Scarcity countdown timer */
.scarcity-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--color-warning);
    font-size: 12px;
    font-weight: 700;
}

/* --- COLUMN 2: The Interactive Spreadsheet Mockup --- */
.dashboard-column {
    perspective: 1000px; /* Enable 3D effects on container */
}

.spreadsheet-mockup {
    background: var(--bg-medium);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 20px 50px rgba(184, 151, 66, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 480px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
    transform: rotateY(-3deg) rotateX(2deg) translateZ(0);
}

.spreadsheet-mockup:hover {
    border-color: var(--glass-border-hover);
    transform: rotateY(0deg) rotateX(0deg) translateZ(10px) scale(1.01);
}

/* Spreadsheet Header Window UI */
.spreadsheet-header {
    background: var(--primary);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: var(--gold-solid); }

.sheet-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--bg-light);
    font-weight: 600;
}

.sheet-title svg {
    color: var(--gold-solid);
}

.sheet-status {
    display: flex;
    align-items: center;
}

.status-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pulse-green {
    background: rgba(184, 151, 66, 0.25);
    color: var(--bg-medium);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: badgePulse 2s infinite alternate;
}

@keyframes badgePulse {
    from { box-shadow: 0 0 2px rgba(184, 151, 66, 0.1); }
    to { box-shadow: 0 0 10px rgba(184, 151, 66, 0.45); }
}

/* Spreadsheet Tabs Layout */
.spreadsheet-tabs {
    display: flex;
    background: var(--bg-light);
    padding-top: 4px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.tab-btn {
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-med);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-black);
    background: rgba(255, 255, 255, 0.4);
}

.tab-btn.active {
    color: var(--gold-dark);
    background: var(--bg-medium);
    border-bottom: 2px solid var(--gold-solid);
}

.tab-btn svg {
    color: inherit;
}

/* Formula Bar UI */
.formula-bar {
    display: flex;
    background: var(--bg-medium);
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    padding: 6px 12px;
    align-items: center;
}

.fx-label {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 800;
    padding-right: 12px;
    border-right: 1px solid rgba(17, 17, 17, 0.08);
    margin-right: 12px;
}

.formula-input {
    font-family: monospace;
    font-size: 11.5px;
    color: var(--gold-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

/* Tab Contents */
.tab-content {
    display: none;
    flex-grow: 1;
    background: var(--bg-medium);
    padding: 12px;
    overflow: hidden;
}

.tab-content.active {
    display: block;
}

/* Spreadsheet Table Styling */
.table-responsive {
    overflow-x: auto;
    max-height: 290px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(17, 17, 17, 0.05);
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.sheet-table th,
.sheet-table td {
    padding: 8px 12px;
    border: 1px solid rgba(17, 17, 17, 0.05);
}

.sheet-table th {
    background: var(--bg-light);
    color: var(--text-black);
    font-weight: 700;
}

.sheet-table th.col-index,
.sheet-table td.col-index {
    text-align: center;
    background: var(--bg-light);
    color: var(--text-muted);
    font-weight: 700;
    width: 30px;
}

.cell-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-black);
    font-weight: 500;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.indicator.green { background: var(--gold-solid); }
.indicator.red { background: var(--primary); }
.indicator.orange { background: var(--color-warning); }

.cell-num {
    font-family: monospace;
    font-size: 12px;
    text-align: right;
    color: var(--text-black);
    font-weight: 600;
}

/* Cell highlight and flash effects */
.cell-highlight-green {
    color: var(--gold-dark);
    background: rgba(184, 151, 66, 0.06);
}

.cell-highlight-red {
    color: var(--text-black);
    background: rgba(17, 17, 17, 0.03);
}

.cell-highlight-orange {
    color: var(--color-warning);
    background: rgba(217, 119, 6, 0.05);
}

.font-bold {
    font-weight: 700;
}

.row-footer td {
    background: rgba(184, 151, 66, 0.04);
    border-top: 1px solid rgba(184, 151, 66, 0.3) !important;
    border-bottom: 2px double rgba(184, 151, 66, 0.5) !important;
}

/* Dynamic cell flashing animation */
.cell-flash-green {
    animation: flashGreen 1s ease-in-out;
}

.cell-flash-red {
    animation: flashRed 1s ease-in-out;
}

@keyframes flashGreen {
    0%, 100% { background: transparent; }
    50% { background: rgba(184, 151, 66, 0.25); color: var(--gold-dark); }
}

@keyframes flashRed {
    0%, 100% { background: transparent; }
    50% { background: rgba(17, 17, 17, 0.15); color: var(--text-black); }
}

/* Dynamic Badges in Cells */
.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-success { background: rgba(184, 151, 66, 0.15); color: var(--gold-dark); }
.badge-danger { background: rgba(17, 17, 17, 0.08); color: var(--text-black); }
.badge-warning { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); }
.badge-info { background: rgba(184, 151, 66, 0.1); color: var(--gold-dark); }

/* Chart Styling */
.chart-container {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.chart-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-black);
}

.chart-legend {
    display: flex;
    gap: 12px;
    font-size: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-med);
}

.legend-color {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.legend-color.green { background: var(--gold-solid); }
.legend-color.red { background: var(--primary); }

.chart-svg-wrapper {
    background: rgba(17, 17, 17, 0.01);
    border: 1px solid rgba(17, 17, 17, 0.03);
    border-radius: var(--border-radius-sm);
    padding: 8px;
}

.interactive-chart {
    width: 100%;
    height: auto;
}

.chart-bar {
    transform-origin: bottom;
    animation: barGrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes barGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Insight Banner inside table */
.sheet-insight-banner {
    background: rgba(184, 151, 66, 0.06);
    border: 1px solid rgba(184, 151, 66, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    margin-top: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.insight-icon {
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.insight-text {
    font-size: 11px;
    color: var(--text-med);
    line-height: 1.4;
}

.insight-text strong {
    color: var(--text-black);
}

/* Spreadsheet Footer StatusBar UI */
.spreadsheet-footer {
    background: var(--bg-light);
    border-top: 1px solid rgba(17, 17, 17, 0.08);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-left svg {
    color: var(--text-muted);
}

.divider {
    color: rgba(17, 17, 17, 0.08);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    
    .dashboard-column {
        order: 2; /* Put spreadsheet below quiz on tablet/mobile */
    }
    
    .spreadsheet-mockup {
        transform: rotateY(-3deg) rotateX(2deg) translateZ(0) scale(0.98);
        max-height: 380px;
    }

    .spreadsheet-mockup:hover {
        transform: rotateY(-3deg) rotateX(2deg) translateZ(0) scale(0.98);
    }
}

@media (max-width: 768px) {
    .bg-glow {
        display: none !important; /* Prevent background glows from expanding mobile viewport */
    }

    .header {
        padding: 10px 0;
    }

    .header-container {
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 6px 20px 14px 20px;
        gap: 10px;
    }
    
    .logo-icon-img {
        height: 38px;
    }
    
    .logo-text {
        font-size: 16px;
    }

    .progress-wrapper {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .progress-bar-container {
        height: 3px;
        border-radius: 0;
        border: none;
        background: rgba(17, 17, 17, 0.03);
    }

    .progress-bar {
        border-radius: 0;
    }

    .progress-text {
        display: none; /* Hide step count text on mobile header to look cleaner */
    }

    .main-content {
        padding: 16px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start; /* Align elements to the top on mobile */
    }

    .content-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .quiz-column {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: auto;
    }

    .quiz-card {
        padding: 24px 16px;
        border-radius: var(--border-radius-md);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .quiz-container {
        padding: 24px 16px;
        border-radius: var(--border-radius-md);
        min-height: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .hero-badge {
        font-size: 11px;
        padding: 5px 12px;
        margin-bottom: 12px;
        margin-left: 0;
        align-self: center;
    }
    
    .hero-title {
        font-size: 22px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .hero-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
        text-align: center;
    }

    .hero-benefits {
        margin-bottom: 24px;
        gap: 10px;
        align-self: stretch;
    }

    .benefit-item span {
        font-size: 12.5px;
    }
    
    .question-title {
        font-size: 19px;
        text-align: center;
    }
    
    .question-subtitle {
        font-size: 12.5px;
        margin-bottom: 16px;
        text-align: center;
    }
    
    .options-grid-2x2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .option-card {
        padding: 10px 16px;
        gap: 10px;
    }

    .option-text {
        font-size: 13px;
    }

    .btn-large {
        padding: 14px 28px;
        font-size: 16px;
    }

    .offer-bullet-list {
        padding: 16px;
    }

    .offer-bullet-item p {
        font-size: 12.5px;
    }

    .pricing-block {
        padding: 16px;
    }

    .pricing-current {
        font-size: 24px;
    }

    /* Miniature Spreadsheet Mockup for Mobile View */
    .spreadsheet-mockup {
        max-height: none; /* Display all 7 rows without internal vertical cut-offs */
        height: auto;
        box-shadow: 0 10px 30px rgba(184, 151, 66, 0.08);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden; /* Prevent wide children from stretching container */
        transform: rotateY(-3deg) rotateX(2deg) translateZ(0) scale(0.98) !important; /* Isometric tilt matching desktop */
    }
    
    .dashboard-column {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    
    .spreadsheet-header {
        padding: 5px 10px;
    }
    
    .window-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    .sheet-title {
        font-size: 10.5px;
    }
    
    .status-badge {
        font-size: 8px;
        padding: 1px 6px;
    }
    
    .tab-btn {
        padding: 5px 8px;
        font-size: 10px;
        gap: 4px;
    }
    
    .tab-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .formula-bar {
        padding: 3px 8px;
    }
    
    .fx-label {
        font-size: 10.5px;
        padding-right: 6px;
        margin-right: 6px;
    }
    
    .formula-input {
        font-size: 9.5px;
    }
    
    .tab-content {
        padding: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden; /* Clamp wide tables inside the tab content boundary */
    }
    
    .table-responsive {
        max-height: none; /* Display all 7 rows without internal vertical cut-offs */
        overflow-x: auto; /* Enable horizontal scroll for columns overflow */
        overflow-y: hidden; /* Prevent internal vertical scrollbars */
        width: 100%;
        max-width: 100%;
        min-width: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .sheet-table {
        font-size: 9px;
        width: 100%;
        min-width: 440px; /* Keep exact desktop column width proportions */
        table-layout: fixed;
    }
    
    .sheet-table th, 
    .sheet-table td {
        padding: 4px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Desktop Column Width Proportions mapped for Mobile simulator */
    #tab-agenda .sheet-table th:nth-child(1), #tab-agenda .sheet-table td:nth-child(1) { width: 22px; }
    #tab-agenda .sheet-table th:nth-child(2), #tab-agenda .sheet-table td:nth-child(2) { width: 50px; }
    #tab-agenda .sheet-table th:nth-child(3), #tab-agenda .sheet-table td:nth-child(3) { width: 170px; }
    #tab-agenda .sheet-table th:nth-child(4), #tab-agenda .sheet-table td:nth-child(4) { width: 85px; }
    #tab-agenda .sheet-table th:nth-child(5), #tab-agenda .sheet-table td:nth-child(5) { width: 68px; }
    
    #tab-clientes .sheet-table th:nth-child(1), #tab-clientes .sheet-table td:nth-child(1) { width: 22px; }
    #tab-clientes .sheet-table th:nth-child(2), #tab-clientes .sheet-table td:nth-child(2) { width: 45px; }
    #tab-clientes .sheet-table th:nth-child(3), #tab-clientes .sheet-table td:nth-child(3) { width: 170px; }
    #tab-clientes .sheet-table th:nth-child(4), #tab-clientes .sheet-table td:nth-child(4) { width: 110px; }
    #tab-clientes .sheet-table th:nth-child(5), #tab-clientes .sheet-table td:nth-child(5) { width: 68px; }
    
    #tab-estoque .sheet-table th:nth-child(1), #tab-estoque .sheet-table td:nth-child(1) { width: 22px; }
    #tab-estoque .sheet-table th:nth-child(2), #tab-estoque .sheet-table td:nth-child(2) { width: 170px; }
    #tab-estoque .sheet-table th:nth-child(3), #tab-estoque .sheet-table td:nth-child(3) { width: 80px; }
    #tab-estoque .sheet-table th:nth-child(4), #tab-estoque .sheet-table td:nth-child(4) { width: 80px; }
    #tab-estoque .sheet-table th:nth-child(5), #tab-estoque .sheet-table td:nth-child(5) { width: 68px; }
    
    #tab-financeiro .sheet-table th:nth-child(1), #tab-financeiro .sheet-table td:nth-child(1) { width: 22px; }
    #tab-financeiro .sheet-table th:nth-child(2), #tab-financeiro .sheet-table td:nth-child(2) { width: 180px; }
    #tab-financeiro .sheet-table th:nth-child(3), #tab-financeiro .sheet-table td:nth-child(3) { width: 80px; }
    #tab-financeiro .sheet-table th:nth-child(4), #tab-financeiro .sheet-table td:nth-child(4) { width: 80px; }
    #tab-financeiro .sheet-table th:nth-child(5), #tab-financeiro .sheet-table td:nth-child(5) { width: 68px; }

    #tab-despesa .sheet-table th:nth-child(1), #tab-despesa .sheet-table td:nth-child(1) { width: 22px; }
    #tab-despesa .sheet-table th:nth-child(2), #tab-despesa .sheet-table td:nth-child(2) { width: 200px; }
    #tab-despesa .sheet-table th:nth-child(3), #tab-despesa .sheet-table td:nth-child(3) { width: 110px; }
    #tab-despesa .sheet-table th:nth-child(4), #tab-despesa .sheet-table td:nth-child(4) { width: 68px; }
    
    .cell-num {
        font-size: 9px;
    }
    
    .spreadsheet-footer {
        padding: 3px 8px;
        font-size: 8.5px;
    }
    
    .sheet-insight-banner {
        padding: 4px 6px;
        margin-top: 4px;
    }
    
    .insight-text {
        font-size: 8.5px;
    }
    
    .chart-container {
        padding: 4px;
    }
    
    .chart-title {
        font-size: 9.5px;
    }
    
    .chart-svg-wrapper {
        height: 70px;
    }

    /* Distribute quiz elements vertically when spreadsheet is hidden on mobile steps 1-10 */
    .spreadsheet-hidden .quiz-container {
        min-height: 410px; /* Stretch vertically for a filled aesthetic */
        justify-content: center; /* Center content vertically */
        padding: 32px 20px;
    }

    .spreadsheet-hidden .options-list {
        gap: 12px !important; /* Relaxed gap to distribute elements more */
    }

    .spreadsheet-hidden .option-card {
        padding: 13px 20px !important; /* Taller option cards to fill height */
        margin-bottom: 2px;
    }

    .spreadsheet-hidden .screen-transition {
        padding: 48px 10px; /* Stretch transition feedback screens */
    }
}

@media (max-width: 580px) {
    /* Retain all columns on mobile but shrink tab wrappers */
    .spreadsheet-tabs {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        flex-shrink: 0;
    }
}

/* --- Viewport-Locked Desktop Styling (Fit everything without scrolling) --- */
@media (min-width: 1025px) {
    body {
        overflow-y: auto; /* Allow normal body scroll on small screens */
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .main-content {
        padding: 24px 24px;
        min-height: calc(100vh - 90px);
        display: flex;
        align-items: center;
    }

    .content-grid {
        align-items: flex-start;
        gap: 32px;
    }

    .quiz-column {
        height: auto;
    }

    .quiz-card {
        padding: 32px 36px;
        max-height: none;
        height: auto;
        justify-content: flex-start;
    }

    .quiz-container {
        padding: 32px 36px;
        max-height: none;
        height: auto;
        justify-content: flex-start;
    }

    .dashboard-column {
        height: auto;
    }

    .spreadsheet-mockup {
        max-height: 480px; /* Reduced from 540px to stay proportional with shorter card height */
        height: auto;
    }

    .table-responsive {
        max-height: 290px; /* Fits the 7 agenda rows perfectly with no blank space and keeps mockup proportional */
    }

    /* Spacing optimizations for Welcome Card on desktop to make Iniciar button clearly visible */
    .hero-badge {
        margin-bottom: 12px;
        align-self: flex-start;
    }

    .hero-title {
        font-size: 30px; /* reduced from 38px */
        margin-bottom: 12px; /* reduced from 18px */
    }

    .hero-subtitle {
        font-size: 14px; /* reduced from 16px */
        margin-bottom: 20px; /* reduced from 32px */
    }

    .hero-benefits {
        gap: 10px; /* reduced from 16px */
        margin-bottom: 24px; /* reduced from 36px */
    }

    .benefit-item {
        font-size: 13.5px;
    }

    .btn-large {
        padding: 12px 24px; /* reduced from 16px 32px */
        font-size: 15px;
    }
}

