:root {
    --primary:       #1e3a6e;
    --primary-dark:  #152b52;
    --primary-light: #e8edf7;
    --accent:        #52b043;
    --warm-bg:       #f5f7fc;
    --text:          #1a2640;
    --text-muted:    #5a6b8a;
    --border:        #c8d3e8;
    --shadow:        0 2px 14px rgba(30,58,110,.09);
    --radius:        10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--warm-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Ccircle cx='20' cy='20' r='3' fill='%231e3a6e' opacity='0.07'/%3E%3Ccircle cx='80' cy='10' r='2' fill='%2352b043' opacity='0.07'/%3E%3Ccircle cx='140' cy='30' r='2.5' fill='%23f5a623' opacity='0.08'/%3E%3Ccircle cx='50' cy='60' r='2' fill='%23f5a623' opacity='0.07'/%3E%3Ccircle cx='120' cy='70' r='3' fill='%2352b043' opacity='0.07'/%3E%3Ccircle cx='10' cy='100' r='2' fill='%23f5a623' opacity='0.07'/%3E%3Ccircle cx='70' cy='110' r='2.5' fill='%231e3a6e' opacity='0.07'/%3E%3Ccircle cx='150' cy='110' r='2' fill='%231e3a6e' opacity='0.06'/%3E%3Ccircle cx='30' cy='145' r='3' fill='%2352b043' opacity='0.07'/%3E%3Ccircle cx='110' cy='145' r='2' fill='%23f5a623' opacity='0.07'/%3E%3Ccircle cx='155' cy='65' r='1.5' fill='%2352b043' opacity='0.06'/%3E%3Ccircle cx='90' cy='150' r='1.5' fill='%231e3a6e' opacity='0.05'/%3E%3C/svg%3E");
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-attachment: fixed;
}

/* ── Header ─────────────────────────────── */
.site-header {
    background: var(--primary);
    padding: 1rem 1.5rem;
}
.site-header .brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}
.brand-logo {
    height: 36px;
    width: auto;
    text-decoration: none;
    letter-spacing: .03em;
    border-radius: 4px;
}

/* ── Main ────────────────────────────────── */
.site-main {
    flex: 1;
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* ── Footer ──────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ── Cards ───────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-header {
    padding: .8rem 1.25rem;
    font-weight: 600;
    font-size: .95rem;
    border-bottom: 1px solid var(--border);
    background: var(--primary-light);
    color: var(--primary-dark);
}
.card-header a {
    font-weight: 400;
    font-size: .85rem;
    color: var(--primary);
    margin-left: 1rem;
    text-decoration: none;
}
.card-header a:hover { text-decoration: underline; }
.card-body { padding: 1.25rem; }

/* ── Typography ──────────────────────────── */
h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: .4rem;
}
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .75rem; }
p { margin-bottom: .75rem; }
a { color: var(--primary); }
.text-muted { color: var(--text-muted); font-size: .9rem; }
.text-small { font-size: .85rem; }

