/* ═══════════════════════════════════════════════════════════════════════════
   NEXUS STUDENT — Espace locataire (PAGE DE TEST) — thème "Herbier"
   Vert / bio / nature — hiérarchie claire + vivant et animé
   ═══════════════════════════════════════════════════════════════════════════ */

.tenant-body {
  --moss: #3f5c35;
  --moss-deep: #2c4326;
  --sage: #7c9a6a;
  --sage-light: #e4ecdc;
  --linen: #f6f1e4;
  --card: #ffffff;
  --bark: #6b5d48;
  --ink: #2e2a20;
  --terracotta: #c1652f;
  --terracotta-light: #f5ddd0;
  --water: #2f6f8f;
  --water-light: #dcebf0;
  --amber: #c98a2e;
  --amber-light: #f3e6cd;
  --border-soft: rgba(63,92,53,0.18);
  --shadow-card: 0 4px 16px rgba(44,67,38,0.08);
  --shadow-card-hover: 0 16px 36px rgba(44,67,38,0.16), 0 4px 12px rgba(124,154,106,0.18);
  background: var(--linen);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(124,154,106,0.10), transparent 45%),
    radial-gradient(circle at 100% 25%, rgba(124,154,106,0.08), transparent 40%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  position: relative;
}

/* ─── Décor ambiant : feuilles flottantes, très discrètes ──────────────────── */
.herbier-atmosphere { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.herbier-leaf-wrap { position: absolute; will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .herbier-leaf-wrap { transition: transform 0.9s cubic-bezier(.22,1,.36,1); }
}
.herbier-leaf { display: block; opacity: 0.45; color: var(--sage); }
@media (prefers-reduced-motion: no-preference) {
  .herbier-leaf { animation: leafDrift var(--dur, 16s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
}
@keyframes leafDrift {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-18px) rotate(calc(var(--r, 0deg) + 10deg)); }
}

/* Poussière de pollen ambiante : minuscules points qui montent et s'effacent */
.herbier-mote { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--amber); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .herbier-mote { animation: moteFloat var(--mdur, 12s) ease-in-out infinite; animation-delay: var(--mdelay, 0s); }
}
@keyframes moteFloat {
  0%   { transform: translate(0, 0); opacity: 0; }
  15%  { opacity: 0.55; }
  50%  { transform: translate(10px, -80px); opacity: 0.7; }
  85%  { opacity: 0.25; }
  100% { transform: translate(-8px, -160px); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Écran de connexion — "portail" premium, noir/or, indépendant du thème
   Herbier utilisé après connexion. Toutes les règles sont scopées sous
   .tenant-login-wrap pour ne jamais déteindre sur le reste de l'app.
   ═══════════════════════════════════════════════════════════════════════════ */
.tenant-login-wrap {
  --portal-black: #05070a;
  --portal-black-2: #0c1016;
  --portal-gold: #c89b5c;
  --portal-gold-bright: #f0d19a;
  --portal-white: #f5f1e8;
  --portal-glass: rgba(255,255,255,0.055);
  --portal-glass-border: rgba(255,255,255,0.13);

  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; z-index: 1; padding: 2.5rem 1.5rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 38%, rgba(200,155,92,0.14) 0%, transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 30%, #12161d 0%, var(--portal-black-2) 45%, var(--portal-black) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-grid {
  position: absolute; inset: -10%; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 55% 55% at 50% 42%, black 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 55% 55% at 50% 42%, black 0%, transparent 72%);
}
@media (prefers-reduced-motion: no-preference) {
  .portal-grid { animation: portalGridDrift 50s linear infinite; }
}
@keyframes portalGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 46px 46px, 46px 46px; } }

.portal-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.portal-line { stroke-dasharray: 500; stroke-dashoffset: 500; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .portal-line {
    animation: portalLineDraw 1.8s cubic-bezier(.22,1,.36,1) forwards, portalLinePulse 4.5s ease-in-out 2s infinite;
    animation-delay: var(--pl-delay, 0s), calc(var(--pl-delay, 0s) + 1.8s);
  }
}
@media (prefers-reduced-motion: reduce) { .portal-line { opacity: 0.4; stroke-dashoffset: 0; } }
@keyframes portalLineDraw { to { stroke-dashoffset: 0; opacity: 0.6; } }
@keyframes portalLinePulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.65; } }

.portal-particle {
  position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%;
  background: var(--portal-gold-bright); opacity: 0; pointer-events: none;
  box-shadow: 0 0 7px 1.5px rgba(240,209,154,0.65);
}
@media (prefers-reduced-motion: no-preference) {
  .portal-particle { animation: portalParticleFloat var(--dur, 11s) ease-in-out infinite; animation-delay: var(--d, 0s); }
}
@keyframes portalParticleFloat {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: 0.8; }
  50%  { transform: translateY(-46px); opacity: 1; }
  88%  { opacity: 0.2; }
  100% { transform: translateY(-96px); opacity: 0; }
}

.portal-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 100%; }

.portal-logo-wrap { position: relative; width: 168px; height: 168px; margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: center; }
.portal-halo {
  position: absolute; inset: -42px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,155,92,0.38) 0%, rgba(200,155,92,0.10) 45%, transparent 72%);
  filter: blur(1px);
}
.portal-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(200,155,92,0.32); }
.portal-ring.r1 { inset: -16px; border-style: dashed; }
.portal-ring.r2 { inset: -34px; border-color: rgba(255,255,255,0.09); }
@media (prefers-reduced-motion: no-preference) {
  .portal-halo { animation: portalHaloBreathe 4s ease-in-out infinite; }
  .portal-ring.r1 { animation: portalRingSpin 20s linear infinite; }
  .portal-ring.r2 { animation: portalRingSpin 30s linear infinite reverse; }
}
@keyframes portalHaloBreathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.14); opacity: 1; } }
@keyframes portalRingSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.portal-logo { position: relative; width: 92px; height: 92px; filter: drop-shadow(0 0 16px rgba(200,155,92,0.5)); }
@media (prefers-reduced-motion: no-preference) {
  .portal-logo { animation: portalLogoPulse 5s ease-in-out infinite; }
}
@keyframes portalLogoPulse {
  0%, 100% { filter: drop-shadow(0 0 13px rgba(200,155,92,0.42)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 24px rgba(200,155,92,0.72)); transform: scale(1.025); }
}

