/* =====================================================================
   adfcal - réservations Autour d'une femme
   Charte : tournesol / violet profond / beige rosé / vieux rose
   ===================================================================== */

:root {
    /* Charte Autour d'une femme : 2 principales + 2 secondaires */
    --tournesol:      #f39843;   /* Sunflower yellow (principale) */
    --violet:         #6c1b3c;   /* Deep purple (principale) */
    --beige:          #fbe0d7;   /* Pinky beige (secondaire) */
    --rose:           #dc93a3;   /* Dusty rose (secondaire) */

    /* Teintes dérivées */
    --violet-fonce:   #521229;   /* survol des boutons */
    --rose-pale:      #f6e4e8;   /* sélection, jours disponibles */
    --tournesol-pale: #fdeada;   /* encadrés d'information */
    --fond:           #fdf4f0;   /* fond de page (beige très clair) */
    --encre:          #2e1a22;
    --muted:          #705860;
    --ligne:          #efd5cc;
    --rouge:          #B5402A;
    --vert:           #4E8A6B;
    --ombre:          0 2px 10px rgba(108, 27, 60, .08);
    --radius:         16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--fond);
    color: var(--encre);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

.muted  { color: var(--muted); }
.small  { font-size: .85rem; }
.center { text-align: center; }
.mono   { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* ---------- Cartes & messages ---------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--ombre);
    margin-bottom: 16px;
}
.card.soft { background: var(--beige); box-shadow: none; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: .95rem; }
.flash-ok   { background: #E4F0E8; color: #245C3F; }
.flash-err  { background: #FBE6E1; color: #8A2E1C; }
.flash-info { background: var(--tournesol-pale); color: #7a3f0c; }

.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: var(--beige); color: var(--muted); font-size: .8rem; font-weight: 600;
}
.badge-err { background: #FBE6E1; color: #8A2E1C; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip {
    background: var(--beige); border: 1px solid var(--beige); border-radius: 999px;
    padding: 2px 10px; font-size: .85rem; color: var(--encre);
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 10px 18px;
    border: 1px solid var(--ligne); border-radius: 999px;
    background: #fff; color: var(--encre);
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--violet); }
.btn-primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-fonce); }
.btn-danger { color: var(--rouge); border-color: #EBC3B9; }
.btn-danger:hover { background: #FBE6E1; border-color: var(--rouge); }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }

/* ---------- Formulaires ---------- */
.form label, form.card label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .92rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
    display: block; width: 100%; margin-top: 4px;
    padding: 11px 12px; min-height: 44px;
    border: 1px solid var(--ligne); border-radius: 10px;
    background: #fff; color: var(--encre);
    font: inherit; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tournesol); outline-offset: 1px; border-color: var(--tournesol); }
textarea { resize: vertical; }
label small { display: block; font-weight: 400; margin-top: 3px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }

label.check, label.radio {
    display: flex; gap: 10px; align-items: flex-start;
    font-weight: 400; cursor: pointer;
}
label.check input, label.radio input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--violet); }
label.radio {
    border: 1px solid var(--ligne); border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
label.radio:has(input:checked) { border-color: var(--violet); background: var(--rose-pale); }
label.radio small { display: block; color: var(--muted); }
label.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.w-sm { width: 80px !important; }

.row2, .row3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.prefix { display: flex; align-items: stretch; margin-top: 4px; }
.prefix > span {
    display: flex; align-items: center; padding: 0 10px;
    background: var(--beige); border: 1px solid var(--ligne); border-right: 0;
    border-radius: 10px 0 0 10px; font-weight: 400; font-size: .85rem; color: var(--muted);
    white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis;
}
.prefix > span::after { content: "/"; }
.prefix input { margin-top: 0 !important; border-radius: 0 10px 10px 0 !important; }

/* =====================================================================
   Pages publiques
   ===================================================================== */
.pub-top {
    background: var(--violet); color: #fff;
    border-bottom: 4px solid var(--tournesol);
    padding: 12px 16px;
}
.pub-brand { display: flex; align-items: center; gap: 12px; color: #fff; max-width: 980px; margin: 0 auto; }
.pub-brand:hover { text-decoration: none; }
.pub-brand strong { display: block; font-size: 1.02rem; }
.pub-brand small { display: block; opacity: .85; font-size: .82rem; }
.pub-logo { height: 40px; width: auto; }

.pub-main { max-width: 980px; margin: 0 auto; padding: 16px; }
.pub-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 12px 16px 32px; }

.profil { display: grid; grid-template-columns: 64px 1fr; gap: 6px 14px; align-items: center; }
.profil-logo { width: 64px; height: 64px; object-fit: contain; background: var(--violet); border-radius: 50%; padding: 8px; }
.profil h1 { margin: 0; }
.profil-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; margin: 2px 0 0; }
.profil-accroche {
    grid-column: 1 / -1; margin: 10px 0 0; padding-left: 14px;
    border-left: 3px solid var(--rose); font-style: italic; color: #5b3f4a;
}