/* ── Forms ───────────────────────────────── */
.form-group { margin-bottom: 1rem; }
label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .35rem;
}
label.sub { font-size: .8rem; color: var(--text-muted); font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: .55rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: .95rem;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,58,110,.12);
}
input:disabled,
textarea:disabled,
select:disabled {
    background: #edf0f8;
    color: #8a9ab8;
    cursor: not-allowed;
}
.field-error { color: #c0392b; font-size: .8rem; margin-top: .3rem; }

/* ── Buttons ─────────────────────────────── */
.btn {
    display: inline-block;
    padding: .6rem 1.4rem;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s, transform .1s;
    line-height: 1.4;
}
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: #dde4f2; color: var(--primary-dark); }
.btn-secondary:hover { background: #cdd6ec; }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-outline-secondary { background: transparent; color: var(--primary-dark); border: 1.5px solid var(--border); }
.btn-outline-secondary:hover { background: #f1f5f9; }
.btn-full { width: 100%; text-align: center; display: block; padding: .75rem; font-size: 1rem; }

/* ── Alerts ──────────────────────────────── */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    border-width: 1px;
    border-style: solid;
}
.alert-error   { background: #fdf0ee; border-color: #f5c6c0; color: #8b2018; }
.alert-success { background: #eef7f0; border-color: #b8e0c2; color: #1a5c2e; }
.alert-warning { background: #fef9ec; border-color: #f5e09a; color: #7a5800; }
.alert-info    { background: #eef4fc; border-color: #b8d4f0; color: #1a3d6b; }

/* ── Category header ─────────────────────── */
.product-category-header {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    padding: .55rem 1.25rem;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
}
.grille-paliers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .5rem 1.25rem;
    background: #fff8ee;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}
.grille-paliers-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-right: .2rem;
}
.grille-palier-badge {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    padding: .2rem .55rem;
    border-radius: 20px;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    font-size: .8rem;
    white-space: nowrap;
}
.grille-subtotal {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .4rem 1.25rem;
    font-size: .82rem;
    background: var(--primary-light);
    border-top: 1px solid var(--border);
    color: var(--primary-dark);
}
.grille-subtotal-label { font-weight: 500; }
.grille-subtotal-amount { font-weight: 700; }
.grille-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;
    padding: .4rem 1.25rem;
    font-size: .82rem;
    font-weight: 700;
    color: #1e6b14;
    background: #d4f5cc;
    border-top: 1px solid #9dd994;
}

/* ── Product list ────────────────────────── */
.product-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.product-row:last-child { border-bottom: none; }
.product-row.has-qty { background: #edf0f8; }
.product-row.product-highlight {
    background: #fffbf0;
    border-left: 3px solid #e0a020;
}
.product-row.product-highlight.has-qty { background: #fef5e0; }
.product-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    background: #e0a020;
    color: #fff;
    padding: .1rem .45rem;
    border-radius: 4px;
    margin-left: .4rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.product-badge-new {
    background: var(--accent);
}
.product-info  { flex: 1; min-width: 0; }
.product-name  { font-size: .9rem; font-weight: 500; }
.product-meta  { font-size: .78rem; color: var(--text-muted); }
.product-price {
    font-size: .875rem;
    font-weight: 600;
    color: var(--primary-dark);
    min-width: 58px;
    text-align: right;
    white-space: nowrap;
}

/* stepper +/- */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.stepper button {
    width: 32px;
    height: 34px;
    background: var(--primary-light);
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    line-height: 1;
    transition: background .1s;
    flex-shrink: 0;
}
.stepper button:hover { background: #d0d9ef; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper input {
    width: 44px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: 0;
    text-align: center;
    padding: .3rem .2rem;
    font-size: .9rem;
    font-weight: 600;
    height: 34px;
}
.stepper input:focus { box-shadow: none; border-color: var(--border); outline: none; }

/* total bar */
.total-bar {
    position: sticky;
    bottom: 0;
    background: var(--primary);
    color: #fff;
    padding: .9rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 -4px 16px rgba(30,58,110,.18);
    margin-top: 1.5rem;
}
.total-bar .total-amount {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ── Grid ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Radio paiement ──────────────────────── */
.radio-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    margin-bottom: .5rem;
    cursor: pointer;
    font-size: .9rem;
    transition: border-color .15s, background .15s;
}
.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ── IBAN box ────────────────────────────── */
.iban-box {
    background: var(--warm-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .875rem;
    color: var(--text-muted);
    margin-top: .75rem;
}
.iban-box code { color: var(--primary-dark); font-size: .85rem; letter-spacing: .04em; }

/* ── Actions bar ─────────────────────────── */
.form-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: .5rem;
}

/* ── Catalogue grid (home) ───────────────── */
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
@media (max-width: 520px) {
    .catalogue-grid { grid-template-columns: 1fr; }
}

.catalogue-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.catalogue-card--open {
    border-color: var(--primary);
}
.catalogue-card--open:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(30,58,110,.16);
}
.catalogue-card__body {
    padding: 1.25rem 1.25rem .75rem;
    flex: 1;
}
.catalogue-card__status {
    margin-bottom: .6rem;
}
.catalogue-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .65rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.catalogue-badge--open {
    background: #d6f0d3;
    color: #2a6b22;
}
.catalogue-badge--closed {
    background: #f3f4f6;
    color: #6b7280;
}
.catalogue-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: .4rem;
}
.catalogue-card--closed .catalogue-card__title {
    color: #9ca3af;
}
.catalogue-card__dates {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}
.catalogue-card__link {
    font-size: .82rem;
    color: var(--primary);
    text-decoration: none;
}
.catalogue-card__link:hover { text-decoration: underline; }
.catalogue-card__footer {
    padding: .9rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--warm-bg);
}
.catalogue-card--closed .catalogue-card__footer {
    background: #f9fafb;
}
.catalogue-card__closed-msg {
    display: block;
    text-align: center;
    font-size: .85rem;
    color: #9ca3af;
    padding: .25rem 0;
}

/* ── Centered block (email_sent, merci) ───── */
.center-block {
    max-width: 460px;
    margin: 2rem auto 0;
    text-align: center;
}
.big-icon { font-size: 3rem; margin-bottom: 1rem; line-height: 1; }
.center-block h1 { font-size: 1.5rem; margin-bottom: .75rem; }
.center-block p  { color: var(--text-muted); }
.center-block p strong { color: var(--text); }

/* ── Info box (virement recap) ───────────── */
.info-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: .9rem;
    margin-top: 1.25rem;
}
.info-box .info-label { font-size: .8rem; color: var(--text-muted); margin-bottom: .2rem; }
.info-box .info-value { font-weight: 600; color: var(--primary-dark); }
