/* ============================================================
   creation_form_client3.css — Création du profil client
   Refonte "onboarding" : sections titrées avec icône, labels
   flottants, champs larges, bouton pilule.
   Remplace creation_form_client2.css sur CETTE page uniquement
   (l'ancien fichier reste en place pour les autres pages).
   Police : Poppins, héritée de common.css (non redéclarée).
   Tout est scopé sous .cfc => aucun effet sur l'entête / le footer.
   Le préfixe .cfc donne aussi la priorité sur les styles globaux
   de common.css (input[type=…]:focus, select, button…).
   ============================================================ */


/* ── Variables ─────────────────────────────────────────────────
   Toutes les dimensions passent par ces variables.
   clamp(min, fluide, max) : la taille varie en continu avec la
   largeur d'écran, du mobile (min) au desktop (max).
   => pour tout agrandir / réduire, on ne touche qu'ici.
   ───────────────────────────────────────────────────────────── */
.cfc-page {
    /* Couleurs (design system Papayoux) */
    --cfc-pink:     #e971ab;   /* boutons, focus, interrupteur */
    --cfc-red:      #FF3161;   /* erreurs */
    --cfc-ink:      #1c2b3a;   /* texte principal */
    --cfc-navy:     #0D2B55;   /* titre H1 */
    --cfc-muted:    #6b7a8c;   /* libellés, aides */
    --cfc-line:     #e3e1da;   /* bordure des champs */
    --cfc-line-hov: #cbc8bf;   /* bordure au survol */
    --cfc-bg:       #faf9f6;   /* fond de page blanc cassé */

    /* Gabarit */
    --cfc-maxw:     560px;                                   /* largeur de la colonne */
    --cfc-h:        clamp(46px, 44px + .5vw, 52px);          /* hauteur des champs */
    --cfc-btn-h:    clamp(46px, 44px + .4vw, 50px);          /* hauteur du bouton */
    --cfc-radius:   12px;
    --cfc-gap:      12px;                                    /* espace entre champs */

    /* Typographie */
    --cfc-fs:       15px;                                    /* texte des champs (16px sur mobile, cf. bas de fichier) */
    --cfc-fs-label: 11.5px;                                  /* label remonté */
    --cfc-fs-small: .78rem;                                  /* aides, erreurs */
    --cfc-title:    clamp(1.2rem, 1.1rem + .35vw, 1.4rem);   /* H1 (sur la ligne du lien connexion) */
    --cfc-h2:       clamp(.98rem, .92rem + .2vw, 1.1rem);    /* titres de section (H2), sous le H1 */

    background: var(--cfc-bg);
    color: var(--cfc-ink);
}

.cfc,
.cfc *,
.cfc *::before,
.cfc *::after {
    box-sizing: border-box;
}


/* ── Colonne centrale ───────────────────────────────────────── */
.cfc {
    max-width: var(--cfc-maxw);
    margin: 0 auto;
    padding: clamp(16px, 2.2vw, 28px) 20px clamp(48px, 5vw, 64px);
}


/* ── En-tête : titre + lien connexion ───────────────────────── */
/* Bloc centré, desktop et mobile : titre, barre rose, puis lien connexion */
.cfc .cfc-head {
    margin-bottom: clamp(28px, 2.5vw, 34px);   /* respiration avant le formulaire : 28px mobile -> 34px desktop */
    text-align: center;
}

.cfc .cfc-title {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    font-size: var(--cfc-title);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--cfc-navy);
    text-align: center;
}

/* Petite barre d'accent rose sous le titre (pseudo-élément : aucun HTML en plus),
   centrée grâce aux marges auto */
.cfc .cfc-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin: 8px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cfc-pink), #f7c3dc);
}

.cfc .cfc-login {
    margin: 0;
    font-size: .82rem;
    color: var(--cfc-muted);
}

.cfc .cfc-login a {
    color: var(--cfc-pink);
    font-weight: 700;
}

.cfc .cfc-login a:hover {
    text-decoration: underline;
}

/* Bandeau "inscription Google presque terminée" */
.cfc .cfc-notice {
    margin-bottom: 24px;
    padding: 12px 16px;
    font-size: .86rem;
    color: #7a5410;
    background: #fff6e5;
    border: 1px solid #f6d79b;
    border-radius: var(--cfc-radius);
}