.portal-brand {
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: 0.16em; font-size: clamp(1.3rem, 4vw, 1.6rem);
  color: var(--portal-white); text-align: center; margin-bottom: 0.4rem;
}
.portal-brand span { font-weight: 300; color: var(--portal-gold-bright); }
.portal-tagline {
  text-align: center; color: rgba(245,241,232,0.5); font-size: 0.74rem; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 2.4rem;
}

.portal-card {
  width: 100%; max-width: 380px; text-align: center; position: relative;
  background: var(--portal-glass);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--portal-glass-border); border-radius: 20px;
  padding: clamp(1.8rem, 5vw, 2.4rem);
  box-shadow: 0 26px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07);
  transition: transform 0.4s ease;
}
.portal-card h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: 1.35rem; color: var(--portal-white); margin-bottom: 0.5rem; }
.portal-card p { color: rgba(245,241,232,0.55); font-size: 0.85rem; margin-bottom: 1.7rem; line-height: 1.5; }
.portal-card form { text-align: left; }
.portal-card .form-group label {
  color: rgba(245,241,232,0.65); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
}
.portal-card .form-group input {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); color: var(--portal-white);
  border-radius: 10px; padding: 0.85rem 1rem; font-size: 1.1rem; letter-spacing: 0.15em; margin-top: 0.5rem;
  text-align: center; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.portal-card .form-group input::placeholder { color: rgba(245,241,232,0.25); letter-spacing: 0.3em; }
.portal-card .form-group input:focus {
  outline: none; border-color: var(--portal-gold) !important; background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(200,155,92,0.22) !important;
}
.portal-btn {
  width: 100%; margin-top: 1.4rem; padding: 0.9rem 1.2rem; border: none; border-radius: 10px; cursor: pointer;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.03em; color: #211a0c;
  background: linear-gradient(135deg, var(--portal-gold-bright), var(--portal-gold));
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 26px rgba(200,155,92,0.35);
}
.portal-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(200,155,92,0.5); }
.portal-btn:active { transform: translateY(0); }
.portal-btn span { position: relative; z-index: 1; }
.portal-btn::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: skewX(-20deg); transition: left 0.65s ease;
}
.portal-btn:hover::after { left: 130%; }
.portal-back-link { display: inline-block; margin-top: 1.5rem; font-size: 0.8rem; color: rgba(245,241,232,0.45); text-decoration: none; transition: color 0.2s; }
.portal-back-link:hover { color: var(--portal-gold-bright); }

