@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');


:root {

    --cream: #f8f5ed;
    --paper: #fffdf8;

    --green: #526b57;
    --green-dark: #354c3b;

    --terracotta: #c8795b;
    --terracotta-dark: #a85e45;

    --ink: #30352f;
    --muted: #7b8178;

    --line: #e5e0d5;

    --yellow: #e6b84c;

}


* {
    box-sizing: border-box;
}


body {

    margin: 0;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(82,107,87,.06),
            transparent 30%
        ),
        var(--cream);

    color: var(--ink);

    font-family:
        'DM Sans',
        sans-serif;

}


/* --------------------------------
   HEADER
-------------------------------- */

.topbar {

    background: var(--green-dark);

    color: white;

    padding: 18px 0;

}


.topbar-content {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

}


.logo {

    color: white;

    text-decoration: none;

    display: flex;

    align-items: center;

    gap: 12px;

    font-family:
        'Playfair Display',
        serif;

    font-size: 21px;

}


.logo small {

    display: block;

    font-family:
        'DM Sans',
        sans-serif;

    font-size: 9px;

    letter-spacing: 2px;

    opacity: .65;

}


.logo-icon {

    font-size: 34px;

}


.btn-add {

    background: var(--terracotta);

    color: white;

    border: 0;

    border-radius: 10px;

    padding: 11px 18px;

    font-weight: 600;

    text-decoration: none;

    transition: .2s;

}


.btn-add:hover {

    background: var(--terracotta-dark);

    color: white;

    transform: translateY(-1px);

}


/* --------------------------------
   PAGE ACCUEIL
-------------------------------- */

.welcome {

    display: flex;

    align-items: end;

    justify-content: space-between;

    padding: 45px 0 28px;

    gap: 30px;

}


.eyebrow {

    color: var(--terracotta);

    text-transform: uppercase;

    font-weight: 700;

    font-size: 11px;

    letter-spacing: 2px;

    margin-bottom: 6px;

}


h1,
h2 {

    font-family:
        'Playfair Display',
        serif;

}


.welcome h1 {

    font-size: clamp(
        36px,
        5vw,
        54px
    );

    margin: 0 0 8px;

}


.welcome p {

    color: var(--muted);

    margin: 0;

}


.stats {

    display: flex;

    gap: 12px;

}


.stat {

    background: var(--paper);

    border: 1px solid var(--line);

    border-radius: 12px;

    padding: 12px 18px;

    min-width: 90px;

    text-align: center;

}


.stat strong {

    display: block;

    color: var(--green);

    font-family:
        'Playfair Display',
        serif;

    font-size: 25px;

}


.stat span {

    color: var(--muted);

    font-size: 11px;

}


/* --------------------------------
   RECHERCHE
-------------------------------- */

.search-area {

    margin-bottom: 20px;

}


.search-box {

    background: var(--paper);

    border: 1px solid var(--line);

    border-radius: 14px;

    padding: 6px 7px 6px 16px;

    display: flex;

    align-items: center;

    box-shadow:
        0 5px 20px
        rgba(40,50,40,.04);

}


.search-box > span {

    font-size: 25px;

    color: var(--muted);

    margin-right: 10px;

}


.search-box input {

    flex: 1;

    border: 0;

    outline: 0;

    background: transparent;

    padding: 10px 5px;

    font-family: inherit;

    font-size: 14px;

}


.search-box button {

    background: var(--green);

    color: white;

    border: 0;

    border-radius: 9px;

    padding: 10px 18px;

    font-weight: 600;

}


/* --------------------------------
   CATEGORIES
-------------------------------- */

.categories {

    display: flex;

    gap: 8px;

    overflow-x: auto;

    padding-bottom: 5px;

    margin-bottom: 25px;

}


.categories a {

    flex-shrink: 0;

    color: var(--muted);

    text-decoration: none;

    background: rgba(255,255,255,.55);

    border: 1px solid var(--line);

    padding: 8px 14px;

    border-radius: 30px;

    font-size: 13px;

    font-weight: 600;

}


.categories a:hover,
.categories a.active {

    background: var(--green);

    color: white;

    border-color: var(--green);

}


.categories a.favorite-tab.active {

    background: var(--yellow);

    color: #4d401e;

    border-color: var(--yellow);

}


/* --------------------------------
   RESULTATS
-------------------------------- */

.result-info {

    color: var(--muted);

    font-size: 13px;

    margin-bottom: 15px;

}


/* --------------------------------
   CARTES RECETTES
-------------------------------- */

.recipe-grid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(260px, 1fr)
        );

    gap: 16px;

}


.recipe-card {

    background: var(--paper);

    border: 1px solid var(--line);

    border-radius: 16px;

    padding: 20px;

    position: relative;

    min-height: 220px;

    display: flex;

    flex-direction: column;

    transition:
        transform .2s,
        box-shadow .2s;

}


