/**
 * OOI Platform V1 — Carte publique d’une Identité
 */

/* =========================================================
   CARTE GÉNÉRALE
========================================================= */

.ooi-identity-card {
    position: relative;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    width: 100%;
    max-width: 820px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid rgba(114, 112, 172, .18);
    border-radius: 24px;
    background:
        radial-gradient(
            circle at top right,
            rgba(128, 197, 207, .11),
            transparent 34%
        ),
        #ffffff;
    box-shadow:
        0 18px 46px rgba(7, 20, 38, .09),
        0 3px 10px rgba(7, 20, 38, .04);
    transition:
        transform .22s ease,
        box-shadow .22s ease,
        border-color .22s ease;
}

.ooi-identity-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(
        180deg,
        #7270AC 0%,
        #80C5CF 55%,
        #AACF80 100%
    );
    content: "";
}

.ooi-identity-card:hover {
    transform: translateY(-3px);
    border-color: rgba(114, 112, 172, .30);
    box-shadow:
        0 24px 58px rgba(7, 20, 38, .13),
        0 5px 14px rgba(7, 20, 38, .05);
}


/* =========================================================
   VISUEL — PHOTO RONDE
========================================================= */

.ooi-identity-card__visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 148px;
    height: 148px;
    padding: 6px;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        #7270AC,
        #80C5CF,
        #AACF80
    );
    box-shadow:
        0 12px 28px rgba(114, 112, 172, .20),
        0 0 0 7px rgba(114, 112, 172, .06);
}

.ooi-identity-card__visual::after {
    position: absolute;
    z-index: 3;
    inset: 6px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    pointer-events: none;
    content: "";
}

.ooi-identity-card__image,
.ooi-identity-card__initials {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 136px !important;
    height: 136px !important;
    min-width: 136px;
    min-height: 136px;
    max-width: 136px !important;
    max-height: 136px !important;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 50% !important;
    clip-path: circle(50%);
}

.ooi-identity-card__image {
    object-fit: cover !important;
    object-position: center;
}

.ooi-identity-card__initials {
    background: linear-gradient(
        145deg,
        #7270AC,
        #5e5c9d
    );
    color: #ffffff;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: .04em;
}


/* =========================================================
   CONTENU
========================================================= */

.ooi-identity-card__content {
    min-width: 0;
}

.ooi-identity-card__type {
    display: inline-flex;
    margin-bottom: 7px;
    color: #7270AC;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .10em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ooi-identity-card__name {
    margin: 0;
    color: #071426;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.ooi-identity-card__profession {
    margin-top: 5px;
    color: #273347;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.ooi-identity-card__description {
    max-width: 580px;
    margin: 6px 0 0;
    color: rgba(7, 20, 38, .74);
    font-size: 14px;
    line-height: 1.55;
}

.ooi-identity-card__location {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: rgba(7, 20, 38, .72);
    font-size: 13px;
    font-weight: 600;
}

.ooi-identity-card__location > span:first-child {
    flex: 0 0 auto;
}


/* =========================================================
   ACTIONS PROFESSIONNELLES
========================================================= */

.ooi-identity-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 15px;
}

.ooi-identity-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid rgba(114, 112, 172, .28);
    border-radius: 999px;
    background: #ffffff;
    color: #5b5997;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition:
        transform .18s ease,
        border-color .18s ease,
        background-color .18s ease,
        color .18s ease;
}

.ooi-identity-card__action:hover,
.ooi-identity-card__action:focus-visible {
    transform: translateY(-1px);
    border-color: #7270AC;
    background: rgba(114, 112, 172, .07);
    color: #48467f;
}

.ooi-identity-card__action--primary {
    border-color: transparent;
    background: #7270AC;
    color: #ffffff;
}

.ooi-identity-card__action--primary:hover,
.ooi-identity-card__action--primary:focus-visible {
    background: #5f5d9d;
    color: #ffffff;
}


/* =========================================================
   RELATION ET REVENDICATION
========================================================= */

.ooi-identity-card__relationship {
    margin-top: 16px;
}

.ooi-identity-card__status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(128, 197, 207, .16);
    color: #176873;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}

.ooi-identity-card__status--claimed {
    background: rgba(170, 207, 128, .22);
    color: #4d6f27;
}

.ooi-identity-card__claim-form {
    display: inline-block;
    margin: 10px 0 0;
}

.ooi-identity-card__claim-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 10px;
    padding: 9px 17px;
    border: 1px solid rgba(255, 171, 78, .80);
    border-radius: 999px;
    background: rgba(255, 171, 78, .11);
    color: #9b5200;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

