/* Page de connexion Perle Casa Immobilier : plan d'architecte sur papier calque, formulaire en cartouche. */

.pc-login {
    --pc-marine-950: #06152a;
    --pc-marine-900: #0a1f3b;
    --pc-marine-800: #0c2a4d;
    --pc-plan: #1f4f86;
    --pc-or: #c4953a;
    --pc-or-clair: #e2c27a;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 24px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f5f8fb;
    cursor: crosshair;
}

@media (min-width: 1024px) {
    .pc-login {
        grid-template-columns: minmax(0, 1.15fr) minmax(380px, 440px);
        grid-template-rows: minmax(0, 1fr);
        height: 100vh;
        height: 100dvh;
        padding: clamp(18px, 2.5vw, 36px) clamp(28px, 5vw, 80px);
    }
}

.pc-form { cursor: auto; }

/* Tant que les animations n'ont pas démarré, les éléments animés restent masqués. */
.pc-js [data-anim],
.pc-js [data-anim-form],
.pc-js .pc-plan { visibility: hidden; }

/* ---------- Papier millimétré ---------- */

.pc-papier {
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image:
        linear-gradient(rgba(31, 79, 134, .13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 79, 134, .13) 1px, transparent 1px),
        linear-gradient(rgba(31, 79, 134, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 79, 134, .05) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px;
    mask-image: radial-gradient(ellipse 90% 90% at 40% 50%, #000 40%, rgba(0, 0, 0, .35) 100%);
}

.pc-viseur { position: absolute; z-index: -1; inset: 0; pointer-events: none; }

.pc-viseur-x,
.pc-viseur-y { position: absolute; background: rgba(196, 149, 58, .45); }

.pc-viseur-x { top: 0; left: 0; width: 100%; height: 1px; }

.pc-viseur-y { top: 0; left: 0; width: 1px; height: 100%; }

@media (pointer: coarse) {
    .pc-viseur { display: none; }
}

/* ---------- Scène ---------- */

.pc-scene {
    display: none;
    position: relative;
    align-self: stretch;
    min-height: 0;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .pc-scene { display: flex; }
}

.pc-accroche { max-width: 520px; }

.pc-accroche-lieu {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #a37a2c;
}

.pc-accroche-lieu::before { content: ''; width: 26px; height: 1px; background: currentColor; }

.pc-brand-title {
    margin-top: 10px;
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: clamp(30px, 3vw, 44px);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -.02em;
    color: var(--pc-marine-800);
}

.pc-accroche-texte { margin-top: 12px; max-width: 440px; font-size: 15px; line-height: 1.6; color: #4a5a70; }

.pc-plan {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    margin-top: 16px;
    overflow: visible;
}

.pc-mur { fill: none; stroke: var(--pc-marine-800); stroke-width: 7; stroke-linecap: square; }

.pc-baie rect { fill: #f5f8fb; stroke: var(--pc-plan); stroke-width: 1.2; }

.pc-baie path { stroke: var(--pc-plan); stroke-width: 1; }

.pc-porte { fill: none; stroke: var(--pc-plan); stroke-width: 1.2; stroke-dasharray: none; }

.pc-mobilier { fill: none; stroke: rgba(31, 79, 134, .45); stroke-width: 1.1; }

.pc-cote { fill: none; stroke: var(--pc-or); stroke-width: 1; }

.pc-cote-texte { font: 600 11px Inter, sans-serif; fill: #a37a2c; letter-spacing: .04em; }

.pc-piece-nom { font: 600 13px Inter, sans-serif; fill: var(--pc-marine-800); }

.pc-piece-surface { font: 500 11px Inter, sans-serif; fill: var(--pc-plan); opacity: .8; }

.pc-nord circle { fill: #fff; stroke: var(--pc-plan); stroke-width: 1; }

.pc-nord-fleche { fill: var(--pc-or); }

.pc-nord text { font: 700 11px Inter, sans-serif; fill: var(--pc-marine-800); }

/* ---------- Cartouche ---------- */

.pc-form-side { display: flex; justify-content: center; }

.pc-form { width: 100%; max-width: 440px; }

.pc-carte-bord {
    position: relative;
    background: #fff;
    border: 1.5px solid var(--pc-marine-800);
    outline: 1px solid rgba(12, 42, 77, .35);
    outline-offset: 5px;
    box-shadow: 0 40px 80px -40px rgba(6, 21, 42, .35);
}

.pc-cartouche-haut {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--pc-marine-800);
}

.pc-carte-logo { height: 46px; width: auto; padding-right: 16px; border-right: 1px solid rgba(12, 42, 77, .25); }

.pc-cartouche-label,
.pc-cartouche-bas dt {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7a8698;
}

.pc-cartouche-valeur { margin-top: 2px; font-size: 13.5px; font-weight: 600; color: var(--pc-marine-800); }

.pc-carte-form { padding: 22px 24px 0; }

.pc-form-head { margin-bottom: 18px; }

.pc-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: var(--pc-marine-800);
}

.pc-subtitle { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: rgb(var(--gray-500)); }

@media (max-height: 760px) {
    .pc-subtitle { display: none; }
}

.pc-cartouche-bas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--pc-marine-800);
}

.pc-cartouche-bas div { padding: 8px 12px; }

.pc-cartouche-bas div + div { border-left: 1px solid rgba(12, 42, 77, .25); }

.pc-cartouche-bas dd { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--pc-marine-800); font-variant-numeric: tabular-nums; }

/* Champs : étiquette de cartouche, fond calque, trait de plan souligné d'or au focus */

.pc-form .fi-fo-field-wrp-label > span {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #5b6b80;
}

.pc-form .fi-fo-field-wrp-label sup { color: var(--pc-or); }

.pc-form .fi-fo-field-wrp:focus-within .fi-fo-field-wrp-label > span { color: var(--pc-marine-800); }

.pc-form .fi-input-wrp {
    position: relative;
    border-radius: 3px 3px 0 0;
    background: #f5f8fb;
    background-image:
        linear-gradient(rgba(31, 79, 134, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 79, 134, .06) 1px, transparent 1px);
    background-size: 12px 12px;
    box-shadow: inset 0 -1.5px 0 var(--pc-marine-800);
    transition: background-color .2s ease;
}

.pc-form .fi-input-wrp:hover { background-color: #edf2f8; }

html .pc-login .pc-form .fi-input-wrp:focus-within {
    background-color: #fff;
    box-shadow: inset 0 -1.5px 0 var(--pc-marine-800);
}

.pc-form .fi-input-wrp::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5px;
    background: var(--pc-or);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s cubic-bezier(.65, 0, .35, 1);
    pointer-events: none;
}

.pc-form .fi-input-wrp:focus-within::after { transform: scaleX(1); }

/* Repères d'angle, comme des marques de coupe sur un plan */
.pc-form .fi-input-wrp::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(var(--pc-or), var(--pc-or)) left top / 8px 1.5px no-repeat,
        linear-gradient(var(--pc-or), var(--pc-or)) left top / 1.5px 8px no-repeat,
        linear-gradient(var(--pc-or), var(--pc-or)) right top / 8px 1.5px no-repeat,
        linear-gradient(var(--pc-or), var(--pc-or)) right top / 1.5px 8px no-repeat;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.pc-form .fi-input-wrp:focus-within::before { opacity: 1; }

.pc-form .fi-input {
    padding-top: .7rem;
    padding-bottom: .7rem;
    font-size: 15px;
    color: var(--pc-marine-900);
    caret-color: var(--pc-or);
}

.pc-form .fi-input-wrp .fi-input-wrp-suffix { border-left: 1px dashed rgba(12, 42, 77, .2); }

.pc-form .fi-input-wrp .fi-icon-btn { color: var(--pc-plan); }

/* Messages de saisie : annotation reliée au champ par un repère, comme une note sur un plan */

.pc-bulle,
.pc-form .fi-fo-field-wrp-error-message {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 7px 10px 7px 8px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.45;
    color: #9a2a1c;
    background: #fdf3f1;
    border: 1px solid rgba(180, 35, 24, .35);
    border-left: 3px solid #b42318;
    border-radius: 2px;
}

.pc-bulle::before,
.pc-form .fi-fo-field-wrp-error-message::before {
    content: '!';
    flex: none;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #b42318;
}

.pc-bulle::after,
.pc-form .fi-fo-field-wrp-error-message::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 18px;
    width: 10px;
    height: 10px;
    background: #fdf3f1;
    border-top: 1px solid rgba(180, 35, 24, .35);
    border-left: 1px solid rgba(180, 35, 24, .35);
    transform: rotate(45deg);
}