.recipe-card:hover {

    transform: translateY(-3px);

    box-shadow:
        0 12px 30px
        rgba(40,50,40,.09);

}


.recipe-card-top {

    display: flex;

    justify-content: space-between;

    align-items: start;

}


.recipe-icon {

    width: 48px;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #f0eee5;

    border-radius: 12px;

    font-size: 25px;

}


.favorite {

    color: var(--yellow);

    font-size: 25px;

    text-decoration: none;

    line-height: 1;

}


.recipe-category {

    margin-top: 17px;

    color: var(--terracotta);

    text-transform: uppercase;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.5px;

}


.recipe-card h2 {

    font-size: 22px;

    line-height: 1.2;

    margin:
        5px 0 12px;

}


.recipe-meta {

    display: flex;

    gap: 15px;

    color: var(--muted);

    font-size: 12px;

}


.card-footer {

    border-top: 1px solid var(--line);

    margin-top: auto;

    padding-top: 14px;

}


.read-recipe {

    color: var(--green);

    text-decoration: none;

    font-size: 13px;

    font-weight: 700;

}


.read-recipe span {

    margin-left: 5px;

}


/* --------------------------------
   VIDE
-------------------------------- */

.empty-state {

    text-align: center;

    padding: 70px 20px;

    background: var(--paper);

    border: 1px dashed var(--line);

    border-radius: 18px;

}


.empty-icon {

    font-size: 55px;

    margin-bottom: 15px;

}


.empty-state h2 {

    margin-bottom: 5px;

}


.empty-state p {

    color: var(--muted);

    margin-bottom: 20px;

}


/* --------------------------------
   FICHE RECETTE
-------------------------------- */

.recipe-page {

    padding-top: 30px;

    padding-bottom: 60px;

}


.back-link {

    color: var(--green);

    text-decoration: none;

    font-size: 13px;

    font-weight: 600;

    display: inline-block;

    margin-bottom: 18px;

}


.recipe-sheet {

    background: var(--paper);

    border:
        1px solid var(--line);

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 10px 40px
        rgba(40,50,40,.06);

}


.recipe-header {

    padding: 40px 45px 30px;

    display: flex;

    justify-content: space-between;

    gap: 30px;

}


.recipe-header h1 {

    font-size:
        clamp(34px, 5vw, 54px);

    margin: 0 0 15px;

    line-height: 1.05;

}


.recipe-header-meta {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    color: var(--muted);

    font-size: 13px;

}


.big-favorite {

    color: var(--yellow);

    font-size: 38px;

    text-decoration: none;

}


.recipe-photo {

    padding:
        0 45px 30px;

}


.recipe-photo img {

    display: block;

    width: 100%;

    max-height: 430px;

    object-fit: cover;

    border-radius: 14px;

}


.recipe-content {

    border-top:
        1px solid var(--line);

    display: grid;

    grid-template-columns:
        minmax(230px, .7fr)
        minmax(300px, 1.3fr);

}


.ingredients,
.preparation {

    padding: 35px 45px;

}


.ingredients {

    background: #faf8f0;

    border-right:
        1px solid var(--line);

}


.ingredients h2,
.preparation h2 {

    font-size: 25px;

    margin: 0;

}


.ingredients h2 span,
.preparation h2 span {

    font-family:
        'DM Sans',
        sans-serif;

}


.separator {

    height: 2px;

    width: 45px;

    background: var(--terracotta);

    margin:
        13px 0 22px;

}


.ingredient-list {

    padding: 0;

    margin: 0;

    list-style: none;

}


.ingredient-list li {

    display: flex;

    gap: 10px;

    padding: 8px 0;

    border-bottom:
        1px dashed #ded9cc;

    font-size: 14px;

}


.check {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: var(--terracotta);

    margin-top: 7px;

    flex-shrink: 0;

}


.steps {

    display: flex;

    flex-direction: column;

    gap: 20px;

}


.step {

    display: flex;

    gap: 15px;

}


.step-number {

    flex-shrink: 0;

    width: 32px;

    height: 32px;

    border-radius: 50%;

    background: var(--green);

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: 700;

    font-size: 13px;

}


.step-text {

    line-height: 1.7;

    font-size: 14px;

    padding-top: 4px;

}


.recipe-actions {

    border-top:
        1px solid var(--line);

    padding: 20px 45px;

    display: flex;

    gap: 10px;

}


.btn-edit,
.btn-print,
.btn-delete {

    border-radius: 9px;

    padding: 9px 15px;

    text-decoration: none;

    font-size: 13px;

    font-weight: 600;

}


.btn-edit {

    color: white;

    background: var(--green);

}


.btn-print {

    color: var(--ink);

    background: #eeeae0;

    border: 0;

}


.btn-delete {

    color: #a23e3e;

    background: #f8e8e8;

}