.ooi-identity-card__claim-button:hover,
.ooi-identity-card__claim-button:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 171, 78, .21);
    box-shadow: 0 8px 18px rgba(255, 171, 78, .16);
}

.ooi-identity-card__claim-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.ooi-identity-card__claim-note {
    display: block;
    max-width: 480px;
    margin-top: 8px;
    color: rgba(7, 20, 38, .55);
    font-size: 11px;
    line-height: 1.45;
}


/* =========================================================
   NOTIFICATIONS
========================================================= */

.ooi-identity-card__notice {
    grid-column: 1 / -1;
    padding: 12px 15px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.ooi-identity-card__notice--success {
    border: 1px solid rgba(170, 207, 128, .55);
    background: rgba(170, 207, 128, .18);
    color: #466623;
}

.ooi-identity-card__notice--error {
    border: 1px solid rgba(217, 158, 130, .55);
    background: rgba(217, 158, 130, .15);
    color: #813f2f;
}

.ooi-identity-card-error {
    padding: 14px 16px;
    border: 1px solid #D99E82;
    border-radius: 12px;
    background: #fff8f4;
}


/* =========================================================
   ACCESSIBILITÉ
========================================================= */

.ooi-identity-card a:focus-visible,
.ooi-identity-card button:focus-visible {
    outline: 3px solid rgba(128, 197, 207, .50);
    outline-offset: 3px;
}


/* =========================================================
   RESPONSIVE TABLETTE
========================================================= */

@media (max-width: 760px) {
   .ooi-identity-card__visual {
    width: 124px;
    height: 124px;
}

.ooi-identity-card__image,
.ooi-identity-card__initials {
    width: 112px !important;
    height: 112px !important;
    min-width: 112px;
    min-height: 112px;
    max-width: 112px !important;
    max-height: 112px !important;
}

/* =========================================================
   RESPONSIVE MOBILE
========================================================= */

@media (max-width: 560px) {
  .ooi-identity-card__visual {
    width: 130px;
    height: 130px;
    margin: 0 auto;
}

.ooi-identity-card__image,
.ooi-identity-card__initials {
    width: 118px !important;
    height: 118px !important;
    min-width: 118px;
    min-height: 118px;
    max-width: 118px !important;
    max-height: 118px !important;
}


/* =========================================================
   PETITS ÉCRANS
========================================================= */

@media (max-width: 390px) {
    .ooi-identity-card {
        padding-right: 16px;
        padding-left: 16px;
    }

    .ooi-identity-card__name {
        font-size: 26px;
    }

    .ooi-identity-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ooi-identity-card__action,
    .ooi-identity-card__claim-button {
        width: 100%;
    }
}


/* =========================================================
   UTILISATEURS PRÉFÉRANT MOINS D’ANIMATIONS
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .ooi-identity-card,
    .ooi-identity-card__action,
    .ooi-identity-card__claim-button {
        transition: none;
    }

    .ooi-identity-card:hover,
    .ooi-identity-card__action:hover,
    .ooi-identity-card__claim-button:hover {
        transform: none;
    }
}

/* =========================================================
   OOI — ADAPTATION MOBILE RENFORCÉE
   À placer tout à la fin du fichier
========================================================= */

@media screen and (max-width: 820px) {

    .ooi-identity-card {
        grid-template-columns: 1fr !important;
        gap: 16px;
        max-width: 100%;
        padding: 24px 20px;
        text-align: center;
    }

    .ooi-identity-card::before {
        width: 100%;
        height: 4px;
        background: linear-gradient(
            90deg,
            #7270AC,
            #80C5CF,
            #AACF80
        );
    }

    /* Photo placée en premier et centrée */
    .ooi-identity-card__visual {
        grid-column: 1;
        grid-row: auto;
        width: 128px;
        height: 128px;
        margin: 0 auto;
    }

    .ooi-identity-card__image,
    .ooi-identity-card__initials {
        width: 116px !important;
        height: 116px !important;
        min-width: 116px;
        min-height: 116px;
        max-width: 116px !important;
        max-height: 116px !important;
    }

    .ooi-identity-card__content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .ooi-identity-card__type {
        margin-bottom: 5px;
        font-size: 10px;
    }

    .ooi-identity-card__name {
        max-width: 100%;
        font-size: 30px;
        line-height: 1.05;
        text-align: center;
        overflow-wrap: normal;
        word-break: normal;
    }

    .ooi-identity-card__profession {
        margin-top: 6px;
        font-size: 14px;
    }

    /* Présentation limitée à deux lignes */
    .ooi-identity-card__description {
        display: -webkit-box;
        max-width: 360px;
        margin: 8px auto 0;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.5;
        text-align: center;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .ooi-identity-card__location {
        justify-content: center;
        margin-top: 11px;
        font-size: 12px;
        text-align: center;
    }

    /* Actions empilées et faciles à utiliser au doigt */
    .ooi-identity-card__actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 240px;
        margin-top: 15px;
    }

    .ooi-identity-card__action {
        width: 100%;
        min-height: 40px;
    }

    .ooi-identity-card__relationship {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 14px;
    }

    .ooi-identity-card__claim-form {
        display: block;
        width: 100%;
        max-width: 260px;
    }

    .ooi-identity-card__claim-button {
        width: 100%;
        min-height: 42px;
        margin-top: 9px;
    }

    .ooi-identity-card__claim-note {
        max-width: 290px;
        margin-right: auto;
        margin-left: auto;
        font-size: 10px;
        text-align: center;
    }

    .ooi-identity-card__status {
        justify-content: center;
        max-width: 260px;
        text-align: center;
    }
}


/* =========================================================
   TRÈS PETITS ÉCRANS
========================================================= */

@media screen and (max-width: 390px) {

    .ooi-identity-card {
        padding: 22px 16px;
        border-radius: 20px;
    }

    /*
     * Le type « Personne physique » est secondaire sur
     * une carte mobile très compacte.
     */
    .ooi-identity-card__type {
        display: none;
    }

    .ooi-identity-card__visual {
        width: 116px;
        height: 116px;
    }

    .ooi-identity-card__image,
    .ooi-identity-card__initials {
        width: 104px !important;
        height: 104px !important;
        min-width: 104px;
        min-height: 104px;
        max-width: 104px !important;
        max-height: 104px !important;
    }

    .ooi-identity-card__name {
        font-size: 27px;
    }

    .ooi-identity-card__description {
        font-size: 12px;
    }

    .ooi-identity-card__actions,
    .ooi-identity-card__claim-form {
        max-width: 100%;
    }
}

/* =========================================================
   PARTAGE PUBLIC — ACTION NATIVE, DISCRÈTE ET IMMÉDIATE
========================================================= */

.ooi-identity-card__content {
    padding-right: 44px;
}

.ooi-identity-card__share-button {
    position: absolute;
    z-index: 6;
    top: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(114, 112, 172, .18);
    border-radius: 50%;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 10px 24px rgba(7, 20, 38, .10);
    color: #071426;
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition:
        transform .18s ease,
        background-color .18s ease,
        color .18s ease;
}

.ooi-identity-card__edit-button {
    position: absolute;
    z-index: 6;
    top: 24px;
    right: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(114, 112, 172, .18);
    border-radius: 50%;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 10px 24px rgba(7, 20, 38, .10);
    color: #7270ac;
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition:
        transform .18s ease,
        background-color .18s ease,
        color .18s ease;
}

.ooi-identity-card__edit-button::before {
    content: "\270E";
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}

.ooi-identity-card__edit-button svg {
    display: none;
}

.ooi-identity-card__edit-button:hover,
.ooi-identity-card__edit-button:focus-visible {
    transform: translateY(-2px);
    background: #071426;
    color: #ffffff;
}

.ooi-identity-card__share-button:hover,
.ooi-identity-card__share-button:focus-visible,
.ooi-identity-card__share-button.is-copied {
    transform: translateY(-2px);
    background: #071426;
    color: #ffffff;
}

.ooi-identity-card__relationship:empty {
    display: none;
}

@media screen and (max-width: 820px) {
    .ooi-identity-card__share-button {
        top: 18px;
        right: 18px;
        width: 42px;
        height: 42px;
    }

    .ooi-identity-card__edit-button {
        top: 18px;
        right: 66px;
        width: 42px;
        height: 42px;
    }

    .ooi-identity-card__content {
        padding-right: 0;
    }
}

/* ==========================================================
   V6 — Groupe d'actions fiable sur ordinateur et mobile
   ========================================================== */

.ooi-identity-card__utility-actions {
    position: absolute !important;
    z-index: 30 !important;
    top: 24px !important;
    right: 24px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ooi-identity-card__utility-actions .ooi-identity-card__share-button,
.ooi-identity-card__utility-actions .ooi-identity-card__edit-button {
    position: static !important;
    inset: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(114, 112, 172, .18) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: 0 10px 24px rgba(7, 20, 38, .1) !important;
    color: #10233f !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.ooi-identity-card__utility-actions .ooi-identity-card__edit-button {
    color: #7270ac !important;
}

.ooi-identity-card__utility-actions .ooi-identity-card__edit-button::before {
    display: none !important;
    content: none !important;
}

.ooi-identity-card__utility-actions .ooi-identity-card__share-button > span {
    display: none !important;
}

.ooi-identity-card__utility-actions .ooi-identity-card__share-button::before,
.ooi-identity-card__utility-actions .ooi-identity-card__edit-icon {
    display: block !important;
    width: 21px !important;
    height: 21px !important;
    background: currentColor !important;
    content: "" !important;
}

.ooi-identity-card__utility-actions .ooi-identity-card__share-button:hover,
.ooi-identity-card__utility-actions .ooi-identity-card__share-button:focus-visible,
.ooi-identity-card__utility-actions .ooi-identity-card__edit-button:hover,
.ooi-identity-card__utility-actions .ooi-identity-card__edit-button:focus-visible {
    background: #10233f !important;
    color: #fff !important;
}

@media screen and (max-width: 820px) {
    .ooi-identity-card__utility-actions {
        top: 18px !important;
        right: 18px !important;
        gap: 8px !important;
    }

    .ooi-identity-card__utility-actions .ooi-identity-card__share-button,
    .ooi-identity-card__utility-actions .ooi-identity-card__edit-button {
        flex-basis: 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }
}

/* =========================================================
   ACTIONS DE CARTE — MÊME LANGAGE SUR TOUS LES ÉCRANS
========================================================= */

.ooi-identity-card {
    position: relative !important;
}

.ooi-identity-card__content {
    padding-right: 112px;
}

.ooi-identity-card > .ooi-identity-card__share-button,
.ooi-identity-card > .ooi-identity-card__edit-button {
    position: absolute !important;
    z-index: 20 !important;
    top: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(114, 112, 172, .18) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .9) !important;
    box-shadow: 0 10px 24px rgba(7, 20, 38, .1) !important;
    color: #10233f !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.ooi-identity-card > .ooi-identity-card__share-button {
    right: 24px !important;
}

.ooi-identity-card > .ooi-identity-card__edit-button {
    right: 80px !important;
    color: #7270ac !important;
}

.ooi-identity-card__share-button > span:not(.ooi-identity-card__share-icon) {
    display: none !important;
}

.ooi-identity-card__share-button::before,
.ooi-identity-card__edit-icon {
    display: block !important;
    width: 21px;
    height: 21px;
    background: currentColor;
    content: "";
}

.ooi-identity-card__share-button::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 16a3 3 0 0 0-2.39 1.19L8.91 13.8a3.3 3.3 0 0 0 0-3.6l6.7-3.39A3 3 0 1 0 15 5c0 .14.01.28.03.41L8.1 8.92a3 3 0 1 0 0 6.16l6.93 3.51A3 3 0 1 0 18 16Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18 16a3 3 0 0 0-2.39 1.19L8.91 13.8a3.3 3.3 0 0 0 0-3.6l6.7-3.39A3 3 0 1 0 15 5c0 .14.01.28.03.41L8.1 8.92a3 3 0 1 0 0 6.16l6.93 3.51A3 3 0 1 0 18 16Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ooi-identity-card__edit-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 20h4.2L19.6 8.6a2 2 0 0 0 0-2.8l-1.4-1.4a2 2 0 0 0-2.8 0L4 15.8V20Zm2-3.4L16.8 5.8l1.4 1.4L7.4 18H6v-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 20h4.2L19.6 8.6a2 2 0 0 0 0-2.8l-1.4-1.4a2 2 0 0 0-2.8 0L4 15.8V20Zm2-3.4L16.8 5.8l1.4 1.4L7.4 18H6v-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ooi-identity-card > .ooi-identity-card__share-button:hover,
.ooi-identity-card > .ooi-identity-card__share-button:focus-visible,
.ooi-identity-card > .ooi-identity-card__edit-button:hover,
.ooi-identity-card > .ooi-identity-card__edit-button:focus-visible {
    background: #10233f !important;
    color: #fff !important;
}

@media screen and (max-width: 820px) {
    .ooi-identity-card > .ooi-identity-card__share-button,
    .ooi-identity-card > .ooi-identity-card__edit-button {
        top: 18px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }

    .ooi-identity-card > .ooi-identity-card__share-button {
        right: 18px !important;
    }

    .ooi-identity-card > .ooi-identity-card__edit-button {
        right: 68px !important;
    }

    .ooi-identity-card__content {
        padding-right: 0;
    }
}