.prestations { display: grid; gap: 14px; grid-template-columns: 1fr; }
.prestation { display: flex; flex-direction: column; color: var(--encre); margin: 0; transition: transform .12s, box-shadow .12s; }
.prestation:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(108, 27, 60, .14); }
.prestation h2 { color: var(--violet); }
.prestation .muted { flex: 1; font-size: .92rem; }
.cta { font-weight: 700; color: var(--violet); }

.retour { margin: 0 0 10px; font-size: .92rem; }

.resa-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.resa-info h1 { color: var(--violet); font-size: 1.3rem; }
.desc summary { cursor: pointer; font-weight: 600; color: var(--violet); margin-bottom: 6px; }
.desc div { font-size: .93rem; color: #4d3540; }
.lieux { list-style: none; padding: 0; margin: 12px 0 0; font-size: .9rem; color: var(--muted); }

/* Calendrier */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.cal-nav {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 50%; font-size: 1.5rem; line-height: 1; color: var(--violet);
}
.cal-nav:hover { background: var(--rose-pale); text-decoration: none; }
.cal-nav.off { color: var(--ligne); }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { font-size: .75rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal td { text-align: center; padding: 0; }
.cal td > a, .cal td > span {
    display: grid; place-items: center; aspect-ratio: 1; max-height: 48px; margin: 0 auto;
    border-radius: 50%; font-size: .95rem;
}
.cal td > span { color: #cdb5b9; }
.cal td > a { background: var(--rose-pale); color: var(--violet); font-weight: 700; }
.cal td > a:hover { background: var(--violet); color: #fff; text-decoration: none; }
.cal td.today > * { box-shadow: inset 0 0 0 2px var(--tournesol); }
.cal td.sel > a { background: var(--violet); color: #fff; }

#creneaux { margin-top: 20px; scroll-margin-top: 12px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot {
    display: block; text-align: center; padding: 11px 0;
    border: 1px solid var(--violet); border-radius: 10px;
    font-weight: 700; color: var(--violet);
}
.slot:hover { background: var(--violet); color: #fff; text-decoration: none; }

#formulaire { scroll-margin-top: 12px; }
.recap-creneau { background: var(--fond); border-radius: 12px; padding: 10px 12px; }

.success { text-align: center; background: #fff; }
.success .big { font-size: 2.4rem; }
.recap { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; font-weight: 600; }
.recap small { font-weight: 400; color: var(--muted); }
.note { background: var(--tournesol-pale); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }
.actions form { margin: 0; }

/* =====================================================================
   Administration
   ===================================================================== */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 16px;
    background: var(--violet); color: #fff;
    border-bottom: 3px solid var(--tournesol);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; }
.topbar-right { display: flex; gap: 4px; }
.topbar-right a {
    color: #fff; font-size: 1.2rem; width: 40px; height: 40px;
    display: grid; place-items: center; border-radius: 50%;
}
.topbar-right a:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }

.tabs {
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
    background: #fff; border-bottom: 1px solid var(--ligne);
    padding: 6px 12px; position: sticky; top: 56px; z-index: 20;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    flex: none; display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 999px; color: var(--encre); font-size: .92rem; white-space: nowrap;
}
.tabs a:hover { background: var(--fond); text-decoration: none; }
.tabs a.on { background: var(--rose-pale); color: var(--violet); font-weight: 700; }

.content { padding: 16px; max-width: 880px; margin: 0 auto 40px; }
.page-head { margin: 4px 0 14px; }
.page-head h1 { margin-bottom: 4px; }
.login { max-width: 380px; margin: 40px auto; }

.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--ombre); margin-bottom: 14px; }
.seg a { padding: 6px 14px; border-radius: 999px; color: var(--encre); font-size: .9rem; }
.seg a.on { background: var(--violet); color: #fff; }
.seg a:hover { text-decoration: none; }

h3.jour { font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 18px 4px 8px; }
.card.list { padding: 4px 0; }
.list-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 18px; color: var(--encre); border-bottom: 1px solid var(--beige);
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--fond); text-decoration: none; }
.list-item form { margin: 0; }
.heure { font-weight: 700; color: var(--violet); min-width: 52px; }
.grow { flex: 1; min-width: 0; }
.chev { color: var(--muted); font-size: 1.4rem; }

.plages { display: grid; gap: 10px; }
.plage-jour { display: grid; gap: 6px; }
.plage-jour.vide strong { color: var(--muted); }
.plage-champs { display: grid; gap: 6px; }
.plage { display: flex; align-items: center; gap: 6px; }
.plage input { margin: 0 !important; min-height: 40px !important; padding: 6px 8px !important; }
.plage span { color: var(--muted); }

.danger-zone { margin-top: 8px; text-align: right; }

/* =====================================================================
   Écrans larges
   ===================================================================== */
@media (min-width: 640px) {
    .row2 { grid-template-columns: 1fr 1fr; }
    .row3 { grid-template-columns: 1fr 1fr 1fr; }
    .prestations { grid-template-columns: 1fr 1fr; }
    .plage-jour { grid-template-columns: 110px 1fr; align-items: start; }
    .plage-jour strong { padding-top: 8px; }
    .plage-champs { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .resa-grid { grid-template-columns: 340px 1fr; }
    .resa-info { position: sticky; top: 16px; }
    .pub-main { padding: 24px 16px; }
}

/* Google Agenda (réglages) */
label.check small { display: inline; }
form + .form-actions, .form + .form-actions { margin-top: 14px; }
.form-actions form { margin: 0; }
.liste-avantages { margin: 0 0 14px; padding-left: 20px; }
.liste-avantages li { margin-bottom: 4px; }

/* =====================================================================
   Image de prestation : 5 formes (rectangle, alcôve, ovale, rond, carré)
   ===================================================================== */
.presta-image { margin: 0 auto 16px; overflow: hidden; background: var(--beige); }
.presta-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.forme-rectangle { aspect-ratio: 3 / 2; border-radius: 12px; }
.forme-carre     { aspect-ratio: 1;     border-radius: 12px; }
.forme-rond      { aspect-ratio: 1;     border-radius: 50%; }
.forme-ovale     { aspect-ratio: 4 / 5; border-radius: 50%; }
.forme-alcove    { aspect-ratio: 4 / 5; border-radius: 50% 50% 12px 12px / 40% 40% 12px 12px; } /* demi-cercle en haut */

/* Largeur : pleine pour le rectangle, plus resserrée pour les formes « portrait ». */
.presta-image.forme-rectangle { width: 100%; }
.presta-image.forme-carre,
.presta-image.forme-rond      { width: min(100%, 260px); }
.presta-image.forme-ovale,
.presta-image.forme-alcove    { width: min(100%, 240px); }

/* Admin : choix de la forme avec aperçu */
.image-actuelle .presta-image { margin-left: 0; max-width: 200px; }
.formes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.form label.forme-choix {
    display: flex; margin: 0; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 6px; border: 1px solid var(--ligne); border-radius: 12px;
    cursor: pointer; font-size: .85rem; font-weight: 600; text-align: center;
}
.forme-choix input { position: absolute; opacity: 0; pointer-events: none; }
.forme-choix:has(input:checked) { border-color: var(--violet); background: var(--rose-pale); color: var(--violet); }
.forme-choix:has(input:focus-visible) { outline: 2px solid var(--tournesol); }
.forme-vignette {
    display: block; height: 56px; max-width: 100%;
    background: var(--apercu, linear-gradient(135deg, var(--tournesol-pale), var(--rose))) center / cover no-repeat;
}
.forme-vignette.forme-rectangle { border-radius: 6px; }
.forme-vignette.forme-carre     { border-radius: 6px; }
.forme-vignette.forme-alcove    { border-radius: 50% 50% 6px 6px / 40% 40% 6px 6px; }
@media (max-width: 480px) {
    .formes { grid-template-columns: repeat(3, 1fr); }
}
