/* ==========================================================================
   HYDROMELT V2.0 - STYLES GLOBAUX
   ========================================================================== */

:root {
    --ink: #3b332d;
    --muted: #756d66;
    --amber: #ffc61a;
    --amber-hover: #e5ae00;
    --line: #d9d4cf;
    --paper: #ffffff;
    --bg-body: #f5f5f3;
    --card-bg: #ffffff;
    --danger: #b93b23;
    --success: #2e7d32;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Work Sans", sans-serif;
    color: var(--ink);
    background-color: var(--bg-body);
    line-height: 1.5;
}

.hydromel-app-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    font-family: "Fraunces", serif;
    color: var(--ink);
}

/* --- BARRE DE NAVIGATION / HEADER UTILISATEUR --- */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--line);
    padding: 12px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(77, 49, 16, 0.03);
}

.user-bar .user-info {
    font-weight: 600;
    font-size: 14px;
}

/* --- GRILLE PRINCIPALE DE L'APPLICATION --- */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 992px) {
    .app-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.app-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(77, 49, 16, 0.04);
    margin-bottom: 24px;
}

/* --- FORMULAIRES ET CHAMPS --- */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}

.field {
    width: 100%;
    border: 1px solid #d8c7ad;
    border-radius: 12px;
    background: #fffefa;
    padding: 12px 15px;
    font: 600 16px "Work Sans", sans-serif;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(185, 120, 37, 0.12);
}

/* --- TOGGLE MODES --- */
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #eeeeec;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 24px;
}

.mode-btn {
    border: none;
    background: transparent;
    padding: 10px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--muted);
}

.mode-btn.active {
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* --- SECTIONS DE FICHE & RÉSULTATS --- */
.sheet-section {
    border-bottom: 1px solid #eee5d7;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.sheet-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 15px;
}

.result-value {
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.alert-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.alert-info {
    background: #fff8df;
    border: 1px solid #e7c879;
    color: #76551f;
}

/* --- BOUTONS --- */
.btn-action {
    background: var(--amber);
    color: var(--ink);
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-action:hover {
    background: var(--amber-hover);
}

.btn-secondary {
    background: #e0dcd7;
    color: var(--ink);
}
.btn-secondary:hover {
    background: #d0ccc7;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #9a2f1b;
}

/* --- AUTHENTIFICATION (FORMULAIRES LOGIN / REGISTER) --- */
.auth-container {
    max-width: 450px;
    margin: 60px auto;
}

.tab-auth {
    display: flex;
    margin-bottom: 20px;
    background: #eee;
    border-radius: 10px;
    padding: 4px;
}

.tab-auth button {
    flex: 1;
    border: none;
    background: none;
    padding: 10px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

.tab-auth button.active {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* --- GESTION DES RECETTES & LISTES --- */
.recipe-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
}

.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-private { background: #fbe9e7; color: #d84315; }
.badge-public { background: #e8f5e9; color: #2e7d32; }

/* --- IMPRESSION (PDF / PAPIER) --- */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .no-print, header, .user-bar, #fields-target, #fields-honey, .app-card:first-of-type {
        display: none !important;
    }
    .hydromel-app-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .app-grid {
        display: block !important;
    }
    #results-card, #financial-card {
        border: none !important;
        box-shadow: none !important;
        padding: 10px 0 !important;
        background: #fff !important;
        width: 100% !important;
        page-break-inside: avoid;
    }
    .alert-box {
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
        color: #333 !important;
    }
}