/* ============================================================
   NotaTaxe — identité visuelle
   Univers : l'acte notarié. Papier timbré, reliure basane verte,
   filets dorés, sceau de cire. Chiffres en tabulaire mono.
   ============================================================ */
:root {
  --encre: #1b241f;
  --basane: #0e4b3a;
  --basane-2: #0a3a2d;
  --basane-3: #12604a;
  --parchemin: #f6f1e4;
  --papier: #fdfbf4;
  --cire: #8c2f1b;
  --cire-2: #a63a22;
  --or: #b99149;
  --or-pale: #e5d5ae;
  --plume: #6f7570;
  --ligne: #e2dac6;
  --ok: #1c7c4e;
  --warn: #a05e12;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Public Sans", system-ui, sans-serif;
  background: var(--parchemin);
  color: var(--encre);
  font-size: 15.5px;
  line-height: 1.55;
}
h1,h2,h3,.display { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; letter-spacing: .01em; margin: 0 0 .4em; }
a { color: var(--basane); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, td.num, .montant { font-family: "Spline Sans Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

/* --- filet double or : séparateur signature --- */
.filet { border: none; height: 5px; border-top: 1px solid var(--or); border-bottom: 1px solid var(--or); margin: 1.6rem 0; background: transparent; }

/* --- boutons --- */
.btn { display: inline-block; padding: .62rem 1.35rem; border-radius: 3px; border: 1px solid transparent;
  font: 600 .92rem "Public Sans", sans-serif; cursor: pointer; text-decoration: none !important; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-cire { background: var(--cire); color: #fff; }
.btn-cire:hover { background: var(--cire-2); }
.btn-vert { background: var(--basane); color: #fff; }
.btn-vert:hover { background: var(--basane-3); }
.btn-ghost { background: transparent; color: var(--basane); border-color: var(--basane); }
.btn-ghost:hover { background: rgba(14,75,58,.07); }
.btn-min { padding: .3rem .7rem; font-size: .8rem; }
.btn-danger { background: transparent; color: var(--cire); border-color: var(--cire); }
.btn-danger:hover { background: rgba(140,47,27,.08); }

/* ============================================================
   LANDING
   ============================================================ */
.land-header { position: sticky; top: 0; z-index: 50; background: var(--basane); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: .7rem clamp(1rem, 5vw, 4rem);
  border-bottom: 2px solid var(--or); }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-family: "Cormorant Garamond", serif; font-size: 1.5rem; font-weight: 700; text-decoration: none !important; }
.brand .seal-mini { width: 30px; height: 30px; }
.land-nav a { color: var(--or-pale); margin-left: 1.4rem; font-size: .9rem; }
.land-nav a:hover { color: #fff; text-decoration: none; }
.land-nav .btn { margin-left: 1.4rem; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem);
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(185,145,73,.16), transparent 60%),
    var(--parchemin); }
.hero .eyebrow { font: 600 .78rem "Public Sans", sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--cire); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); line-height: 1.06; font-weight: 600; }
.hero h1 em { font-style: italic; color: var(--basane); }
.hero .sous { color: var(--plume); max-width: 34rem; font-size: 1.06rem; margin: 1.1rem 0 1.8rem; }
.hero .cta-row { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.hero .mention { font-size: .8rem; color: var(--plume); margin-top: .9rem; }

/* fiche de provision simulée + sceau */
.hero-visuel { position: relative; }
.fiche-demo { background: var(--papier); border: 1px solid var(--ligne); border-top: 6px solid var(--basane);
  box-shadow: 0 24px 50px -22px rgba(27,36,31,.45); padding: 1.6rem 1.7rem; max-width: 420px; margin-left: auto; }
.fiche-demo h3 { font-size: 1.25rem; border-bottom: 1px solid var(--or); padding-bottom: .5rem; }
.fiche-demo table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.fiche-demo td { padding: .34rem 0; border-bottom: 1px dotted var(--ligne); }
.fiche-demo td:last-child { text-align: right; }
.fiche-demo tr.total td { border-top: 2px solid var(--basane); border-bottom: none; font-weight: 700; padding-top: .6rem; }
.seal { position: absolute; right: -26px; bottom: -34px; width: 128px; height: 128px; filter: drop-shadow(0 8px 14px rgba(140,47,27,.35)); }
.seal .tour { animation: tourner 40s linear infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .seal .tour { animation: none; } }
@keyframes tourner { to { transform: rotate(360deg); } }

.bande { background: var(--basane); color: var(--or-pale); text-align: center; padding: .55rem;
  font: 600 .78rem "Public Sans", sans-serif; letter-spacing: .18em; text-transform: uppercase; }

.section { padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 5vw, 4rem); }
.section.alt { background: var(--papier); border-top: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); }
.section h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); text-align: center; }
.section .sous-titre { text-align: center; color: var(--plume); max-width: 42rem; margin: 0 auto 2.6rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.3rem; }
.carte-f { background: var(--papier); border: 1px solid var(--ligne); padding: 1.4rem; border-radius: 3px; }
.section.alt .carte-f { background: var(--parchemin); }
.carte-f .pictk { font-size: 1.5rem; color: var(--basane); }
.carte-f h3 { font-size: 1.22rem; margin: .5rem 0 .3rem; }
.carte-f p { color: var(--plume); font-size: .9rem; margin: 0; }