.pc-form .fi-fo-field-wrp.pc-invalide .fi-input-wrp,
.pc-form .fi-fo-field-wrp:has(.fi-fo-field-wrp-error-message) .fi-input-wrp {
    background-color: #fffafa;
    box-shadow: inset 0 -2px 0 #b42318;
}

.pc-form .fi-fo-field-wrp.pc-invalide .fi-fo-field-wrp-label > span,
.pc-form .fi-fo-field-wrp:has(.fi-fo-field-wrp-error-message) .fi-fo-field-wrp-label > span { color: #b42318; }

.pc-form .fi-fo-field-wrp-label:has(.fi-checkbox-input) > span {
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--pc-marine-800);
}

/* Case à cocher animée (motif Uiverse « checkbox ») */

.pc-form .fi-checkbox-input {
    appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 3px;
    border: 1.5px solid rgb(var(--gray-400));
    background: #fff;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, transform .15s ease;
}

.pc-form .fi-checkbox-input::before {
    content: '';
    width: .62rem;
    height: .62rem;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    background: #fff;
    transform: scale(0) rotate(-20deg);
    transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}

.pc-form .fi-checkbox-input:checked { background: var(--pc-marine-800); border-color: var(--pc-marine-800); }

.pc-form .fi-checkbox-input:checked::before { transform: scale(1) rotate(0); }