/* --------------------------------
   FORMULAIRE
-------------------------------- */

.form-container {

    max-width: 850px;

    padding-top: 30px;

    padding-bottom: 70px;

}


.form-header {

    margin-bottom: 30px;

}


.form-header h1 {

    font-size: 45px;

    margin: 0 0 7px;

}


.form-header p {

    color: var(--muted);

}


.recipe-form {

    background: var(--paper);

    border: 1px solid var(--line);

    border-radius: 18px;

    padding: 30px;

}


.form-section {

    margin-bottom: 23px;

}


.form-section label {

    display: block;

    font-weight: 700;

    font-size: 13px;

    margin-bottom: 8px;

}


.form-section label span {

    color: var(--muted);

    font-weight: 400;

}


.form-section input,
.form-section select,
.form-section textarea {

    width: 100%;

    border:
        1px solid var(--line);

    border-radius: 9px;

    background: #fffefa;

    padding: 12px 13px;

    outline: none;

    font-family: inherit;

    color: var(--ink);

}


.form-section textarea {

    resize: vertical;

    line-height: 1.6;

}


.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {

    border-color: var(--green);

    box-shadow:
        0 0 0 3px
        rgba(82,107,87,.1);

}


.form-section small {

    display: block;

    margin-top: 6px;

    color: var(--muted);

    font-size: 11px;

}


.form-row {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 18px;

}


.input-with-unit {

    display: flex;

    align-items: center;

}


.input-with-unit input {

    border-radius:
        9px 0 0 9px;

}


.input-with-unit span {

    height: 46px;

    display: flex;

    align-items: center;

    padding: 0 12px;

    background: #eeeae0;

    border:
        1px solid var(--line);

    border-left: 0;

    color: var(--muted);

    font-size: 12px;

}


.photo-section {

    background: #f8f6ef;

    padding: 15px;

    border-radius: 10px;

}


.form-actions {

    border-top:
        1px solid var(--line);

    padding-top: 20px;

    display: flex;

    justify-content: flex-end;

    gap: 10px;

}


.btn-cancel {

    color: var(--muted);

    padding: 11px 17px;

    text-decoration: none;

}


.error-box {

    background: #fff0ed;

    border: 1px solid #f0c9c0;

    color: #914c3c;

    padding: 15px 18px;

    border-radius: 10px;

    margin-bottom: 20px;

}


.error-box ul {

    margin: 5px 0 0;

}


/* PHOTO ACTUELLE */

.current-photo {

    margin-bottom: 20px;

}


.current-photo label {

    display: block;

    font-weight: 700;

    font-size: 13px;

    margin-bottom: 8px;

}


.current-photo img {

    width: 180px;

    height: 130px;

    object-fit: cover;

    border-radius: 10px;

}


/* --------------------------------
   FOOTER
-------------------------------- */

footer {

    border-top:
        1px solid var(--line);

    color: var(--muted);

    font-size: 11px;

    padding: 22px 0;

}


footer .container {

    display: flex;

    justify-content: space-between;

}


/* --------------------------------
   MOBILE
-------------------------------- */

@media (max-width: 700px) {

    .topbar-content {

        align-items: center;

    }


    .logo {

        font-size: 17px;

    }


    .logo-icon {

        font-size: 27px;

    }


    .btn-add {

        padding: 9px 12px;

        font-size: 12px;

    }


    .welcome {

        display: block;

        padding-top: 30px;

    }


    .stats {

        margin-top: 20px;

    }


    .search-box button {

        display: none;

    }


    .recipe-grid {

        grid-template-columns: 1fr;

    }


    .recipe-header {

        padding:
            30px 22px 25px;

    }


    .recipe-photo {

        padding:
            0 22px 25px;

    }


    .recipe-content {

        grid-template-columns: 1fr;

    }


    .ingredients {

        border-right: 0;

        border-bottom:
            1px solid var(--line);

    }


    .ingredients,
    .preparation {

        padding: 28px 22px;

    }


    .recipe-actions {

        padding: 18px 22px;

        flex-wrap: wrap;

    }


    .form-row {

        grid-template-columns: 1fr;

        gap: 0;

    }


    .recipe-form {

        padding: 20px;

    }


    .form-header h1 {

        font-size: 36px;

    }


    footer .container {

        display: block;

        text-align: center;

    }


    footer span {

        display: block;

        margin: 5px;

    }

}


/* --------------------------------
   IMPRESSION
-------------------------------- */

@media print {

    body {

        background: white;

    }


    .topbar,
    .back-link,
    .recipe-actions,
    footer {

        display: none !important;

    }


    .recipe-page {

        padding: 0;

        max-width: none;

    }


    .recipe-sheet {

        border: 0;

        box-shadow: none;

    }


    .recipe-header {

        padding:
            20px 0;

    }


    .recipe-photo {

        padding:
            0 0 20px;

    }

}
