/* =====================================================================
   Design « Carnet de l'immeuble » : pierre de taille, vert de porte cochère,
   ocre, zinc des toits. Titres en Instrument Serif, texte en Lexend (conçue
   pour la facilité de lecture, zéro non barré : montants lisibles). Photos CC0 : img/CREDITS.md.
   Chargé après app.css : surcharge ses jetons et ajoute navigation, héros, plaque.
   ===================================================================== */
@font-face { font-family: 'Lexend'; src: url('../fonts/lexend.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
    --es-primary: #0F766E; --es-porte: #0B4A45; --es-porte-2: #0E5C55;
    --es-ink: #1B2420; --es-muted: #56615C; --es-bg: #F4F0E8; --es-pierre: #EAE3D6; --es-line: #E2DACB;
    --es-accent: #B45309; --es-ocre-clair: #F6E7CF; --es-zinc: #5B6B73;
    --es-serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
    --es-sans: 'Lexend', system-ui, sans-serif;
    --es-ombre: 0 1px 0 rgba(27,36,32,.04), 0 12px 28px -16px rgba(11,74,69,.22);
    --es-ombre-forte: 0 2px 0 rgba(27,36,32,.04), 0 24px 48px -20px rgba(11,74,69,.35);
    --es-nav-l: 244px;
}
html, body { font-family: var(--es-sans); color: var(--es-ink); }
body {
    background-color: var(--es-bg);
    /* grain de pierre, très léger */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.mud-typography, .mud-button-root, .mud-input, .mud-chip { font-family: var(--es-sans) !important; }
::selection { background: #CDE7E2; }

/* Titres : serif éditorial, sans gras */
.es-titre, .es-hero-title, .es-h2, .es-account h1, .es-auth h1, .es-bande-titre, .es-plaque h1 {
    font-family: var(--es-serif); font-weight: 400; letter-spacing: -.01em;
}
.es-titre { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.05; margin: .2rem 0 .7rem; }
.es-h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.1; }
.es-account h1, .es-auth h1 { font-size: clamp(2rem, 5vw, 2.6rem); }
.es-titre em, .es-hero-title em, .es-bande-titre em, .es-account-visuel em { font-style: italic; color: var(--es-primary); }
.es-intro { font-size: 1.08rem; }

/* Barre du haut : verre dépoli sur la pierre */
.es-appbar.mud-appbar { background: rgba(244,240,232,.82) !important; backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid rgba(226,218,203,.9); }
.es-brand-mark { background: var(--es-porte); border-radius: 8px; box-shadow: inset 0 0 0 2px var(--es-porte), inset 0 0 0 3.5px #F4F0E8; font-family: var(--es-serif); font-weight: 400; font-size: 1.05rem; letter-spacing: .04em; }
.es-brand-name { font-family: var(--es-serif); font-weight: 400; font-size: 1.55rem; letter-spacing: -.01em; }

/* Cartes : arrondies, ombre douce, légère élévation au survol */
.es-card, .es-plan, .es-copro-carte, .es-choix-carte, .es-bloc, .es-raccourci, .es-formulaire, .es-recap, .es-fiche, .es-auth, .es-synthese, .es-point, .es-annexe, .es-vide {
    border-radius: 18px; box-shadow: var(--es-ombre); border-color: var(--es-line);
}
.es-copro-carte, .es-raccourci, .es-choix-carte, .es-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.es-copro-carte:hover, .es-raccourci:hover, .es-choix-carte:hover { transform: translateY(-2px); box-shadow: var(--es-ombre-forte); }
.es-copro-carte h2, .es-choix-carte h2 { font-family: var(--es-serif); font-weight: 400; font-size: 1.6rem; line-height: 1.1; }
.es-raccourci strong { font-size: 1.05rem; }
.es-sous-titre, .es-prochaine-label, .es-eyebrow { letter-spacing: .14em; }
.es-chiffre span { letter-spacing: .05em; font-size: .72rem; }
body, .mud-typography-body1 { font-weight: 350; }
strong, b { font-weight: 600; }
/* Lexend est large : les graisses 800 de la feuille de base deviennent 600 */
:is(.es-app, .es-account, .es-section, .es-auth) :is(h2, h3, strong, b, .es-resultat-nom, .es-ligne-chiffre, .es-montant) { font-weight: 600; }
.es-pastille, .es-statut, .es-sous-titre, .es-chiffre span { font-weight: 700; }

/* ---------- Navigation de l'espace connecté ---------- */
.es-nav { position: fixed; z-index: 1200; display: flex; }
.es-nav-lien { display: flex; align-items: center; text-decoration: none; color: var(--es-muted); font-weight: 700; transition: color .15s, background .15s; }
.es-nav-lien:focus-visible { outline: 2px solid var(--es-primary); outline-offset: 2px; }
@media (max-width: 959.98px) {
    .es-nav {
        left: 0; right: 0; bottom: 0; justify-content: space-around; align-items: stretch;
        padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
        background: rgba(251,249,245,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--es-line); box-shadow: 0 -8px 24px -18px rgba(11,74,69,.4);
    }
    .es-nav-retour, .es-nav-lien--large { display: none !important; }
    .es-nav-lien { flex: 1; flex-direction: column; justify-content: center; gap: .15rem; font-size: .68rem; min-width: 0; padding: .1rem 0; }
    .es-nav-lien span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .es-nav-lien .mud-icon-root { width: 3.2rem; height: 1.9rem; padding: .25rem 0; border-radius: 99px; transition: background .2s; }
    .es-nav-lien.active { color: var(--es-porte); }
    .es-nav-lien.active .mud-icon-root { background: #D7EBE6; }
    .es-main--nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (min-width: 960px) {
    .es-nav {
        top: 64px; left: 0; bottom: 0; width: var(--es-nav-l); flex-direction: column; gap: .2rem; padding: 1.4rem .9rem;
        background: var(--es-porte);
        background-image: linear-gradient(180deg, rgba(255,255,255,.04), transparent 40%),
            repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px);
        box-shadow: inset -1px 0 0 rgba(0,0,0,.15);
    }
    .es-nav-retour { display: flex; align-items: center; gap: .4rem; color: rgba(244,240,232,.7); text-decoration: none; font-size: .85rem; font-weight: 700; padding: .3rem .8rem 1rem; margin-bottom: .4rem; border-bottom: 1px solid rgba(255,255,255,.12); }
    .es-nav-retour:hover { color: #fff; }
    .es-nav-lien { gap: .8rem; padding: .7rem .9rem; border-radius: 12px; color: rgba(244,240,232,.82); font-size: .98rem; }
    .es-nav-lien:hover { background: rgba(255,255,255,.08); color: #fff; }
    .es-nav-lien.active { background: var(--es-bg); color: var(--es-porte); box-shadow: 0 8px 20px -12px rgba(0,0,0,.5); }
    .es-main--nav { padding-left: var(--es-nav-l); }
    .es-masque-large { display: none !important; }
}

/* ---------- Vitrine : héros ---------- */
.es-hero {
    background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(244,240,232,0) 70%),
        repeating-linear-gradient(90deg, rgba(11,74,69,.035) 0 1px, transparent 1px 88px);
    border-bottom: 1px solid var(--es-line); overflow: hidden;
}
.es-hero-grille { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .es-hero-grille { grid-template-columns: 1.15fr .85fr; gap: 4rem; } }
.es-hero-title { font-size: clamp(2.9rem, 9vw, 5.4rem); line-height: .98; margin-bottom: 1.4rem; }
.es-hero-title em { display: block; }
.es-hero-preuves { list-style: none; padding: 0; margin: 1.8rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: var(--es-muted); font-size: .92rem; font-weight: 700; }
.es-hero-preuves li { display: flex; align-items: center; gap: .4rem; }
.es-hero-preuves .mud-icon-root { color: var(--es-accent); }
.es-hero-visuel { position: relative; margin: 0; justify-self: center; width: min(100%, 26rem); }
.es-arche { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 50% 50% 18px 18px / 38% 38% 18px 18px;
    box-shadow: 0 0 0 8px var(--es-bg), 0 0 0 9px var(--es-line), var(--es-ombre-forte); background: var(--es-pierre); }
.es-arche img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.04); transition: transform 1.2s ease; }
.es-hero-visuel:hover .es-arche img { transform: scale(1.08); }
.es-arche::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,74,69,0) 55%, rgba(11,74,69,.35)); }
.es-hero-carte { position: absolute; left: -1.2rem; bottom: 2.2rem; display: grid; gap: .1rem; max-width: 15.5rem;
    background: #fff; border-radius: 16px; padding: .9rem 1.1rem; box-shadow: var(--es-ombre-forte); border-left: 4px solid var(--es-accent); }
.es-hero-carte-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--es-accent); }
.es-hero-carte strong { font-family: var(--es-serif); font-weight: 400; font-size: 1.3rem; line-height: 1.1; }
.es-hero-carte span:last-child { color: var(--es-muted); font-size: .85rem; }
@media (max-width: 600px) { .es-hero-carte { left: .4rem; bottom: 1.2rem; } .es-hero-visuel { width: min(88%, 22rem); } }