/* ── Sections ───────────────────────────────────────────────── */
.cfc .cfc-section {
    margin-bottom: clamp(18px, 2vw, 26px);   /* + l'espace du dernier groupe */
}

/* Titre de section : icône + texte ; l'icône suit la taille du titre (em) */
.cfc .cfc-section__title {
    display: flex;
    align-items: center;
    gap: .5em;
    margin: 0 0 14px;
    padding: 0;
    font-size: var(--cfc-h2);
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--cfc-ink);
    text-align: left;
}

.cfc .cfc-section__title svg {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    stroke: currentColor;
}


/* ── Grille : 2 champs côte à côte ──────────────────────────── */
.cfc .cfc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--cfc-gap);
}

/* Groupe = champ + aide + erreurs */
.cfc .cfc-group {
    margin-bottom: var(--cfc-gap);
}


/* ── Champ à label flottant ─────────────────────────────────── */
.cfc .cfc-field {
    position: relative;
}

/* Le haut du champ (38 % de sa hauteur) est réservé au label remonté */
.cfc .cfc-field input,
.cfc .cfc-field select {
    display: block;
    width: 100%;
    height: var(--cfc-h);
    margin: 0;
    padding: calc(var(--cfc-h) * .38) 14px 3px;
    font: inherit;
    font-size: var(--cfc-fs);
    color: var(--cfc-ink);
    background-color: #fff;
    border: 1.5px solid var(--cfc-line);
    border-radius: var(--cfc-radius);
    box-shadow: none;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.cfc .cfc-field input:hover,
.cfc .cfc-field select:hover {
    border-color: var(--cfc-line-hov);
}

.cfc .cfc-field input:focus,
.cfc .cfc-field select:focus {
    border-color: var(--cfc-pink);
    box-shadow: 0 0 0 3px rgba(233, 113, 171, .15);
}

/* Label : centré dans le champ tant qu'il est vide, remonte au focus / à la saisie */
.cfc .cfc-field label {
    position: absolute;
    top: 50%;
    left: 15px;
    right: 42px;
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    font-size: var(--cfc-fs);
    font-weight: 400;
    color: var(--cfc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;            /* le clic passe au champ */
    transform: translateY(-50%);
    transition: top .15s ease, font-size .15s ease;
}

.cfc .cfc-field input:focus + label,
.cfc .cfc-field input:not(:placeholder-shown) + label,
.cfc .cfc-field input:-webkit-autofill + label,
.cfc .cfc-field--select label {
    top: calc(var(--cfc-h) * .29);
    font-size: var(--cfc-fs-label);
}

/* Placeholder (exemple de saisie) visible seulement au focus, sous le label remonté */
.cfc .cfc-field input::placeholder {
    color: transparent;
}

.cfc .cfc-field input:focus::placeholder {
    color: #a7b0bb;
    font-style: normal;
}


/* ── Listes déroulantes (pays, type légal, dates) ───────────── */
.cfc .cfc-field select,
.cfc .cfc-date select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c2b3a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}


/* ── Date de naissance / de création (date_master.php et date_master_legal.php) ──
   Structure des includes : .master > label + div#day / div#month / div#year > select
   Leur <style> interne fige chaque div à width:15% + margin-right:5% (inline-block) :
   on neutralise ici, scopé à .cfc-date, sans toucher aux includes (utilisés ailleurs). */

/* .master devient la ligne flex : label sur toute la largeur, puis les 3 listes */
.cfc .cfc-date .master {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Les 3 div conteneurs se partagent la largeur (annule width:15% / margin-right:5%) */
.cfc .cfc-date .master > div {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin: 0;
    font-size: inherit;
}

/* Proportions jour / mois / année (le label n'est pas une div) */
.cfc .cfc-date .master > div:nth-of-type(1) { flex-grow: 1; }
.cfc .cfc-date .master > div:nth-of-type(2) { flex-grow: 1.6; }
.cfc .cfc-date .master > div:nth-of-type(3) { flex-grow: 1.2; }

/* Le label de l'include devient le sous-titre de la ligne */
.cfc .cfc-date .master > label {
    flex: 0 0 100%;
    display: block;
    width: 100%;
    margin: 4px 0 0;
    padding: 0;
    font-size: .92rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--cfc-ink);
    cursor: default;
}

/* Le select remplit sa div */
.cfc .cfc-date select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: var(--cfc-h);
    margin: 0;
    padding-left: 14px;
    font: inherit;
    font-size: var(--cfc-fs);
    color: var(--cfc-ink);
    background-color: #fff;
    border: 1.5px solid var(--cfc-line);
    border-radius: var(--cfc-radius);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.cfc .cfc-date select:hover {
    border-color: var(--cfc-line-hov);
}

.cfc .cfc-date select:focus {
    border-color: var(--cfc-pink);
    box-shadow: 0 0 0 3px rgba(233, 113, 171, .15);
}


/* ── Mot de passe : bouton œil ──────────────────────────────── */
.cfc .cfc-field--pwd input {
    padding-right: 50px;
}

/* Annule le style "bouton rose" global de common.css (button) */
.cfc .cfc-eye {
    position: absolute;
    top: 50%;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    color: var(--cfc-muted);
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
    transform: translateY(-50%);
}

.cfc .cfc-eye:hover {
    color: var(--cfc-ink);
    background: #f3f2ee;
    box-shadow: none;
}

.cfc .cfc-eye svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Icône "œil barré" visible seulement quand le mot de passe est affiché */
.cfc .cfc-eye .cfc-eye__off            { display: none; }
.cfc .cfc-eye.is-on .cfc-eye__on       { display: none; }
.cfc .cfc-eye.is-on .cfc-eye__off      { display: block; }


/* ── Aides et erreurs ───────────────────────────────────────── */
.cfc .cfc-hint,
.cfc .message {
    display: block;
    margin: 6px 2px 0;
    font-size: var(--cfc-fs-small);
    line-height: 1.4;
    color: var(--cfc-muted);
}

.cfc .error {
    display: block;
    margin: 6px 2px 0;
    font-size: var(--cfc-fs-small);
    font-weight: 600;
    line-height: 1.4;
    color: var(--cfc-red);
}

/* Spans vides = invisibles (le JS ne fait que .text("") / .text("msg")) */
.cfc .error:empty,
.cfc .message:empty,
.cfc .cfc-hint:empty {
    display: none;
}

/* Groupe en erreur : bordure rouge + l'aide s'efface derrière le message */
.cfc .cfc-group:has(.error:not(:empty)) .cfc-field input,
.cfc .cfc-group:has(.error:not(:empty)) .cfc-field select,
.cfc .cfc-group:has(.error:not(:empty)) .cfc-date select {
    border-color: var(--cfc-red);
}

.cfc .cfc-group:has(.error:not(:empty)) .cfc-hint {
    display: none;
}


/* ── Personne morale : carte interrupteur ───────────────────── */
.cfc .cfc-switch-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid var(--cfc-line);
    border-radius: var(--cfc-radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.cfc .cfc-switch-card:hover {
    border-color: var(--cfc-line-hov);
}

/* Carte activée : liseré rose */
.cfc .cfc-switch-card:has(.cfc-switch__input:checked) {
    border-color: var(--cfc-pink);
    background: #fffafc;
}

.cfc .cfc-switch-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    color: var(--cfc-pink);
    background: #fdf0f6;
    border-radius: 10px;
}

.cfc .cfc-switch-card__icon svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
}