/* tarif */
.tarif-carte { max-width: 430px; margin: 0 auto; background: var(--basane); color: #fff; padding: 2.4rem 2.2rem; text-align: center;
  border-radius: 4px; border: 1px solid var(--or); box-shadow: 0 30px 60px -25px rgba(14,75,58,.6); }
.tarif-carte .prix { font-family: "Spline Sans Mono", monospace; font-size: 2.9rem; font-weight: 700; }
.tarif-carte .prix small { font-size: 1rem; color: var(--or-pale); font-weight: 400; }
.tarif-carte ul { list-style: none; padding: 0; margin: 1.4rem 0 1.8rem; text-align: left; }
.tarif-carte li { padding: .42rem 0 .42rem 1.6rem; position: relative; color: #eef3ee; font-size: .92rem; border-bottom: 1px solid rgba(229,213,174,.18); }
.tarif-carte li::before { content: "✓"; position: absolute; left: 0; color: var(--or); font-weight: 700; }
.land-footer { background: var(--encre); color: #b9bdb6; padding: 2rem clamp(1rem,5vw,4rem); font-size: .84rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.land-footer a { color: var(--or-pale); }

/* ============================================================
   APPLICATION (coquille avec barre latérale)
   ============================================================ */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--basane); color: #fff; padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.sidebar .brand { font-size: 1.25rem; margin-bottom: 1rem; padding: 0 .5rem; }
.sidebar .grp { font: 700 .68rem "Public Sans", sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--or); margin: 1rem .5rem .3rem; }
.sidebar a.item { color: #dfe8e1; padding: .5rem .6rem; border-radius: 3px; font-size: .92rem; display: block; }
.sidebar a.item:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar a.item.actif { background: var(--cire); color: #fff; }
.sidebar .bas { margin-top: auto; font-size: .78rem; color: var(--or-pale); padding: .6rem .5rem 0; border-top: 1px solid rgba(229,213,174,.25); }
.contenu { padding: 1.6rem clamp(1rem, 3vw, 2.6rem); max-width: 1180px; }
.entete-page { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--or); padding-bottom: .7rem; margin-bottom: 1.4rem; }
.entete-page h1 { font-size: 1.9rem; margin: 0; }

.flash { padding: .7rem 1rem; border-radius: 3px; margin-bottom: 1.2rem; font-size: .92rem; border: 1px solid; }
.flash.ok { background: #eaf5ee; color: var(--ok); border-color: #bfe0cc; }
.flash.warn { background: #fbf1e2; color: var(--warn); border-color: #ecd3a8; }

/* cartes / stats */
.cartes-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: var(--papier); border: 1px solid var(--ligne); border-left: 4px solid var(--basane); padding: 1rem 1.1rem; }
.stat .lab { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--plume); }
.stat .val { font-family: "Spline Sans Mono", monospace; font-size: 1.5rem; font-weight: 700; margin-top: .2rem; }
.stat.cire { border-left-color: var(--cire); }
.stat.or { border-left-color: var(--or); }

/* tableaux */
table.liste { width: 100%; border-collapse: collapse; background: var(--papier); border: 1px solid var(--ligne); font-size: .9rem; }
table.liste th { background: var(--basane); color: #fff; text-align: left; padding: .55rem .7rem; font-weight: 600; font-size: .82rem; }
table.liste td { padding: .5rem .7rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
table.liste tr:hover td { background: #f4eeda; }
td.num, th.num { text-align: right; }
tr.pied td { font-weight: 700; background: var(--parchemin); border-top: 2px solid var(--basane); }

/* formulaires */
form.fiche { background: var(--papier); border: 1px solid var(--ligne); padding: 1.4rem; max-width: 880px; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem 1.1rem; }
.champ { display: flex; flex-direction: column; gap: .25rem; }
.champ label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--basane); }
.champ input, .champ select, .champ textarea { padding: .5rem .6rem; border: 1px solid #cfc7ad; border-radius: 3px;
  background: #fff; font: inherit; }
.champ input:focus, .champ select:focus { border-color: var(--basane); outline: none; box-shadow: 0 0 0 3px rgba(14,75,58,.12); }
.actions-form { margin-top: 1.2rem; display: flex; gap: .7rem; flex-wrap: wrap; }
fieldset { border: 1px solid var(--or-pale); border-radius: 3px; margin: 1.1rem 0 0; padding: .9rem 1rem; }
legend { font: 700 .78rem "Public Sans", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--cire); padding: 0 .5rem; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 700; }
.badge.ok { background: #dff0e5; color: var(--ok); }
.badge.warn { background: #faeeda; color: var(--warn); }
.badge.ko { background: #f6e2dc; color: var(--cire); }

/* ---- auth (connexion / inscription) ---- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background: radial-gradient(800px 420px at 50% -10%, rgba(185,145,73,.18), transparent 60%), var(--basane-2); }
.auth-carte { width: 100%; max-width: 460px; background: var(--papier); border-top: 6px solid var(--cire); padding: 2rem 2.1rem;
  box-shadow: 0 30px 70px -25px rgba(0,0,0,.55); }
.auth-carte.large { max-width: 620px; }
.auth-carte h1 { font-size: 1.7rem; }
.auth-carte .sous { color: var(--plume); font-size: .9rem; margin-bottom: 1.2rem; }
.err { background: #f6e2dc; color: var(--cire); border: 1px solid #e4b8aa; padding: .6rem .8rem; border-radius: 3px; font-size: .88rem; margin-bottom: 1rem; }

/* ---- abonnement ---- */
.abo-grille { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 1.6rem; align-items: start; }
.abo-carte { background: var(--basane); color: #fff; padding: 1.6rem; border: 1px solid var(--or); }
.abo-carte .prix { font-family: "Spline Sans Mono", monospace; font-size: 2.2rem; font-weight: 700; }
.methodes { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: .9rem 0; }
.methodes label { display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.08); border: 1px solid rgba(229,213,174,.35);
  padding: .55rem .7rem; border-radius: 3px; cursor: pointer; font-size: .9rem; }
.methodes input:checked + span { font-weight: 700; }
.abo-carte input, .abo-carte select { width: 100%; padding: .5rem .6rem; border-radius: 3px; border: 1px solid rgba(229,213,174,.5); background: #fff; color: var(--encre); font: inherit; }

/* ============================================================
   IMPRESSION (fiche de provision / état TPV)
   ============================================================ */
.doc { background: #fff; border: 1px solid var(--ligne); padding: 2.2rem 2.5rem; max-width: 820px; }
.doc .tete { display: flex; justify-content: space-between; border-bottom: 3px double var(--or); padding-bottom: .8rem; margin-bottom: 1.2rem; }
.doc .tete h2 { margin: 0; font-size: 1.5rem; }
.doc .tete .coord { text-align: right; font-size: .8rem; color: var(--plume); }
@media print {
  body { background: #fff; }
  .sidebar, .entete-page .actions, .no-print, .flash { display: none !important; }
  .shell { display: block; }
  .contenu { padding: 0; max-width: none; }
  .doc { border: none; padding: 0; max-width: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .grp, .sidebar .bas { display: none; }
  .hero { grid-template-columns: 1fr; }
  .fiche-demo { margin: 0 auto; }
  .abo-grille { grid-template-columns: 1fr; }
}

/* ============================================================
   LOGO DE L'ÉTUDE & PHOTO DU NOTAIRE
   ============================================================ */

/* --- en-tête des documents imprimés --- */
.doc .tete .identite { display: flex; align-items: center; gap: 1rem; }
.logo-doc { max-height: 72px; max-width: 160px; object-fit: contain; }

/* --- réglages dans « Mon étude » --- */
.media-ligne { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.media-apercu { display: grid; place-items: center; background: #fff; border: 1px solid var(--ligne); overflow: hidden; flex: none; }
.media-apercu.logo { width: 170px; height: 90px; padding: .4rem; }
.media-apercu.photo { width: 84px; height: 84px; border-radius: 50%; background: var(--basane); }
.media-apercu img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-apercu.photo img { width: 100%; height: 100%; object-fit: cover; }
.media-vide { font-size: .78rem; color: var(--plume); text-align: center; padding: 0 .4rem; }
.media-apercu.photo .media-vide { font-family: "Cormorant Garamond", serif; font-size: 2rem; color: var(--or-pale); }
.media-suppr { display: flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .84rem; color: var(--cire); }
input[type=file] { font: inherit; font-size: .85rem; }

/* --- profil dans le menu latéral --- */
.sidebar .profil { display: flex; align-items: center; gap: .6rem; }
.sidebar .avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--cire); color: #fff; overflow: hidden; font-weight: 700; font-size: .95rem;
  border: 1px solid var(--or); }
.sidebar .avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .profil-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   QR CODE D'AUTHENTIFICATION (bas des documents)
   ============================================================ */
.qr-authent { display: flex; align-items: center; gap: 1.1rem; padding: .9rem 1rem;
  border: 1px solid var(--ligne); background: var(--parchemin); border-radius: 3px; margin-bottom: 1rem; }
.qr-authent .qr-img { flex: none; width: 96px; height: 96px; background: #fff; padding: 5px; border: 1px solid var(--ligne); }
.qr-authent .qr-img svg { width: 100%; height: 100%; display: block; }
.qr-authent .qr-txt strong { font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; color: var(--basane); }
.qr-authent .qr-txt p { margin: .25rem 0 0; font-size: .78rem; color: var(--plume); line-height: 1.45; }
.qr-authent .qr-meta { font-family: "Spline Sans Mono", monospace; font-size: .72rem !important; color: var(--encre) !important; }

/* Page publique de vérification */
.verif-etude { display: flex; align-items: center; gap: .9rem; padding: .8rem;
  background: var(--parchemin); border: 1px solid var(--ligne); border-radius: 3px; margin-top: 1rem; }

@media print {
  /* Le QR doit rester net et ne jamais être coupé entre deux pages */
  .qr-authent { break-inside: avoid; background: #fff; }
}
