* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f5f0;
    color: #4a3c31;
    padding: 20px;
    line-height: 1.6;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom:2px solid #d4a574;
}

h1 {
    color: #8b4513;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #a67c52;
    font-size: 1rem;
}

/* Form de entrada */
.input-section {
    background-color: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #5d4a36;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #d4a574;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #8b4513;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.quantity-btn {
    background-color: #8b4513;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .3s;
}

.quantity-btn:hover {
    background-color: #6b3410;
}

.disable {
    background-color: #f1dacb;
    cursor: not-allowed;
    opacity: .7;
}

#quantidade {
    width: 80px;
    height: 40px;
    text-align: center;
    margin: 0 15px;
    border: 2px solid #d4a574;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
}

.add-button {
    background-color: #a67c52;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: backgroud-color .3s;
}

.add-button:hover {
    background-color: #8b6b47;
}

/* Lista de trufas */
.truffle-list {
    background-color: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

h2 {
    color: #8b4513;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8d9c5;
}

.truffle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0e6d8;
}

.truffle-item:last-child {
    border-bottom: none;
}

.truffle-info {
    flex: 1;
}

.truffle-name {
    font-weight: 600;
    color: #5d4a36;
    margin-bottom: 5px;
}


.truffle-details {
    font-size: .9rem;
    color: #8a7866;
}

.truffle-quantity {
    background-color: #f0e6d8;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    color: #8b4513;
    min-width: 60px;
    text-align: center;
}

/* Estoque */
.estoque-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #8B4513;
    color: white;
    padding: .5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    transition: .3s;
}

.btn-voltar:hover {
    background: #6B3410;
}

.estoque h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #8b4513;
    border-bottom: 2px solid #8b4513;
    padding-bottom: .5rem;
}

.estoque-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.estoque-item {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid #8B4513;
}

.estoque-nome {
    font-weight: 600;
    color: #5d4a36;
    font-size: 1.1rem;
}

.estoque-quantidade {
    background-color: #f0e6d8;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    color: #8b4513;
    min-width: 60px;
    text-align: center;
    font-size: 1.1rem;
}

/* Estilização da mensagem */
.msg {
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.msg-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.msg-sucess {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.msg-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Carregando  */
.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    text-align: center;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #6b3410;
    border-radius: 50%;
    width: 40px;
    height: 40px;

    animation: spin 1s linear infinite;
}

.loader-text {
    font-size: 1rem;
    color: #333;
    font-weight: bod;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* responsivo */
@media (min-width: 768px) {
    body {
        max-width: 800px;
        margin: 0 auto;
        padding: 40px 20px;
    }

    .input-section {
        display: flex;
        gap: 20px;
        align-items: flex-end;
    }

    .input-group {
        flex: 1;
        margin-bottom: 0;
    }

    .quantity-controls {
        margin: 0 20px
    }

    .add-button {
        width: auto;
    }

    /* Estoque */
    .estoque {
        margin: 2rem auto;
        padding: 0 2rem;
    }

    .estoque h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .estoque-item {
        padding: 20px;
    }

    .estoque-nome {
        font-size: 1.3rem;
    }

    .estoque-quantidade {
        padding: 10px 20px;
        font-size: 1.2rem;
        min-width: 80px;
    }
}