/* =====================================================================
   K.D.S Connect — feuille de style publique (KDS-CONNECT-002)
   Direction artistique : fond clair, zone d'identité sombre, touche
   dorée/cuivre discrète, cartes aérées, mobile-first.
   ===================================================================== */

:root {
    --fond: #f6f4f0;            /* blanc cassé chaud */
    --carte: #ffffff;
    --encre: #1a1a1a;          /* noir profond */
    --encre-douce: #4a463f;    /* gris chaud */
    --encre-faible: #7d766b;
    --sombre: #171512;         /* zone identité */
    --sombre-2: #241f18;
    --or: #b8863b;             /* doré / cuivre */
    --or-clair: #d9ab63;
    --bordure: #e7e2d8;
    --bordure-sombre: rgba(255, 255, 255, .12);
    --ombre: 0 1px 2px rgba(23, 21, 18, .04), 0 8px 24px rgba(23, 21, 18, .06);
    --rayon: 16px;
    --rayon-s: 12px;
    --touche: 52px;            /* taille tactile minimale */
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--fond);
    color: var(--encre);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--or); }

.site-contenu {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}

.site-pied {
    max-width: 480px;
    margin: 0 auto;
    /* Sur mobile, la barre d'action fixe (.barre-mobile) recouvre le bas de
       l'écran : on dégage assez d'espace sous le footer pour qu'il reste
       visible au-dessus d'elle. Réduit au strict nécessaire sur desktop
       (barre masquée) via la media query plus bas. */
    padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--encre-faible);
    font-size: .8rem;
}
.site-pied strong { color: var(--encre-douce); }

/* --------------------------- Blocs / cartes --------------------------- */

.bloc {
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 20px;
    margin-top: 16px;
}

.bloc-titre {
    margin: 0 0 14px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--encre-faible);
}

/* ------------------------------ En-tête ------------------------------- */

.profil-entete {
    position: relative;
    margin-top: 16px;
    padding: 32px 20px 28px;
    text-align: center;
    color: #fff;
    background: radial-gradient(120% 90% at 50% -10%, var(--sombre-2), var(--sombre));
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    overflow: hidden;
}
.profil-entete::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--or), transparent);
}

.profil-avatar {
    width: 92px; height: 92px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #2c261d, #1b1712);
    border: 1px solid var(--bordure-sombre);
    box-shadow: 0 0 0 3px rgba(184, 134, 59, .22);
    overflow: hidden;
}
.profil-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profil-avatar-logo { object-fit: contain; padding: 12px; background: #fff; }
.profil-initiales {
    font-size: 2rem; font-weight: 600; letter-spacing: .02em;
    color: var(--or-clair);
}

.profil-nom { margin: 6px 0 4px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.profil-entreprise { margin: 0; font-size: 1.02rem; color: #efe7d6; }
.profil-fonction { margin: 4px 0 0; font-size: .92rem; color: #b9b1a2; }

.profil-badge {
    display: inline-flex; align-items: center; gap: 7px;
    margin: 16px 0 0;
    padding: 6px 14px;
    font-size: .74rem; font-weight: 600; letter-spacing: .04em;
    color: var(--or-clair);
    background: rgba(184, 134, 59, .12);
    border: 1px solid rgba(184, 134, 59, .3);
    border-radius: 999px;
}
.profil-badge span { font-size: .55rem; }

/* ------------------------------ Boutons ------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: var(--touche);
    padding: 14px 18px;
    font-size: 1rem; font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-s);
    background: var(--carte);
    color: var(--encre);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-principal {
    background: linear-gradient(160deg, #1f1a13, #100d0a);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(23, 21, 18, .18);
}
.btn-principal .ico { color: var(--or-clair); }

.btn-contact {
    margin-top: 12px;
    background: rgba(184, 134, 59, .10);
    border-color: rgba(184, 134, 59, .38);
    color: #8a611f;
}

.actions-secondaires {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.btn-secondaire { font-size: .95rem; }
.btn-secondaire .ico { color: var(--or); }

.ico { width: 20px; height: 20px; flex: none; }

/* ---------------------------- Actions métier -------------------------- */

.liste-metier { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.carte-action {
    display: flex; flex-direction: column; gap: 2px;
    min-height: var(--touche);
    padding: 14px 16px;
    text-decoration: none;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-s);
    background: var(--fond);
    color: var(--encre);
}
.carte-action:hover { border-color: rgba(184, 134, 59, .4); }
.carte-action-titre { font-weight: 600; }
.carte-action-sous { font-size: .85rem; color: var(--encre-faible); }

/* ------------------------------ À propos ------------------------------ */

.apropos-texte { margin: 0; color: var(--encre-douce); }

/* ---------------------------- Coordonnées ----------------------------- */

.coordonnees { margin: 0; }
.coord-ligne {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--bordure);
}
.coord-ligne:first-child { border-top: 0; padding-top: 0; }
.coord-ligne dt { color: var(--encre-faible); font-size: .82rem; }
.coord-ligne dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }
.coord-ligne dd a { text-decoration: none; }

/* ------------------------------ Partage ------------------------------- */

.partage-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.partage-retour {
    margin: 12px 0 0; min-height: 1.2em;
    font-size: .88rem; font-weight: 600; color: #2e7d4f;
    text-align: center;
}
.partage-retour:empty { margin: 0; }

/* ------------------------------- QR Code ------------------------------ */

.bloc-qr { text-align: center; }
.qr-cadre {
    display: inline-block;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-s);
}
.qr-image { display: block; width: 180px; height: 180px; }

/* -------------------------- Barre mobile fixe ------------------------- */

.barre-mobile {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    display: flex; gap: 10px;
    max-width: 480px; margin: 0 auto;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(246, 244, 240, .92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--bordure);
}
.barre-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    flex: 1; min-height: 48px;
    font-size: .95rem; font-weight: 600; text-decoration: none;
    border: 1px solid var(--bordure); border-radius: var(--rayon-s);
    background: var(--carte); color: var(--encre);
}
.barre-btn .ico { color: var(--or); }
.barre-btn-principal {
    background: linear-gradient(160deg, #1f1a13, #100d0a);
    color: #fff; border-color: transparent;
}
.barre-btn-principal .ico { color: var(--or-clair); }

/* ------------------------- Accueil / erreurs -------------------------- */

.bloc-accueil, .bloc-erreur {
    max-width: 480px; margin: 48px auto; padding: 24px;
    text-align: center;
}
.bloc-accueil h1 { font-size: 2rem; }
.bloc-accueil .accroche { color: var(--encre-douce); font-size: 1.1rem; }
.bloc-erreur h1 { font-size: 3rem; margin-bottom: 0; color: var(--or); }
code { background: #ece7dd; padding: .1rem .4rem; border-radius: 6px; }
.erreur-debug {
    background: var(--sombre); color: #f4efe4; padding: 1rem;
    border-radius: 8px; overflow-x: auto; font-size: .8rem; text-align: left;
}

/* ----------------------------- Desktop -------------------------------- */

@media (min-width: 720px) {
    .barre-mobile { display: none; }
    .site-contenu { padding-bottom: 24px; }
    /* Barre masquée : le footer n'a plus besoin de dégagement. */
    .site-pied { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
    .profil-entete { margin-top: 32px; }
}

/* --------------------------- Accessibilité ---------------------------- */

a:focus-visible, button:focus-visible {
    outline: 3px solid var(--or);
    outline-offset: 2px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
