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

:root {
    /* Cores do site principal */
    --primary-blue: #1e3a8a;
    --deep-blue: #1e293b;
    --navy: #0f172a;
    --slate: #334155;
    --light-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --success-green: #10b981;
    --dark-bg: #0a0a0a;
    --card-bg: #1a1a1a;
    --white: #ffffff;
    --gray-100: #f8fafc;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --border-color: rgba(59, 130, 246, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--navy) 50%, var(--deep-blue) 100%);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 30px;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--gray-300);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.btn-back:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--white);
    border-color: var(--light-blue);
}

header {
    text-align: center;
    color: var(--white);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--white) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--gray-300);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Panels */
.input-panel,
.results-panel,
.table-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
}

.input-panel h2,
.results-panel h2,
.table-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--white);
    border-bottom: 3px solid var(--light-blue);
    padding-bottom: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-300);
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s;
    background: rgba(255, 255, 255, 0.05);
}

.input-wrapper:focus-within {
    border-color: var(--light-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper.readonly {
    background-color: rgba(255, 255, 255, 0.02);
}

.currency,
.suffix {
    padding: 12px 15px;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--gray-300);
    font-weight: 600;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"] {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    background: transparent;
    color: var(--white);
}

/* Remove setas do input number */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[readonly] {
    background-color: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    color: var(--gray-300);
}

select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    cursor: pointer;
    transition: border-color 0.3s;
}

select option {
    background: var(--card-bg);
    color: var(--white);
}

/* Placeholder color for inputs */
input::placeholder {
    color: var(--gray-600);
    opacity: 0.7;
}

/* Botões Flutuantes */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.btn-whatsapp,
.btn-scroll-top {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp svg {
    width: 32px;
    height: 32px;
}

.btn-scroll-top {
    background: linear-gradient(135deg, var(--light-blue), var(--accent-blue));
    color: white;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.btn-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-scroll-top svg {
    width: 24px;
    height: 24px;
}

/* Tooltip para WhatsApp */
.btn-whatsapp::before {
    content: 'Falar com especialista';
    position: absolute;
    right: 70px;
    background: var(--card-bg);
    color: var(--white);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-whatsapp:hover::before {
    opacity: 1;
    visibility: visible;
}

select:focus {
    outline: none;
    border-color: var(--light-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn-calcular,
.btn-secondary {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-calcular {
    width: 100%;
    background: linear-gradient(135deg, var(--light-blue), var(--accent-blue));
    color: var(--white);
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-calcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-calcular:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--gray-300);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--white);
    border-color: var(--light-blue);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.card {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--light-blue);
    background: rgba(59, 130, 246, 0.1);
}

.card-label {
    font-size: 0.85rem;
    color: var(--gray-300);
    margin-bottom: 8px;
    font-weight: 500;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-blue);
}

.card-value.highlight {
    color: var(--success-green);
}

/* Chart Container */
.chart-container {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.chart-container h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--white);
}

#chartSaldoDevedor {
    max-height: 300px;
}

/* Table Section */
.table-section {
    grid-column: 1 / -1;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-controls {
    display: flex;
    gap: 10px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
}

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

thead {
    background: linear-gradient(135deg, var(--light-blue), var(--accent-blue));
    color: var(--white);
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 12px 15px;
    color: #e2e8f0;
    font-weight: 500;
}

tbody td:first-child {
    color: var(--accent-blue);
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.3);
}

tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.1);
}

tbody tr:nth-child(even):hover {
    background-color: rgba(59, 130, 246, 0.15);
}

tbody tr:nth-child(odd):hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.empty-state {
    text-align: center;
    color: var(--gray-600);
    padding: 40px !important;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .page-header {
        padding: 15px 20px;
    }

    .header-logo img {
        height: 40px;
    }

    .btn-back {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .header-logo {
        justify-content: center;
    }

    .btn-back {
        width: 100%;
        justify-content: center;
    }

    header h1 {
        font-size: 1.8rem;
    }

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

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .table-controls {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }

    table {
        font-size: 0.85rem;
    }

    thead th,
    tbody td {
        padding: 10px 8px;
    }

    /* Botões flutuantes no mobile */
    .floating-buttons {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }

    .btn-whatsapp,
    .btn-scroll-top {
        width: 55px;
        height: 55px;
    }

    .btn-whatsapp svg {
        width: 28px;
        height: 28px;
    }

    .btn-scroll-top svg {
        width: 22px;
        height: 22px;
    }

    /* Remover tooltip no mobile */
    .btn-whatsapp::before {
        display: none;
    }
}

/* ========================================
   SEÇÃO EDUCATIVA
======================================== */

.educational-content {
    margin-top: 60px;
    padding: 40px 30px;
    background: rgba(10, 10, 10, 0.3);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.educational-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--light-blue), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-section {
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.content-section:last-of-type {
    border-bottom: none;
}

.content-section h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-blue);
}