.pc-form .fi-checkbox-input:active { transform: scale(.9); }

/* Bouton clé : la pastille s'étire sur tout le bouton et la clé tourne (motif Uiverse « expanding icon button ») */

.pc-form .fi-btn {
    --pc-pastille: 42px;
    position: relative;
    overflow: hidden;
    min-height: 52px;
    padding-left: calc(var(--pc-pastille) + 20px);
    padding-right: 20px;
    border: 1.5px solid var(--pc-marine-800);
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--pc-marine-800);
    transition: color .3s ease, letter-spacing .4s ease;
    will-change: transform;
}

.pc-form .fi-btn .fi-btn-label,
.pc-form .fi-btn .fi-btn-icon { position: relative; z-index: 1; }

.pc-form .fi-btn .fi-btn-icon { color: currentColor; }

.pc-form .fi-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: var(--pc-pastille);
    border-radius: 2px;
    background: var(--pc-marine-800);
    transition: width .5s cubic-bezier(.65, 0, .35, 1);
    pointer-events: none;
}

.pc-form .fi-btn::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: var(--pc-pastille);
    background: var(--pc-or);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7.5' cy='12' r='4'/%3E%3Cpath d='M11.5 12H21M18 12v3M21 12v2.5'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7.5' cy='12' r='4'/%3E%3Cpath d='M11.5 12H21M18 12v3M21 12v2.5'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
    transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}

.pc-form .fi-btn:hover:not(:disabled) {
    color: #fff;
    letter-spacing: .22em;
}

.pc-form .fi-btn:hover:not(:disabled)::before { width: calc(100% - 8px); }

.pc-form .fi-btn:hover:not(:disabled)::after { transform: rotate(-90deg); }

.pc-form .fi-btn:active:not(:disabled)::after { transform: rotate(-180deg) scale(.9); }

.pc-form .fi-btn:focus-visible {
    outline: 1.5px dashed var(--pc-or);
    outline-offset: 4px;
}

/* Connexion en cours : la pastille couvre le bouton et la clé tourne dans la serrure */
.pc-form .fi-btn:disabled,
.pc-form .fi-btn.cursor-wait {
    opacity: 1;
    color: #fff;
}

.pc-form .fi-btn:disabled::before,
.pc-form .fi-btn.cursor-wait::before { width: calc(100% - 8px); }

.pc-form .fi-btn:disabled::after,
.pc-form .fi-btn.cursor-wait::after { animation: pc-cle 1s cubic-bezier(.65, 0, .35, 1) infinite; }

@keyframes pc-cle {
    50% { transform: rotate(-90deg); }
}

.pc-form .fi-btn:disabled .fi-btn-icon,
.pc-form .fi-btn.cursor-wait .fi-btn-icon { display: none; }

html .pc-login .pc-form .fi-btn.fi-color-primary.fi-btn {
    background-color: #fff;
    box-shadow: 4px 4px 0 var(--pc-or);
}

/* Aide */

.pc-help {
    display: flex;
    gap: 10px;
    margin: 18px -24px 0;
    padding: 12px 24px;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgb(var(--gray-600));
    background: #f5f8fb;
    border-top: 1px dashed rgba(12, 42, 77, .3);
}

.pc-help span { display: block; margin-top: 2px; color: rgb(var(--gray-400)); }

.pc-help-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--pc-plan); }

@media (max-width: 480px) {
    .pc-carte-form { padding: 20px 18px 0; }
    .pc-help { margin: 16px -18px 0; padding: 12px 18px; }
    .pc-cartouche-bas { grid-template-columns: repeat(2, 1fr); }
    .pc-cartouche-bas div:nth-child(3) { border-left: 0; border-top: 1px solid rgba(12, 42, 77, .25); }
    .pc-cartouche-bas div:nth-child(4) { border-top: 1px solid rgba(12, 42, 77, .25); }
}

@media (prefers-reduced-motion: reduce) {
    .pc-form .fi-btn,
    .pc-form .fi-btn::before,
    .pc-form .fi-btn::after { transition: none; }
    .pc-form .fi-btn:disabled::after,
    .pc-form .fi-btn.cursor-wait::after { animation: none; }
}
