/* ROC — Suivi du jardin · Organic Biophilic · palette du logo ROC */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&family=Varela+Round&display=swap');

:root {
    /* palette extraite du logo ROC */
    --blue: #165E88;          /* lettres R·C */
    --blue-dark: #0F4666;
    --blue-soft: #E3EEF5;
    --green: #207861;         /* piment vert */
    --green-dark: #175A49;
    --green-soft: #E4F2ED;
    --gold: #FAC32B;
    --red: #E94A4D;
    --pink: #E71D6B;
    --teal: #2D989B;
    --ink: #29343B;
    --muted: #64707A;
    --bg: #FAF8F2;            /* crème chaleureuse */
    --card: #FFFFFF;
    --line: #E2E3DC;
    --radius: 18px;
    --shadow: 0 3px 14px rgba(22, 94, 136, .09);
    --font-head: 'Varela Round', 'Nunito Sans', sans-serif;
    --font-body: 'Nunito Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
    min-height: 100dvh;
    font-size: 16px;
}

h1, h2, h3, .brand { font-family: var(--font-head); font-weight: 400; }

/* ---------- barre supérieure ---------- */
.topbar {
    background: var(--blue);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    border-radius: 0 0 20px 20px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand {
    font-size: 18px;
    letter-spacing: .4px;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
}
.topbar .brand img { height: 34px; width: auto; background: #fff; border-radius: 10px; padding: 3px 7px; }
.topbar .nav { display: flex; gap: 8px; align-items: center; }
.topbar .nav a {
    font-size: 13px;
    font-weight: 700;
    padding: 10px 13px;
    border-radius: 22px;
    background: rgba(255,255,255,.15);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    cursor: pointer;
    transition: background .2s ease;
}
.topbar .nav a:hover { background: rgba(255,255,255,.28); }
.topbar .nav a.active { background: rgba(255,255,255,.32); }

.wrap { max-width: 640px; margin: 0 auto; padding: 18px 14px 70px; }

/* ---------- messages ---------- */
.flash {
    background: var(--green-soft);
    border: 1.5px solid var(--green);
    color: var(--green-dark);
    border-radius: var(--radius);
    padding: 13px 16px;
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    animation: fadein .25s ease;
}
.flash.error { background: #FDECEC; border-color: var(--red); color: #A93335; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- connexion ---------- */
.login-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 18px;
    background:
        radial-gradient(ellipse 420px 300px at 88% -60px, var(--blue-soft) 0%, transparent 70%),
        radial-gradient(ellipse 400px 280px at 8% 108%, var(--green-soft) 0%, transparent 70%),
        var(--bg);
}
.login-hero { text-align: center; padding: 0 10px 26px; }
.login-hero img { max-width: 250px; width: 70%; height: auto; }
.login-hero p { color: var(--muted); font-size: 15px; margin-top: 10px; font-weight: 600; }
.login-card { max-width: 400px; margin: 0 auto; width: 100%; }

/* ---------- cartes ---------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 18px;
    margin-bottom: 16px;
}

/* ---------- formulaires ---------- */
label.field { display: block; margin-bottom: 18px; }
label.field > span, fieldset.field > legend {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 7px;
    letter-spacing: .3px;
}
label.field .req, fieldset.field .req { color: var(--red); }

input[type=text], input[type=date], input[type=number], input[type=password],
input[type=tel], select, textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 16px;               /* évite le zoom automatique iOS */
    padding: 13px 15px;
    min-height: 50px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23165E88' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(22, 94, 136, .18);
}
textarea { min-height: 96px; resize: vertical; }

fieldset.field { border: none; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips label {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    min-height: 44px;
    border: 1.5px solid var(--line);
    border-radius: 22px;
    font-size: 14.5px;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:has(input:checked) {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    font-weight: 700;
}
.chips label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(32, 120, 97, .3); }

.other-input { margin-top: 9px; display: none; }
.other-input.visible { display: block; }

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 15px;
    min-height: 54px;
    font-family: var(--font-head);
    font-size: 17px;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background .2s ease;
}
.btn:hover { background: var(--green-dark); }
.btn:active { background: var(--green-dark); }
.btn:focus-visible { outline: 3px solid rgba(32,120,97,.4); outline-offset: 2px; }
.btn.blue { background: var(--blue); }
.btn.blue:hover, .btn.blue:active { background: var(--blue-dark); }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- accueil : tuiles ---------- */
.hello { margin: 4px 4px 18px; }
.hello h1 { font-size: 22px; color: var(--blue); }
.hello p { color: var(--muted); font-size: 14px; font-weight: 600; }

.group-title {
    font-family: var(--font-head);
    font-size: 14px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 24px 4px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.group-title::after { content: ''; flex: 1; height: 1.5px; background: var(--line); border-radius: 2px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 12px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    cursor: pointer;
    transition: box-shadow .2s ease, background .2s ease;
    min-height: 108px;
}
.tile:hover { background: var(--blue-soft); box-shadow: 0 5px 18px rgba(22, 94, 136, .16); }
.tile .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    border-radius: 15px;
    margin-bottom: 8px;
    color: #fff;
}
.tile .name { font-family: var(--font-head); font-size: 15px; color: var(--blue-dark); display: block; }
.tile .count { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 3px; display: block; }

/* couleurs d'icônes tirées du logo — attribuées par module */
.ic-green { background: var(--green); }
.ic-blue { background: var(--blue); }
.ic-gold { background: #DBA511; }
.ic-red { background: var(--red); }
.ic-pink { background: var(--pink); }
.ic-teal { background: var(--teal); }

/* ---------- dernières entrées ---------- */
.recent h2 {
    font-family: var(--font-head);
    font-size: 15px;
    color: var(--blue);
    margin: 24px 4px 10px;
    letter-spacing: .6px;
}
.entry {
    background: var(--card);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 13px 15px;
    margin-bottom: 10px;
    font-size: 14.5px;
    position: relative;
}
.entry .e-date { font-weight: 800; color: var(--blue); font-size: 13.5px; }
.entry .e-main { margin-top: 3px; font-weight: 600; }
.entry .e-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.entry .e-del {
    position: absolute;
    top: 8px; right: 8px;
    color: var(--red);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s ease;
}
.entry .e-del:hover { background: #FDECEC; }
.empty { color: var(--muted); font-weight: 600; text-align: center; padding: 18px; }

/* ---------- tableau de bord ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 15px;
    border-top: 4px solid var(--green);
}
.stat.c-blue { border-top-color: var(--blue); }
.stat.c-gold { border-top-color: var(--gold); }
.stat.c-red { border-top-color: var(--red); }
.stat.c-pink { border-top-color: var(--pink); }
.stat.c-teal { border-top-color: var(--teal); }
.stat .s-value { font-family: var(--font-head); font-size: 27px; color: var(--blue-dark); line-height: 1.15; }
.stat .s-label { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-top: 4px; letter-spacing: .4px; text-transform: uppercase; }
.stat .s-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ---------- tableaux (admin) ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th, table.list td { padding: 11px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.list a { color: var(--blue); font-weight: 700; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 8px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 800;
    font-size: 14.5px;
    cursor: pointer;
}
.back-link:hover { color: var(--blue-dark); }

.page-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-title .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    border-radius: 15px;
    color: #fff;
    flex-shrink: 0;
}
.page-title h1 { font-size: 21px; color: var(--blue); }

.note { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 10px; }

@media (min-width: 480px) {
    .tiles { grid-template-columns: 1fr 1fr 1fr; }
    .stats { grid-template-columns: 1fr 1fr 1fr; }
}