.cfc .cfc-switch-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cfc #lbl_moral {
    font-size: .98rem;
    font-weight: 700;
    color: var(--cfc-ink);
}

.cfc #span_morale {
    font-size: .8rem;
    line-height: 1.4;
    color: var(--cfc-muted);
}

/* Case native cachée mais toujours focusable au clavier */
.cfc .cfc-switch__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

/* Interrupteur type iOS */
.cfc .cfc-switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
    background: #dcd9d1;
    border-radius: 999px;
    transition: background .2s;
}

.cfc .cfc-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s;
}

.cfc .cfc-switch__input:checked + .cfc-switch {
    background: var(--cfc-pink);
}

.cfc .cfc-switch__input:checked + .cfc-switch::after {
    transform: translateX(18px);
}

.cfc .cfc-switch__input:focus-visible + .cfc-switch {
    box-shadow: 0 0 0 3px rgba(233, 113, 171, .25);
}

/* Zone des champs société, révélée sous la carte */
.cfc .cfc-cie {
    margin-top: 12px;
    padding: 16px 16px 4px;
    background: #f3f1eb;
    border-radius: var(--cfc-radius);
}


/* ── Consentements ──────────────────────────────────────────── */
.cfc .cfc-consents {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 20px;
}

.cfc .cfc-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: .84rem;
    line-height: 1.45;
    color: #4a5868;
    cursor: pointer;
}

