/* Reset básico e variáveis de cores */
:root {
    --bg-color: #f3f4f6; /* Fundo geral da página */
    --card-bg: #ffffff; /* Fundo dos cartões */
    --primary-color: #2e7d32; /* Verde principal */
    --primary-hover: #1b5e20;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --danger-color: #ef4444;
    --icon-bg: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    width: 100%;
}

/* Estilo da Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
}

/* Layout Principal: Grid para separar os dois cartões */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Estilos dos Cartões Brancos */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Tipografia do Formulário */
.form-section h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.form-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Estilização dos Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-group input, .input-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--primary-color);
}

/* Classes utilitárias para colocar inputs lado a lado */
.row {
    display: flex;
    gap: 1rem;
}
.flex-1 {
    flex: 1;
}

/* Botão Principal */
.btn-primary {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

/* Cabecalho da Lista de Despesas */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.list-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-title h2 {
    font-size: 1rem;
    font-weight: 600;
}

.badge {
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: bold;
}

#total-amount {
    font-size: 1.25rem;
    font-weight: bold;
}

/* Estilo da Lista e seus Itens */
.expense-list {
    list-style: none;
}

.expense-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

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

.item-icon {
    width: 40px;
    height: 40px;
    background-color: var(--icon-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.item-info {
    flex: 1;
}

.item-info strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.item-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.item-amount {
    font-weight: bold;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

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

/* Telas médias (Tablets) */
@media (max-width: 860px) {
    .content-wrapper {
        grid-template-columns: 1fr; /* Muda para 1 coluna empilhada */
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem; /* Reduz um pouco o espaçamento interno */
    }
}

/* Telas pequenas (Smartphones) */
@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem; /* Reduz a margem lateral da tela */
    }

    .card {
        padding: 1.25rem; /* Reduz ainda mais o padding no celular */
    }

    .row {
        flex-direction: column; /* Coloca os inputs lado a lado um embaixo do outro */
        gap: 0; 
    }

    /* Ajuste para o cabeçalho da lista não quebrar em telas estreitas */
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    #total-amount {
        align-self: flex-end; /* Mantém o valor alinhado à direita na quebra */
    }
}