.es-bande-photo {
    margin-top: 4.5rem; padding: clamp(4rem, 12vw, 7.5rem) 0; color: #fff;
    background: linear-gradient(100deg, rgba(8,48,45,.92) 0%, rgba(11,74,69,.72) 45%, rgba(11,74,69,.15) 100%),
        url('../img/toits-crepuscule-1600.webp') center 40% / cover no-repeat;
}
.es-bande-titre { font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1; margin: 0 0 1.8rem; }
.es-bande-titre em { color: #F6D9A8; }
.es-bande-photo + .es-footer { margin-top: 0; }

/* ---------- Espace connecté : bandeau photo et plaque de rue ---------- */
.es-bandeau { height: clamp(150px, 24vw, 230px); background: url('../img/toits-residence-1600.webp') center 62% / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); mask-image: linear-gradient(180deg, #000 30%, transparent); }
.es-bandeau--escalier { background-image: url('../img/escalier-1600.webp'); background-position: center 50%; }
.es-app--sur-bandeau { position: relative; margin-top: clamp(-96px, -9vw, -60px); }

.es-copro-entete--plaque {
    position: relative; isolation: isolate; overflow: hidden; align-items: flex-end;
    margin: 0 0 1rem; padding: clamp(3.5rem, 12vw, 6.5rem) 1.1rem 1.1rem; border-radius: 22px;
    background: linear-gradient(180deg, rgba(11,74,69,.05), rgba(8,40,37,.55)), url('../img/toits-1600.webp') center 45% / cover no-repeat;
    box-shadow: var(--es-ombre-forte);
}
.es-plaque {
    display: inline-block; max-width: 100%; background: var(--es-porte); color: #fff; border-radius: 10px;
    padding: .55rem 1.1rem .7rem; border: 2px solid #F4F0E8; outline: 3px solid var(--es-porte);
    box-shadow: 0 14px 30px -12px rgba(0,0,0,.55);
}
.es-plaque h1 { font-size: clamp(1.7rem, 5.5vw, 2.4rem); line-height: 1.05; margin: 0; color: #fff; }
.es-plaque p { margin: .2rem 0 0; color: rgba(244,240,232,.85); font-size: .9rem; }
.es-copro-entete--plaque .es-puces .mud-chip { background: rgba(251,249,245,.94) !important; }

/* ---------- Assistant : fiche pas encore relue ---------- */
.es-brouillon { display: flex; gap: .7rem; align-items: flex-start; margin: 0 0 1rem; padding: .8rem 1rem;
    background: var(--es-ocre-clair); color: #7A3F06; border-left: 4px solid var(--es-accent); border-radius: 0 12px 12px 0; }
.es-brouillon .mud-icon-root { color: var(--es-accent); flex-shrink: 0; }
.es-brouillon div { display: grid; gap: .15rem; line-height: 1.45; font-size: .92rem; }
.es-copro-carte .es-statut--attente { display: inline-block; margin-top: .35rem; }

/* ---------- Pages de compte : la porte d'entrée ---------- */
.es-account--porte { max-width: 1120px; }
.es-account-visuel { display: none; margin: 0; }
@media (min-width: 960px) {
    .es-account--porte { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 4rem; align-items: center; min-height: calc(100vh - 64px); padding-top: 1rem; }
    .es-account-visuel { display: grid; gap: 1.4rem; justify-items: center; }
    .es-arche--porte { width: min(100%, 24rem); }
    .es-account-visuel figcaption { font-family: var(--es-serif); font-size: 2.2rem; line-height: 1.05; text-align: center; }
    .es-account-visuel figcaption em { display: block; }
}

/* ---------- Entrée en scène : apparition échelonnée ---------- */
@keyframes es-monte { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.es-app > *, .es-hero-texte > *, .es-hero-visuel, .es-liste > *, .es-account-visuel { animation: es-monte .55s cubic-bezier(.2,.7,.2,1) both; }
.es-app > :nth-child(2), .es-hero-texte > :nth-child(2), .es-liste > :nth-child(2) { animation-delay: .06s; }
.es-app > :nth-child(3), .es-hero-texte > :nth-child(3), .es-liste > :nth-child(3) { animation-delay: .12s; }
.es-app > :nth-child(4), .es-hero-texte > :nth-child(4), .es-liste > :nth-child(4) { animation-delay: .18s; }
.es-app > :nth-child(5), .es-hero-texte > :nth-child(5), .es-liste > :nth-child(5) { animation-delay: .24s; }
.es-app > :nth-child(n+6), .es-liste > :nth-child(n+6) { animation-delay: .3s; }
.es-hero-visuel { animation-delay: .2s; animation-duration: .9s; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