.tenant-login-wrap .login-msg.error { color: #f5a3a3; }
.tenant-login-wrap .login-msg.info { color: rgba(245,241,232,0.6); }

/* ─── Séquence d'entrée : le système "démarre" progressivement ───────────── */
@media (prefers-reduced-motion: no-preference) {
  .portal-logo-wrap { animation: portalRevealLogo 1s cubic-bezier(.2,1,.3,1) 0.1s both; }
  .portal-brand { animation: portalRevealUp 0.8s ease 0.55s both; }
  .portal-tagline { animation: portalRevealUp 0.8s ease 0.7s both; }
  .portal-card { animation: portalRevealUp 0.9s cubic-bezier(.22,1,.36,1) 0.9s both; }
  .portal-grid, .portal-particle { animation-fill-mode: both; }
}
@keyframes portalRevealUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes portalRevealLogo { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

/* ═══════════════════════════════════════════════════════════════════════════
   Séquence de déverrouillage — jouée après un code d'accès valide, avant le
   rechargement vers le tableau de bord. Prototype validé, lecture à x0.4
   (durées x2.5 par rapport au prototype d'origine).
   ═══════════════════════════════════════════════════════════════════════════ */
.unlock-overlay {
  position: fixed; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(200,155,92,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 40%, #12161d 0%, var(--portal-black-2) 45%, var(--portal-black) 100%);
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.unlock-overlay.is-active { opacity: 1; pointer-events: auto; }

.u-grid {
  position: absolute; inset: -10%; opacity: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 55% 55% at 50% 50%, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 55% 55% at 50% 50%, black 0%, transparent 70%);
}
.u-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.u-line { stroke-dasharray: 480; stroke-dashoffset: 480; opacity: 0; }
.u-particle {
  position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%;
  background: var(--portal-gold-bright); opacity: 0;
  box-shadow: 0 0 7px 1.5px rgba(240,209,154,0.6);
}
.u-core { position: relative; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; }
.u-halo {
  position: absolute; inset: -30px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(200,155,92,0.4) 0%, rgba(200,155,92,0.08) 45%, transparent 72%);
}
.u-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(200,155,92,0.28); opacity: 0; }
.u-ring.r1 { inset: 6px; border-style: dashed; }
.u-ring.r2 { inset: -14px; border-color: rgba(255,255,255,0.08); }
.u-scan { position: absolute; inset: -2px; opacity: 0; }
.u-scan svg { width: 100%; height: 100%; }
.u-progress { position: absolute; inset: -22px; opacity: 0; }
.u-progress svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.u-progress-track { stroke: rgba(255,255,255,0.07); }
.u-progress-bar { stroke: url(#uProgGrad); stroke-linecap: round; stroke-dasharray: 446; stroke-dashoffset: 446; }
.u-shock { position: absolute; inset: -10px; border-radius: 50%; border: 1.5px solid var(--portal-gold-bright); opacity: 0; transform: scale(0.7); }
.u-logo-svg {
  position: relative; width: 92px; height: 92px;
  transform: translate(var(--fx, 0px), var(--fy, 0px)) scale(var(--fs, 1));
  filter: drop-shadow(0 0 16px rgba(200,155,92,0.5));
}
.u-pulse { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(200,155,92,0.5); opacity: 0; }
.u-meta { position: absolute; left: 0; right: 0; top: calc(50% + 110px); display: flex; flex-direction: column; align-items: center; }
.u-status { margin-top: 2.1rem; height: 1.1rem; position: relative; width: 280px; text-align: center; }
.u-status span {
  position: absolute; left: 0; right: 0; top: 0;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(200,155,92,0.85);
  opacity: 0;
}
.u-status span.final { color: #fff4d9; font-weight: 600; }
.u-brand-mark {
  margin-top: 0.9rem; font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  letter-spacing: 0.18em; font-size: 1rem; color: rgba(245,241,232,0.35); opacity: 0;
}
.u-brand-mark span { font-weight: 300; color: rgba(200,155,92,0.5); }
.u-flashlight {
  position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, #fff4d9, transparent 55%);
  opacity: 0; mix-blend-mode: screen; pointer-events: none;
}
.u-exit { position: absolute; inset: 0; background: var(--linen, #f6f1e4); opacity: 0; pointer-events: none; }

.unlock-overlay.is-active .u-grid { animation: uFadeTo028 2s ease forwards; }
.unlock-overlay.is-active .u-particle { animation: uParticleDrift var(--dur,9s) ease-in-out infinite; animation-delay: var(--d,0s); }
.unlock-overlay.is-active .u-halo { animation: uHaloIn 2.5s ease forwards, uHaloBreathe 9s ease-in-out 2.5s infinite; }
.unlock-overlay.is-active .u-ring.r1 { animation: uRingIn 1.75s ease .375s forwards, uRingSpin 40s linear .375s infinite; }
.unlock-overlay.is-active .u-ring.r2 { animation: uRingIn 1.75s ease .75s forwards, uRingSpin 60s linear .75s infinite reverse; }
.unlock-overlay.is-active .u-logo-svg { animation: uLogoGlide 1.6s cubic-bezier(.65,0,.35,1) .35s both, uLogoUnlockPulse .875s ease 7.625s; }
.unlock-overlay.is-active .u-scan { animation: uFadeTo1 .75s ease 2.25s forwards, uFadeTo0 1s ease 5.125s forwards; }
.unlock-overlay.is-active .u-scan-arc { animation: uScanSweep 3.75s cubic-bezier(.3,.9,.4,1) 2.375s 1 forwards; }
.unlock-overlay.is-active .u-line { animation: uLineDraw 2.5s cubic-bezier(.25,1,.3,1) forwards; }
.unlock-overlay.is-active .u-line:nth-of-type(1) { animation-delay: 2.625s; }
.unlock-overlay.is-active .u-line:nth-of-type(2) { animation-delay: 2.875s; }
.unlock-overlay.is-active .u-line:nth-of-type(3) { animation-delay: 3.125s; }
.unlock-overlay.is-active .u-line:nth-of-type(4) { animation-delay: 3.375s; }
.unlock-overlay.is-active .u-progress { animation: uFadeTo1 .75s ease 4.625s forwards; }
.unlock-overlay.is-active .u-progress-bar { animation: uProgressFill 2.75s cubic-bezier(.4,0,.2,1) 4.75s forwards; }
.unlock-overlay.is-active .u-pulse.p1 { animation: uPulseOut 2.5s ease 5.875s 1; }
.unlock-overlay.is-active .u-pulse.p2 { animation: uPulseOut 2.5s ease 6.55s 1; }
.unlock-overlay.is-active .u-shock { animation: uShockBurst 1.5s cubic-bezier(.2,.7,.3,1) 7.55s forwards; }
.unlock-overlay.is-active .u-flashlight { animation: uFlashPop 1.25s ease 7.5s forwards; }
.unlock-overlay.is-active .u-status span { animation: uStatusPhase .7s ease forwards; }
.unlock-overlay.is-active .u-status span:nth-child(1) { animation-delay: 2.375s; animation-duration: 1.25s; }
.unlock-overlay.is-active .u-status span:nth-child(2) { animation-delay: 3.625s; animation-duration: 1.5s; }
.unlock-overlay.is-active .u-status span:nth-child(3) { animation-delay: 5.125s; animation-duration: 1.25s; }
.unlock-overlay.is-active .u-status span:nth-child(4) { animation-delay: 6.375s; animation-duration: 1.125s; }
.unlock-overlay.is-active .u-status span:nth-child(5) { animation: uStatusFinal 1.5s ease 7.5s forwards; }
.unlock-overlay.is-active .u-brand-mark { animation: uFadeTo035 2s ease 1.25s forwards; }
.unlock-overlay.is-active .u-exit { animation: uFadeTo1 .6s ease 8.6s forwards; }

@keyframes uFadeTo028 { to { opacity: 0.28; } }
@keyframes uFadeTo035 { to { opacity: 0.35; } }
@keyframes uFadeTo1 { to { opacity: 1; } }
@keyframes uFadeTo0 { to { opacity: 0; } }
@keyframes uParticleDrift {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: .8; }
  50% { transform: translateY(-42px); opacity: 1; }
  88% { opacity: .2; }
  100% { transform: translateY(-88px); opacity: 0; }
}
@keyframes uHaloIn { to { opacity: 0.9; } }
@keyframes uHaloBreathe { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes uRingIn { to { opacity: 1; } }
@keyframes uRingSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes uLogoGlide {
  from { transform: translate(var(--fx, 0px), var(--fy, 0px)) scale(var(--fs, 1)); }
  to { transform: translate(0, 0) scale(1); }
}
@keyframes uLogoUnlockPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(200,155,92,0.5)); }
  45% { transform: scale(1.09); filter: drop-shadow(0 0 34px rgba(255,244,217,0.95)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(240,209,154,0.7)); }
}
@keyframes uScanSweep { from { transform: rotate(0deg); } to { transform: rotate(720deg); } }
@keyframes uLineDraw { to { stroke-dashoffset: 0; opacity: .55; } }
@keyframes uProgressFill { to { stroke-dashoffset: 0; } }
@keyframes uPulseOut {
  0% { opacity: .55; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.9); }
}
@keyframes uShockBurst {
  0% { opacity: 1; transform: scale(0.75); border-width: 2px; }
  100% { opacity: 0; transform: scale(2.4); border-width: 0.5px; }
}
@keyframes uFlashPop { 0% { opacity: 0; } 30% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes uStatusPhase {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; transform: translateY(0); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes uStatusFinal {
  0% { opacity: 0; transform: translateY(4px) scale(0.96); letter-spacing: 0.3em; }
  30% { opacity: 1; transform: translateY(0) scale(1); letter-spacing: 0.24em; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .unlock-overlay { transition: opacity 0.2s ease; }
  .unlock-overlay.is-active .u-logo-svg { animation: uFadeTo1 .3s ease forwards; }
  .unlock-overlay.is-active .u-halo, .unlock-overlay.is-active .u-ring, .unlock-overlay.is-active .u-scan,
  .unlock-overlay.is-active .u-line, .unlock-overlay.is-active .u-progress, .unlock-overlay.is-active .u-pulse,
  .unlock-overlay.is-active .u-shock, .unlock-overlay.is-active .u-flashlight, .unlock-overlay.is-active .u-particle,
  .unlock-overlay.is-active .u-grid, .unlock-overlay.is-active .u-brand-mark, .unlock-overlay.is-active .u-exit { animation: none !important; opacity: 0 !important; }
  .unlock-overlay.is-active .u-status span:nth-child(5) { animation: uFadeTo1 .3s ease forwards !important; opacity: 1 !important; }
}

@media (max-width: 520px) {
  .u-core { width: 176px; height: 176px; }
  .u-meta { top: calc(50% + 88px); }
  .u-status { width: 240px; }
}

@media (max-width: 480px) {
  .portal-logo-wrap { width: 132px; height: 132px; }
  .portal-logo, .u-logo-svg { width: 76px; height: 76px; }
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.tenant-header { background: var(--moss-deep); padding: 1.2rem 0; position: relative; z-index: 2; }
.tenant-header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.tenant-header-inner .brand { justify-self: start; }
.tenant-header-inner .btn-ghost { justify-self: end; }
.tenant-header .brand-name { font-family: 'Fraunces', Georgia, serif; font-size: 1.25rem; color: #fff; }
.tenant-header .btn-ghost { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.22); }
.tenant-header .btn-ghost:hover { background: rgba(255,255,255,0.22); }
.tenant-header-codes { display: flex; justify-content: center; gap: 1.4rem; }
.header-code-item { font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: 0.03em; white-space: nowrap; }

/* ─── Corps ──────────────────────────────────────────────────────────────── */
.tenant-main { padding: 3rem 0 4.5rem; position: relative; z-index: 1; }
.tenant-greeting { margin-bottom: 1.4rem; }
.tenant-greeting h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 0.3rem; color: var(--moss-deep); }
.tenant-greeting p { color: var(--bark); font-size: 0.95rem; }

/* Diviseur "lierre" — la tige pousse de gauche à droite, les feuilles se déploient
   une à une à mesure qu'elle avance, puis tout se rétracte dans le même sens et
   recommence. La longueur réelle du tracé est mesurée en JS (--vine-len). */
.herbier-vine-divider { display: block; width: 100%; max-width: 240px; height: 26px; margin: 0 0 2rem; opacity: 0.9; overflow: visible; }
.herbier-vine-divider .vine-stem { stroke-dasharray: var(--vine-len, 300); stroke-dashoffset: var(--vine-len, 300); }
.herbier-vine-divider .vine-leaf { opacity: 0; transform-origin: center; transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .herbier-vine-divider .vine-stem { animation: vineGrowLoop 7s cubic-bezier(.5,.05,.5,.95) infinite; }
  .herbier-vine-divider .vine-leaf { animation: vineLeafPop 7s ease infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .herbier-vine-divider .vine-stem { stroke-dashoffset: 0; }
  .herbier-vine-divider .vine-leaf { opacity: 1; }
}
@keyframes vineGrowLoop {
  0%   { stroke-dashoffset: var(--vine-len, 300); }
  38%  { stroke-dashoffset: 0; }
  58%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: calc(var(--vine-len, 300) * -1); }
}
@keyframes vineLeafPop {
  0%, 26%   { opacity: 0; transform: scale(0.25); }
  36%, 56%  { opacity: 1; transform: scale(1); }
  68%, 100% { opacity: 0; transform: scale(0.25); }
}

/* Rappel / bandeaux — bordure gauche marquée pour bien les distinguer du reste */
.tenant-reminder-banner {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--sage-light); border: 1.5px solid var(--sage); border-left: 6px solid var(--moss);
  border-radius: 14px; padding: 1.3rem 1.5rem; margin-bottom: 1.6rem; box-shadow: var(--shadow-card);
}
.tenant-lease-end-banner { background: var(--terracotta-light); border-color: var(--terracotta); border-left-color: var(--terracotta); }
.tenant-lease-end-banner strong { color: #8a3f1c; }
.tenant-reminder-banner .reminder-icon { font-size: 1.7rem; flex-shrink: 0; }
.tenant-reminder-banner strong { display: block; color: var(--moss-deep); margin-bottom: 0.3rem; font-size: 1rem; font-family: 'Fraunces', Georgia, serif; }
.tenant-reminder-banner p { color: var(--ink); font-size: 0.93rem; white-space: pre-wrap; line-height: 1.5; }

/* ─── Plan d'appurement — alerte mise en avant, situation à régulariser ──── */
.tenant-plan-alert { margin-bottom: 2.2rem; }
.plan-alert-card {
  background: linear-gradient(135deg, #fdeceb 0%, #fde2e2 100%);
  border: 2px solid #c0392b;
  border-radius: 18px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 8px 30px rgba(192,57,43,0.18);
  position: relative;
  overflow: hidden;
}
.plan-alert-card + .plan-alert-card { margin-top: 1.2rem; }
.plan-alert-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(45deg, #c0392b, #c0392b 10px, #e67e22 10px, #e67e22 20px);
}
.plan-alert-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.plan-alert-siren { font-size: 2.2rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .plan-alert-siren { animation: planAlertPulse 1.6s ease-in-out infinite; }
}
@keyframes planAlertPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.plan-alert-head h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.22rem; color: #7d1e15; margin: 0 0 0.3rem; line-height: 1.3; }
.plan-alert-reason { font-size: 0.9rem; color: #8a3229; margin: 0; }

.plan-alert-progress { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.85rem; color: #7d1e15; font-weight: 600; margin-bottom: 0.9rem; padding-bottom: 0.9rem; border-bottom: 1px dashed rgba(192,57,43,0.3); }
.plan-alert-total strong { font-size: 1.02rem; }

.plan-alert-next { background: #fff; border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 1.1rem; font-size: 0.92rem; color: #333; border: 1px solid rgba(192,57,43,0.25); }
.plan-alert-next.is-overdue { background: #c0392b; color: #fff; border-color: #7d1e15; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .plan-alert-next.is-overdue { animation: planAlertBlink 1.4s ease-in-out infinite; }
}
@keyframes planAlertBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.75; } }

.plan-alert-installments { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.plan-alert-inst { display: flex; flex-direction: column; gap: 0.15rem; background: #fff; border-radius: 10px; padding: 0.5rem 0.7rem; font-size: 0.75rem; min-width: 90px; border-left: 3px solid #ccc; }
.plan-alert-inst-num { font-weight: 700; color: #7d1e15; }
.plan-alert-inst.plan-alert-inst-paid    { border-left-color: #2e9e5b; opacity: 0.75; }
.plan-alert-inst.plan-alert-inst-pending { border-left-color: #d68910; }
.plan-alert-inst.plan-alert-inst-partial { border-left-color: #d68910; }
.plan-alert-inst.plan-alert-inst-missed  { border-left-color: #c0392b; background: #fdeceb; }
.plan-alert-inst-status { font-weight: 600; }

.plan-alert-events { background: #fff; border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 1.1rem; }
.plan-alert-event { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.4rem 0; border-bottom: 1px solid #f0e0df; font-size: 0.8rem; }
.plan-alert-event:last-child { border-bottom: none; }
.plan-alert-event-date { display: block; font-size: 0.68rem; color: #999; margin-top: 0.1rem; }
.plan-alert-event-warn strong   { color: #d68910; }
.plan-alert-event-danger strong { color: #c0392b; }
.plan-alert-event-ok strong     { color: #2e9e5b; }

.plan-alert-warning { font-size: 0.82rem; color: #7d1e15; font-weight: 600; margin: 0; line-height: 1.5; }

@media (max-width: 640px) {
  .plan-alert-card { padding: 1.2rem 1.1rem; }
  .plan-alert-installments { gap: 0.4rem; }
  .plan-alert-inst { min-width: 78px; }
}

/* Cartes principales — bordure + liseré coloré en haut pour bien se détacher du fond */
.tenant-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-bottom: 2.6rem; }
.tenant-card {
  --accent: var(--sage);
  background: var(--card); border: 1.5px solid var(--border-soft); border-radius: 16px; padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-card); transition: transform 0.25s ease, box-shadow 0.25s ease; position: relative; overflow: hidden;
}
.tenant-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent); }
.tenant-card.card-status-ok { --accent: var(--sage); }
.tenant-card.card-status-warn { --accent: var(--amber); }
.tenant-card.card-status-bad { --accent: var(--terracotta); }
.tenant-card::after {
  content: ''; position: absolute; top: 0; left: 0; height: 4px; width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95), transparent);
  transform: translateX(-140%); pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .tenant-card::after { animation: cardSheen 6.5s linear infinite; }
}
@keyframes cardSheen {
  from { transform: translateX(-140%); }
  to   { transform: translateX(400%); }
}
.tenant-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.tenant-card h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: 1.05rem; margin-bottom: 0.9rem; color: var(--moss-deep); display: flex; align-items: center; gap: 0.5rem; }
.tenant-card-detail { font-size: 0.88rem; color: var(--bark); margin-top: 0.8rem; white-space: pre-wrap; line-height: 1.55; }
.tenant-card-detail strong { color: var(--ink); }

.tenant-status-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em; }
.tenant-status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .tenant-status-badge::before { animation: badgeBreathe 2.6s ease-in-out infinite; }
}
@keyframes badgeBreathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
.tenant-status-badge.status-ok { background: var(--sage-light); color: var(--moss); }
.tenant-status-badge.status-bad { background: var(--terracotta-light); color: var(--terracotta); }
.tenant-status-badge.status-neutral { background: #ece7d8; color: var(--bark); }

/* Sections génériques */
.tenant-section { margin-bottom: 2.6rem; padding: 0; position: relative; }
.tenant-section h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: 1.5rem; margin-bottom: 1.1rem; color: var(--moss-deep); display: flex; align-items: center; gap: 0.6rem; }
.tenant-section h2::before {
  content: ''; order: 1; width: 13px; height: 13px; flex-shrink: 0;
  background-color: var(--sage);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M2 24C2 12 12 2 24 2C24 14 14 24 2 24Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M2 24C2 12 12 2 24 2C24 14 14 24 2 24Z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.tenant-section h2::after { content: ''; order: 2; flex: 1; height: 1px; background: linear-gradient(to right, var(--sage), transparent); }

.tenant-rent-months-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.7rem; }
.tenant-rent-month { border-radius: 12px; padding: 0.7rem 0.6rem; text-align: center; box-shadow: var(--shadow-card); }
.tenant-rent-month .rm-month-label { display: block; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; }
.tenant-rent-month .rm-month-status { display: block; font-size: 0.72rem; opacity: 0.9; }
.tenant-rent-month .rm-month-amount { display: block; font-size: 0.78rem; font-weight: 700; margin-top: 0.3rem; }
.tenant-rent-month.rm-none { background: #ece7d8; color: var(--bark); }
.tenant-rent-month.rm-ok { background: var(--sage-light); color: var(--moss); }
.tenant-rent-month.rm-retard { background: #fbf3c7; color: #8a7207; }
.tenant-rent-month.rm-partial { background: var(--amber-light); color: #8a5f13; }
.tenant-rent-month.rm-late { background: var(--terracotta-light); color: var(--terracotta); }

.year-nav-tenant { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.1rem; }
.year-nav-tenant .year-nav-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--sage-light); color: var(--moss); text-decoration: none; font-size: 0.95rem; transition: background 0.15s, transform 0.15s; }
.year-nav-tenant a.year-nav-btn:hover { background: var(--sage); transform: scale(1.06); }
.year-nav-tenant .year-nav-btn.is-disabled { opacity: 0.3; background: #ece7d8; color: var(--bark); cursor: not-allowed; }
.year-nav-tenant .year-nav-label { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.05rem; min-width: 120px; text-align: center; }

.tenant-event-row.is-settled { opacity: 0.55; }
.settled-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; color: var(--moss); background: var(--sage-light); padding: 0.15rem 0.45rem; border-radius: 0.25rem; margin-left: 0.4rem; letter-spacing: 0.3px; vertical-align: middle; }

.rent-arrears-summary {
  margin-top: 0.9rem; padding: 0.75rem 0.9rem; border-radius: 10px;
  background: var(--terracotta-light); border: 1px solid rgba(193,101,47,0.28);
}
.arrears-months {
  display: flex; align-items: flex-start; gap: 0.45rem; font-size: 0.8rem; color: var(--terracotta);
  line-height: 1.4; margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px dashed rgba(193,101,47,0.3);
}
.arrears-months .arrears-icon { flex-shrink: 0; line-height: 1.4; }
.arrears-total { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; font-size: 0.82rem; color: var(--terracotta); }
.arrears-total strong { font-size: 1.05rem; font-weight: 700; color: #8a3f1c; white-space: nowrap; }

@keyframes statusBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.tenant-status-badge.is-blinking { animation: statusBlink 1.4s ease-in-out infinite; }
.tenant-status-badge.status-bad.is-blinking {
  background: #dc2626; color: #fff;
  animation: statusBlinkUrgent 1.2s ease-in-out infinite;
}
.tenant-status-badge.status-bad.is-blinking::before { background: #fff; }
@keyframes statusBlinkUrgent {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220,38,38,0.55); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}
.tenant-urgent-section h2::before { background-color: rgba(255,255,255,0.55); }
@media (prefers-reduced-motion: no-preference) {
  .tenant-section h2::before { animation: leafSway 4.5s ease-in-out infinite; }
}
@keyframes leafSway {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

/* Chiffres qui montent en défilant (loyer, sous-totaux, total général) */
.tt-count { font-variant-numeric: tabular-nums; }

.tenant-events-list { display: flex; flex-direction: column; gap: 0.8rem; }
.tenant-event-row {
  display: flex; gap: 1.1rem; background: var(--card); border: 1.5px solid var(--border-soft); border-radius: 14px;
  padding: 1rem 1.2rem; box-shadow: var(--shadow-card); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tenant-event-row:hover { transform: translateX(4px); box-shadow: var(--shadow-card-hover); }
.tenant-event-row.is-past { opacity: 0.55; filter: grayscale(0.6); }
.tenant-event-row.is-past:hover { transform: none; }
.tenant-event-info strong { display: block; font-size: 0.95rem; color: var(--moss-deep); font-family: 'Fraunces', Georgia, serif; }
.tenant-event-info span { font-size: 0.8rem; color: var(--bark); }
.tenant-event-info p { font-size: 0.86rem; color: var(--ink); margin-top: 0.4rem; line-height: 1.5; }

.tenant-message-reply { background: var(--sage-light); border-radius: 10px; padding: 0.7rem 0.9rem; margin-top: 0.6rem; border-left: 3px solid var(--moss); }
.tenant-message-reply strong { font-size: 0.78rem; color: var(--moss); font-family: -apple-system, sans-serif; }
.tenant-message-reply p { font-size: 0.86rem; color: var(--ink); margin-top: 0.3rem; }
.tenant-message-pending { display: inline-block; margin-top: 0.6rem; font-size: 0.78rem; color: var(--amber); font-style: italic; font-weight: 600; }

.tenant-urgent-section {
  background: var(--moss-deep); color: #f2ede0; border-radius: 20px; padding: 1.8rem 2rem; box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}
.tenant-urgent-section h2 { color: #fff; }
.tenant-urgent-section h2::after { background: linear-gradient(to right, rgba(255,255,255,0.3), transparent); }
.tenant-urgent-lead { color: rgba(242,237,224,0.75); font-size: 0.88rem; margin-bottom: 1.1rem; }
.tenant-urgent-section textarea {
  width: 100%; padding: 0.9rem 1.1rem; border: 1.5px solid rgba(255,255,255,0.25); border-radius: 12px;
  font-family: inherit; font-size: 0.92rem; resize: vertical; margin-bottom: 0.9rem; background: rgba(255,255,255,0.08); color: #fff;
}
.tenant-urgent-section textarea::placeholder { color: rgba(242,237,224,0.5); }
.tenant-urgent-section .btn-primary { background: var(--sage); color: var(--moss-deep); font-weight: 700; }
.tenant-urgent-section .btn-primary:hover { background: #9cb98a; }

/* Compteurs / consommations — couleur dédiée par type pour les distinguer d'un coup d'œil */
.tenant-meter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-bottom: 1.3rem; }
.tenant-meter-card[data-meter="gas"] { --accent: var(--amber); }
.tenant-meter-card[data-meter="water"] { --accent: var(--water); }
.tenant-meter-card[data-meter="internet"] { --accent: #4f46e5; }
.tenant-meter-card[data-meter="gas"] h3 { color: #8a5a1c; }
.tenant-meter-card[data-meter="water"] h3 { color: var(--water); }
.tenant-meter-card[data-meter="internet"] h3 { color: #4f46e5; }
.tenant-meter-col-label { font-weight: 700; margin-top: 0.7rem; color: var(--moss-deep); }
.tenant-meter-col-label:first-of-type { margin-top: 0; }
.tenant-meter-subtotal { margin-top: 0.8rem !important; padding-top: 0.7rem; border-top: 1px dashed var(--border-soft); font-weight: 700; color: var(--moss); font-size: 0.92rem; }
.tenant-meter-card[data-meter="gas"] .tenant-meter-subtotal { color: var(--amber); }
.tenant-meter-card[data-meter="water"] .tenant-meter-subtotal { color: var(--water); }
.tenant-meter-card[data-meter="internet"] .tenant-meter-subtotal { color: #4f46e5; }

.charges-scale { margin: 1.3rem 0; }
.charges-scale-bar { display: flex; width: 100%; height: 14px; border-radius: 999px; overflow: visible; background: #ece7d8; }
.charges-scale-seg { position: relative; height: 100%; cursor: default; }
.charges-scale-seg:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.charges-scale-seg:last-child { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.charges-scale-seg:hover { filter: brightness(1.1); }
.charges-scale-seg::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 135%; left: 50%; transform: translateX(-50%);
  background: var(--moss-deep); color: #fff; font-size: 0.75rem; padding: 0.35rem 0.65rem; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 5;
}
.charges-scale-seg::before {
  content: ''; position: absolute; bottom: 122%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--moss-deep); opacity: 0; transition: opacity 0.15s;
}
.charges-scale-seg:hover::after, .charges-scale-seg:hover::before { opacity: 1; }

.tenant-your-share {
  margin-top: 0.8rem; padding: 1.3rem 1.6rem; background: var(--sage-light); border-radius: 16px;
  border: 1.5px dashed var(--sage); display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.6rem;
}
.your-share-label { font-size: 0.95rem; font-weight: 600; color: var(--moss-deep); }
.your-share-amount { font-family: 'Fraunces', Georgia, serif; font-size: 2rem; font-weight: 700; color: var(--moss); }

.tenant-charges-credit { margin-top: 1.1rem; }
.credit-line { font-size: 0.88rem; color: var(--bark); margin-bottom: 0.35rem; }
.credit-line strong { color: var(--ink); font-family: 'Fraunces', Georgia, serif; }
.credit-line strong.is-negative { color: var(--terracotta); }
.tenant-credit-bar { width: 100%; height: 14px; border-radius: 999px; background: #ece7d8; overflow: visible; margin-top: 0.6rem; }
.tenant-credit-fill { height: 100%; border-radius: 999px; width: 0; transition: width 1.1s cubic-bezier(.22,1,.36,1); background: linear-gradient(to right, #22c55e, #eab308, #ef4444); }


.tenant-building-charges { background: var(--card); border: 1.5px solid var(--border-soft); border-radius: 16px; padding: 1.3rem 1.5rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-card); }
.tenant-building-charges h4 { font-family: 'Fraunces', Georgia, serif; font-size: 1rem; margin-bottom: 0.8rem; color: var(--moss-deep); }
.tenant-building-charge-row { display: flex; justify-content: space-between; font-size: 0.87rem; color: var(--bark); padding: 0.4rem 0; border-bottom: 1px dotted var(--border-soft); }
.tenant-building-charge-row:last-child { border-bottom: none; }
.tenant-building-charge-row strong { color: var(--ink); }
.tenant-building-charge-row.is-cancelled { text-decoration: line-through; opacity: 0.5; }

.tenant-grand-total {
  text-align: right; font-size: 1.05rem; font-weight: 600; color: var(--moss-deep); padding: 1.1rem 1.4rem;
  background: var(--sage-light); border-radius: 14px; border: 1.5px dashed var(--sage);
}
.tenant-grand-total strong { font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; color: var(--moss); margin-left: 0.5rem; }

.tenant-charges-gift {
  margin-top: 0.9rem; display: flex; align-items: center; gap: 0.9rem;
  padding: 1.1rem 1.4rem; border-radius: 16px; font-size: 0.95rem; font-weight: 600; color: #7a5518;
  background: linear-gradient(135deg, #fff4d6, #ffe6b8, #fff4d6); background-size: 200% 200%;
  border: 1.5px solid #f0c869; box-shadow: 0 3px 14px rgba(240,200,105,0.4);
}
@media (prefers-reduced-motion: no-preference) {
  .tenant-charges-gift { animation: giftGlow 3.5s ease-in-out infinite; }
}
@keyframes giftGlow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.tenant-charges-gift .gift-icon { font-size: 1.7rem; flex-shrink: 0; }
.tenant-charges-gift strong { font-family: 'Fraunces', Georgia, serif; color: #8a5f13; }

/* ─── Révélation au défilement (au lieu d'une simple cascade au chargement) ── */
.tt-reveal { opacity: 0; transform: translateY(24px) scale(0.985); }
@media (prefers-reduced-motion: no-preference) {
  .tt-reveal {
    transition: opacity 0.75s cubic-bezier(.22,1,.36,1), transform 0.75s cubic-bezier(.22,1,.36,1);
    transition-delay: var(--tt-delay, 0s);
  }
}
.tt-reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .tt-reveal { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .tenant-cards-grid, .tenant-meter-grid { grid-template-columns: 1fr; }

  .tenant-main { padding: 2rem 0 3rem; }

  .tenant-header-inner {
    grid-template-columns: 1fr auto; grid-template-areas: "brand logout" "codes codes";
    row-gap: 0.6rem;
  }
  .tenant-header-inner .brand { grid-area: brand; }
  .tenant-header-inner .btn-ghost { grid-area: logout; }
  .tenant-header-codes { grid-area: codes; flex-wrap: wrap; justify-content: center; row-gap: 0.3rem; }
  .header-code-item { font-size: 0.85rem; }

  .tenant-rent-months-grid { grid-template-columns: repeat(3, 1fr); }

  .tenant-urgent-section textarea { font-size: 16px; }
  .tenant-urgent-section { padding: 1.4rem 1.3rem; }

  .your-share-amount { font-size: 1.6rem; }
  .tenant-your-share { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* ─── Attestation d'inscription ───────────────────────────────────────────── */
.tenant-attestation-section.is-blocking { border: 2px solid var(--amber); border-radius: 18px; padding: 1.3rem 1.5rem; background: rgba(255,255,255,0.55); box-shadow: 0 8px 26px rgba(201,138,46,0.18); }
.attestation-status { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.9rem 1.1rem; border-radius: 12px; margin-bottom: 0.9rem; }
.attestation-status strong { font-size: 0.98rem; }
.attestation-status span { font-size: 0.88rem; }
.attestation-status.is-ok { background: var(--sage-light); color: var(--moss-deep); }
.attestation-status.is-bad { background: var(--terracotta-light); color: #7a3a14; }
.attestation-status.is-wait { background: var(--amber-light); color: #6b4a14; }
.attestation-intro { font-size: 0.92rem; color: var(--bark); margin-bottom: 0.9rem; }
.attestation-code-note { font-size: 0.88rem; font-weight: 600; color: #6b4a14; background: var(--amber-light); padding: 0.6rem 0.9rem; border-radius: 10px; margin-bottom: 0.9rem; }
.attestation-issue-sent { font-size: 0.85rem; color: var(--bark); margin-bottom: 0.8rem; }
.attestation-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }
.attestation-form input[type="file"] { font-size: 0.85rem; max-width: 100%; }
.attestation-hint { font-size: 0.78rem; color: var(--bark); opacity: 0.8; margin-top: 0.5rem; }
.attestation-issue { margin-top: 1rem; border-top: 1px dashed var(--border-soft); padding-top: 0.8rem; }
.attestation-issue summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--terracotta); }
.attestation-issue form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.7rem; }
.attestation-issue textarea { width: 100%; border: 1px solid var(--border-soft); border-radius: 10px; padding: 0.7rem 0.8rem; font: inherit; font-size: 0.9rem; resize: vertical; }
.attestation-issue button { align-self: flex-start; }
.header-code-item.header-code-locked { font-size: 0.85rem; font-weight: 600; opacity: 0.85; text-decoration: none; color: #fff; }
.header-code-item.header-code-locked:hover { opacity: 1; text-decoration: underline; }

/* ─── Dossier « Informations pour le bail » ──────────────────────────────── */
.tenant-lease-section { border: 2px solid var(--water); border-radius: 18px; padding: 1.3rem 1.5rem; background: rgba(255,255,255,0.6); }
.lease-intro { font-size: 0.92rem; color: var(--bark); margin-bottom: 1rem; }
.lease-reopened { font-size: 0.9rem; font-weight: 600; background: var(--amber-light); color: #6b4a14; padding: 0.6rem 0.9rem; border-radius: 10px; margin-bottom: 1rem; }
.lease-party { border: 1px solid var(--border-soft); border-radius: 14px; padding: 1rem 1.1rem 0.4rem; margin: 0 0 1rem; background: var(--card); }
.lease-party legend { font-weight: 700; font-size: 0.95rem; color: var(--moss-deep); padding: 0 0.4rem; }
.lease-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.lease-grid .form-group { margin-bottom: 0.8rem; }
.lease-grid .lease-wide { grid-column: 1 / -1; }
.lease-grid label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink); margin-bottom: 0.3rem; }
.lease-grid input, .lease-grid select { width: 100%; border: 1px solid var(--border-soft); border-radius: 10px; padding: 0.6rem 0.75rem; font: inherit; font-size: 0.9rem; background: #fff; }
.lease-grid input:focus, .lease-grid select:focus { outline: none; border-color: var(--water); box-shadow: 0 0 0 3px var(--water-light); }
.lease-req { color: var(--terracotta); }
.lease-hint { display: block; font-size: 0.76rem; color: var(--bark); opacity: 0.85; margin-top: 0.3rem; }
.lease-guarantor-toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.92rem; margin: 0.3rem 0 1rem; cursor: pointer; }
.lease-guarantor-toggle input { width: 1.05rem; height: 1.05rem; }
.lease-guarantor { border-color: var(--sage); }
.lease-remove-guarantor { margin-bottom: 0.8rem; }
.lease-errors { background: var(--terracotta-light); color: #7a3a14; border-radius: 12px; padding: 0.8rem 1rem; margin: 0.8rem 0; font-size: 0.86rem; }
.lease-errors ul { margin: 0.4rem 0 0 1.1rem; }
.lease-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 0.6rem; }
@media (max-width: 640px) {
  .tenant-lease-section { padding: 1rem; }
  .lease-grid { grid-template-columns: 1fr; }
}

/* ─── Bail à signer (OKSign) ─────────────────────────────────────────────── */
.tenant-sign-section { border: 2px solid var(--moss); border-radius: 18px; padding: 1.3rem 1.5rem; background: var(--sage-light); }
.sign-third-party { background: #fff; border-radius: 12px; padding: 0.8rem 1rem; font-size: 0.9rem; color: var(--bark); margin: 0.8rem 0 1rem; line-height: 1.5; }
.sign-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.sign-help-link { font-size: 0.9rem; font-weight: 600; color: var(--moss-deep); }