.content-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-top: 20px;
    margin-bottom: 12px;
}

.content-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.content-section ul,
.content-section ol {
    margin-left: 25px;
    margin-bottom: 20px;
    color: var(--gray-300);
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.content-section strong {
    color: var(--white);
    font-weight: 600;
}

/* Grid de Comparação SAC vs PRICE */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

.comparison-card {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    padding: 35px 30px;
    border-radius: 16px;
    border: 1px solid rgba(71, 85, 105, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.comparison-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--light-blue) 0%, var(--accent-blue) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.comparison-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.comparison-card:hover::after {
    opacity: 1;
}

.comparison-card:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.comparison-card:first-child {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(30, 41, 59, 0.95) 50%);
}

.comparison-card:first-child::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.comparison-card:last-child {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, rgba(30, 41, 59, 0.95) 50%);
}

.comparison-card:last-child::before {
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
}

.comparison-card h4 {
    position: relative;
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    padding-bottom: 15px;
    letter-spacing: -0.02em;
}

.comparison-card:first-child h4 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comparison-card:last-child h4 {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comparison-card h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--light-blue) 0%, transparent 100%);
    border-radius: 3px;
}

.comparison-card:first-child h4::after {
    background: linear-gradient(90deg, #10b981 0%, transparent 100%);
}

.comparison-card:last-child h4::after {
    background: linear-gradient(90deg, #f97316 0%, transparent 100%);
}

.comparison-card .highlight-result {
    margin-top: 20px;
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    font-size: 1.1rem;
}

.comparison-card .highlight-result strong {
    color: var(--light-blue);
    font-size: 1.3rem;
}

/* Fórmulas */
.formula {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--light-blue);
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--accent-blue);
    text-align: center;
}

.formula-legend {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-style: italic;
    margin-top: 8px;
}

/* Boxes de Destaque */
.tip-box,
.example-box,
.warning-box {
    position: relative;
    padding: 24px 28px;
    border-radius: 12px;
    margin: 28px 0;
    border: 1px solid rgba(71, 85, 105, 0.25);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.tip-box::before,
.example-box::before,
.warning-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.tip-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(30, 41, 59, 0.5) 100%);
}

.tip-box::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.tip-box:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.1);
}

.tip-box strong {
    color: #10b981;
    font-weight: 600;
}

.example-box {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.03) 0%, rgba(30, 41, 59, 0.5) 100%);
}

.example-box::before {
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}

.example-box:hover {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 8px 24px rgba(96, 165, 250, 0.1);
}

.example-box strong {
    color: #60a5fa;
    font-weight: 600;
}

.warning-box {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.03) 0%, rgba(30, 41, 59, 0.5) 100%);
}

.warning-box::before {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.warning-box:hover {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.1);
}

.warning-box strong {
    color: #fbbf24;
    font-weight: 600;
}

/* FAQ */
.faq-item {
    background: rgba(59, 130, 246, 0.03);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: var(--transition);
}

.faq-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.faq-item h4 {
    font-size: 1.1rem;
    color: var(--light-blue);
    margin: 0 0 12px 0;
}

.faq-item p {
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(96, 165, 250, 0.05));
    border-radius: 16px;
    border: 2px solid var(--light-blue);
    margin-top: 40px;
}

.cta-section h3 {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--gray-300);
    margin-bottom: 25px;
}

.btn-whatsapp-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--white);
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-cta svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.btn-whatsapp-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.cta-list {
    list-style: none;
    margin: 30px -40px;
    padding: 0;
    text-align: center;
}

.cta-list li {
    padding: 18px 40px;
    margin: 0;
    position: relative;
    font-size: 1.05rem;
    color: var(--white);
    line-height: 1.6;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-list li:last-child {
    border-bottom: none;
}

.cta-list li::before {
    content: '✓';
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--light-blue), var(--accent-blue));
    color: var(--white);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.cta-list li:hover {
    color: var(--light-blue);
}

/* Responsivo para Seção Educativa */
@media (max-width: 992px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .educational-content h2 {
        font-size: 1.6rem;
    }

    .content-section h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .educational-content {
        padding: 30px 20px;
        margin-top: 40px;
    }

    .educational-content h2 {
        font-size: 1.4rem;
    }

    .content-section h3 {
        font-size: 1.2rem;
    }

    .formula {
        font-size: 1rem;
        padding: 15px;
    }

    .cta-section {
        padding: 30px 20px;
    }

    .cta-section h3 {
        font-size: 1.4rem;
    }

    .btn-whatsapp-cta {
        padding: 14px 30px;
        font-size: 1rem;
    }
}