.cfc .cfc-check input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--cfc-pink);
    cursor: pointer;
}

.cfc .cfc-check a {
    color: var(--cfc-ink);
    text-decoration: underline;
}


/* ── Bouton principal pleine largeur ────────────────────────────
   Couleurs, gras et survol viennent de common.css (input[type=submit]) :
   on ne change que la forme et la taille. */
.cfc #envoyer {
    display: block;
    width: 100%;
    height: var(--cfc-btn-h);
    margin: 0;
    padding: 0 20px;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: .01em;
    text-transform: none;
    border-radius: 999px;
    box-shadow: 0 5px 16px rgba(233, 113, 171, .32);
    transition: background .3s, transform .15s, box-shadow .15s;
}

.cfc #envoyer:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(233, 113, 171, .42);
}

.cfc #envoyer:active {
    transform: scale(.99);
}


/* ── A propos du compte (ex-#bloc2) en cartes ───────────────── */
.cfc .cfc-about {
    margin-top: clamp(40px, 4.5vw, 52px);
    padding-top: clamp(28px, 3vw, 36px);
    border-top: 1px solid var(--cfc-line);
}

.cfc .cfc-about__title {
    margin: 0 0 16px;
    font-size: .95rem;
    font-weight: 700;
    color: var(--cfc-ink);
    text-align: left;
}

.cfc .cfc-about__list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cfc .cfc-about__list li {
    position: relative;
    padding: 13px 16px 13px 44px;
    font-size: .84rem;
    line-height: 1.6;
    color: #44525f;
    background: #fff;
    border: 1px solid #ecebe5;
    border-radius: var(--cfc-radius);
}

/* Pastille "check" rose devant chaque point */
.cfc .cfc-about__list li::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 16px;
    width: 17px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e971ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m8 12.5 2.8 2.8L16.5 9.5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.cfc .cfc-about__list strong {
    display: block;
    margin-bottom: 1px;
    font-size: .9rem;
    color: var(--cfc-ink);
}

.cfc .cfc-about a {
    color: var(--cfc-pink);
    font-weight: 600;
}


/* ============================================================
   RESPONSIVE
   Les tailles sont déjà fluides (clamp) : il ne reste ici que
   les vrais changements de mise en page.
   ============================================================ */

/* Mobile (< 768px) */
@media screen and (max-width: 767px) {

    /* 16px mini dans les champs : sous ce seuil, iOS zoome au focus */
    .cfc-page {
        --cfc-fs: 16px;
        --cfc-fs-label: 11.5px;
    }

    .cfc {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cfc .cfc-switch-card {
        padding: 13px 14px;
    }

    .cfc .cfc-switch-card__icon {
        display: none;
    }

    .cfc .cfc-cie {
        padding: 14px 10px 2px;
    }

    /* Dates : chevron plus serré et mois plus large pour que "Jour" / "Année" / "septembre" tiennent dès 360px (Poppins) */
    .cfc .cfc-date .master {
        gap: 8px;
    }

    .cfc .cfc-date select {
        padding-left: 10px;
        padding-right: 24px;
        background-position: right 7px center;
        background-size: 14px;
    }

    .cfc .cfc-date .master > div:nth-of-type(1) { flex-grow: .85; }
    .cfc .cfc-date .master > div:nth-of-type(2) { flex-grow: 1.45; }
    .cfc .cfc-date .master > div:nth-of-type(3) { flex-grow: 1;    }
}

/* Petit mobile (< 560px) : 1 champ par ligne */
@media screen and (max-width: 559px) {

    .cfc .cfc-row {
        grid-template-columns: 1fr;
    }
}

/* Grand écran (≥ 1600px) : colonne un peu plus large */
@media screen and (min-width: 1600px) {

    .cfc-page {
        --cfc-maxw: 600px;
    }
}