/* 
   Smart Choices Daily - Calculadora de Rescisão Trabalhista 2026
   Sistema de Design Moderno, Responsivo e Acessível (Light/Dark Mode & Impressão)
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta de Cores - Light Theme */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --border: #e2e8f0;
    
    /* Indicadores de Tabela */
    --green-text: #15803d;
    --green-bg: #dcfce7;
    --red-text: #b91c1c;
    --red-bg: #fee2e2;
    --yellow-text: #b45309;
    --yellow-bg: #fef3c7;
    
    /* Sombra e Efeitos */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tipografia */
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Paleta de Cores - Dark Theme */
.dark-theme {
    --bg-body: #090d16;
    --bg-card: #111827;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.1);
    --border: #1f2937;
    
    --green-text: #4ade80;
    --green-bg: rgba(21, 128, 61, 0.2);
    --red-text: #f87171;
    --red-bg: rgba(185, 28, 28, 0.2);
    --yellow-text: #fbbf24;
    --yellow-bg: rgba(180, 83, 9, 0.2);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
}

/* Cabeçalho Principal (Brand & Identity) */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand a {
    text-decoration: none;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-brand .back-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.header-brand .back-link:hover {
    background-color: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background-color: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Área de Destaque / Hero */
.hero-section {
    text-align: center;
    padding: 3rem 1.5rem 2rem 1.5rem;
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(248, 250, 252, 0) 100%);
}

.dark-theme .hero-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(9, 13, 22, 0) 100%);
}

.hero-section h1 {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.hero-section p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Contêiner da Calculadora e Abas */
.calc-container {
    max-width: 960px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
}

/* Barra de Navegação das Abas */
.tabs-navigation {
    display: flex;
    justify-content: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    gap: 0.5rem;
}

.tab-btn {
    flex: 1;
    max-width: 200px;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

.tab-btn.active {
    background-color: var(--accent);
    color: #ffffff;
}

/* Abas de Conteúdo */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Painel de Dados (Formulário) */
.form-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.form-group label span {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background-color: var(--bg-body);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: var(--bg-card);
}

/* Estilo de Interruptores/Toggles */
.toggle-group {
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-info span {
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Switch UI */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: #white;
    background-color: var(--bg-card);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Mensagens de Alerta */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: var(--red-bg);
    color: var(--red-text);
    border: 1px solid var(--red-text);
}

/* Botões de Ação Principal */
.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

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

.btn-primary svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Aba 2: Resultados */
.result-placeholder-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.result-placeholder-card svg {
    width: 4rem;
    height: 4rem;
    color: var(--text-secondary);
}

.result-placeholder-card h2 {
    font-family: var(--font-title);
    font-size: 1.6rem;
}

.result-placeholder-card p {
    color: var(--text-secondary);
    max-width: 400px;
}

/* Resultados Estruturados */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Cabeçalho do Resumo */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

.sum-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sum-card .title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sum-card .value {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sum-card .value span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Detalhamento de Valores (Tabela) */
.table-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.table-card h3 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
    padding-left: 0.75rem;
}

.rescisao-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.rescisao-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.rescisao-table th,
.rescisao-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.rescisao-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-body);
}

.rescisao-table tr:hover td {
    background-color: var(--accent-light);
}

.rescisao-table td.val {
    font-family: var(--font-title);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

/* Cores de Linhas */
.text-green {
    color: var(--green-text) !important;
}

.text-red {
    color: var(--red-text) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.bg-green-badge {
    background-color: var(--green-bg);
    color: var(--green-text);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

/* Linhas Especiais de Totais */
.row-total-bruto td {
    font-weight: 600;
    border-top: 2px solid var(--border);
}

.row-total-descontos td {
    font-weight: 600;
    color: var(--text-secondary);
}

.row-total-liquido td {
    border-top: 2px double var(--accent);
    border-bottom: 2px double var(--accent);
    background-color: var(--accent-light);
}

.total-final {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
}

/* Quadro Informativo de FGTS e Prazos */
.bottom-info-cards {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .bottom-info-cards {
        grid-template-columns: 1fr;
    }
}

.fgts-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.fgts-panel h4 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fgts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 500px) {
    .fgts-grid {
        grid-template-columns: 1fr;
    }
}

.fgts-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fgts-item .lbl {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.fgts-item .val {
    font-family: var(--font-title);
    font-weight: 600;
}

.fgts-total-saque {
    background-color: var(--bg-body);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fgts-total-saque .lbl {
    font-weight: 700;
    font-size: 1rem;
}

.fgts-total-saque .val {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 700;
}

.fgts-aviso {
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.prazo-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.prazo-panel h4 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.prazo-box {
    background-color: var(--yellow-bg);
    border: 1px solid var(--yellow-text);
    color: var(--yellow-text);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.prazo-legenda {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Botões de Ações e Exportação */
.actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 500px) {
    .actions-row {
        flex-direction: column;
    }
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary svg {
    width: 1.1rem;
    height: 1.1rem;
}

/* Aba 3: FAQ & SEO */
.seo-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-md);
    max-width: 840px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .seo-section {
        padding: 1.5rem;
    }
}

.seo-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.seo-content h2 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.seo-content h3 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.seo-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.seo-content ul, 
.seo-content ol {
    margin-bottom: 1.5rem;
    margin-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.seo-content strong {
    color: var(--text-primary);
}

/* Bloco Informativo de Destaque no SEO */
.seo-callout {
    background-color: var(--accent-light);
    border-left: 4px solid var(--accent);
    padding: 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-primary);
}

/* Rodapé */
footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2.5rem 1rem;
    text-align: center;
    margin-top: 4rem;
    transition: var(--transition);
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Área Oculta para PDF de Impressão */
#print-only-header {
    display: none;
}

/* Regras de Impressão (@media print) */
@media print {
    @page {
        size: A4;
        margin: 1.5cm;
    }
    
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }
    
    /* Ocultar elementos desnecessários na impressão */
    header,
    .hero-section,
    .tabs-navigation,
    #dados,
    #faq,
    .actions-row,
    footer,
    .theme-toggle-btn,
    .result-placeholder-card {
        display: none !important;
    }
    
    /* Forçar visualização do resultado */
    #resultado {
        display: block !important;
    }
    
    .results-grid {
        gap: 1.5cm;
    }
    
    .summary-cards {
        display: grid;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5cm !important;
    }
    
    .sum-card {
        border: 1px solid #94a3b8 !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
    }
    
    .table-card {
        border: 1px solid #94a3b8 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    .rescisao-table th {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        border-bottom: 2px solid #94a3b8 !important;
    }
    
    .rescisao-table td {
        border-bottom: 1px solid #e2e8f0 !important;
    }
    
    /* Configurar cores visíveis na impressão */
    .text-green {
        color: #15803d !important;
    }
    
    .text-red {
        color: #b91c1c !important;
    }
    
    .bg-green-badge {
        background-color: #dcfce7 !important;
        color: #15803d !important;
        border: 1px solid #15803d;
    }
    
    .row-total-liquido td {
        background-color: #eff6ff !important;
        border-top: 2px solid #2563eb !important;
        border-bottom: 2px solid #2563eb !important;
    }
    
    .bottom-info-cards {
        display: grid;
        grid-template-columns: 1.5fr 1fr !important;
        gap: 0.5cm !important;
        page-break-inside: avoid;
    }
    
    .fgts-panel,
    .prazo-panel {
        border: 1px solid #94a3b8 !important;
        box-shadow: none !important;
        background-color: #ffffff !important;
        page-break-inside: avoid;
    }
    
    .fgts-total-saque {
        background-color: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
    }
    
    .prazo-box {
        background-color: #fef3c7 !important;
        border: 1px solid #b45309 !important;
        color: #b45309 !important;
    }
    
    /* Exibir cabeçalho e rodapé exclusivos de impressão */
    #print-only-header {
        display: block !important;
        margin-bottom: 1.5cm;
        border-bottom: 2px solid #000000;
        padding-bottom: 0.5cm;
    }
    
    #print-only-header h2 {
        font-family: var(--font-title);
        font-size: 20pt;
        color: #2563eb;
    }
    
    #print-only-header p {
        font-size: 9pt;
        color: #475569;
    }
}
