/* =====================================================================
   Dossier Domaine — v2 (proposition)
   Même disposition que la v1 (app.css), habillée autrement :
   - courbes arrondies partout ;
   - cartes en verre dépoli posées sur les images et sur un fond animé ;
   - les 3 points du logo Vinea (prune, rouge, orange) comme fil conducteur.
   Le rendu des documents (.paper) et des diapositives (.sl) n'est pas touché :
   ils doivent rester identiques à ce qui sera imprimé ou exporté.
   ===================================================================== */

.v2 {
  --prune: #a8045a;
  --rouge: #b3051e;
  --orange: #f09640;
  --bg: #f6f2ec;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-line: rgba(255, 255, 255, .75);
  --blur: saturate(1.6) blur(18px);
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --pill: 999px;
  --shadow: 0 1px 1px rgba(52, 41, 58, .04), 0 12px 32px -12px rgba(52, 41, 58, .18);
  --shadow-up: 0 2px 2px rgba(52, 41, 58, .05), 0 28px 56px -20px rgba(52, 41, 58, .32);
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* Les trois points du logo, réutilisables en image de fond */
  --dots: radial-gradient(circle at 4px 4px, var(--prune) 3.6px, transparent 4.2px),
          radial-gradient(circle at 16px 4px, var(--rouge) 3.6px, transparent 4.2px),
          radial-gradient(circle at 28px 4px, var(--orange) 3.6px, transparent 4.2px);
  background: var(--bg);
  font-variant-numeric: lining-nums;
}
.v2 ::selection { background: var(--prune); color: var(--white); }
.v2 :focus-visible { outline: 2px solid var(--prune); outline-offset: 3px; border-radius: 6px; }

/* ---------- Fond : trois halos aux couleurs du logo, très flous, qui dérivent lentement ---------- */
.v2-ambiance { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.v2-ambiance i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .2; will-change: transform; }
.v2-ambiance i:nth-child(1) { background: var(--prune); top: -18vmax; left: -12vmax; animation: v2-drift-a 34s ease-in-out infinite alternate; }
.v2-ambiance i:nth-child(2) { background: var(--rouge); top: 30vh; right: -20vmax; opacity: .14; animation: v2-drift-b 40s ease-in-out infinite alternate; }
.v2-ambiance i:nth-child(3) { background: var(--orange); bottom: -22vmax; left: 22vw; opacity: .24; animation: v2-drift-c 30s ease-in-out infinite alternate; }
@keyframes v2-drift-a { to { transform: translate(14vw, 18vh) scale(1.1); } }
@keyframes v2-drift-b { to { transform: translate(-18vw, -12vh) scale(.92); } }
@keyframes v2-drift-c { to { transform: translate(-16vw, -20vh) scale(1.08); } }

/* ---------- En-tête en verre ---------- */
.v2 .site-header { background: rgba(246, 242, 236, .62); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid rgba(255, 255, 255, .6); transition: box-shadow .4s var(--ease), background .4s var(--ease); }
.v2 .site-header.solid { background: rgba(255, 255, 255, .72); box-shadow: 0 10px 30px -18px rgba(52, 41, 58, .35); }
.v2 .brand { display: grid; grid-template-columns: auto auto; column-gap: 12px; align-items: center; }
.v2 .brand .brand-name, .v2 .brand .brand-sub { grid-column: 2; }
.v2-dots { grid-row: 1 / span 2; display: inline-flex; gap: 4px; align-items: center; }
.v2-dots i { width: 9px; height: 13px; border-radius: 50%; transform: rotate(18deg); transition: transform .6s var(--ease); }
.v2-dots i:nth-child(1) { background: var(--prune); }
.v2-dots i:nth-child(2) { background: var(--rouge); transition-delay: .05s; }
.v2-dots i:nth-child(3) { background: var(--orange); transition-delay: .1s; }
.v2 .brand:hover .v2-dots i { transform: rotate(18deg) translateY(-3px); }
.v2 .local-badge { background: var(--glass); border: 1px solid var(--glass-line); padding: 6px 14px 6px 10px; border-radius: var(--pill); }
.v2 .mainnav { gap: 6px; padding: 4px 0 12px; }
.v2 .mainnav a { border: 0; border-radius: var(--pill); padding: 8px 16px; font-size: 12.5px; letter-spacing: .06em; transition: background .35s var(--ease), color .35s var(--ease); }
.v2 .mainnav a:hover { background: rgba(255, 255, 255, .7); border: 0; }
.v2 .mainnav a[aria-current='page'] { background: var(--aubergine); color: var(--white); border: 0; box-shadow: 0 8px 18px -10px rgba(52, 41, 58, .7); }

/* ---------- Titres ---------- */
.v2 .crumbs span + span::before { content: '•'; color: var(--orange); }
.v2 .page-title h1 { color: var(--aubergine); }
.v2 .page-title::after { content: ''; display: block; width: 32px; height: 8px; margin: 18px auto 0; background: var(--dots); background-repeat: no-repeat; }
.v2 .rule { width: 32px; height: 8px; background: var(--dots); background-repeat: no-repeat; }
.v2 .panel-toggle { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.v2 .panel-toggle summary { border-radius: var(--r-lg); transition: background .3s var(--ease); }
.v2 .panel-toggle summary:hover { background: rgba(255, 255, 255, .5); }

/* ---------- Carte « annonce » : l'image couvre toute la carte, le cadre est en verre par-dessus ---------- */
.v2 .listing { position: relative; isolation: isolate; border-radius: var(--r-xl); overflow: hidden; background: var(--aubergine); box-shadow: var(--shadow-up); }
.v2 .listing::before { content: ''; position: absolute; inset: -20px; z-index: -1; background: url('../img/vignes.svg') center/cover no-repeat; transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(1.04); transition: transform 1.2s var(--ease); }
.v2 .listing::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(36, 28, 41, .05), rgba(36, 28, 41, .35)); }
.v2 .listing-visual { background: transparent; }
.v2 .listing-body { padding: 26px; background: transparent; }
.v2 .listing .frame { background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r-lg); box-shadow: 0 30px 60px -30px rgba(20, 12, 24, .6); }
.v2 .frame-ref { border-radius: var(--pill); border-color: var(--glass-line) !important; background: var(--white) !important; box-shadow: 0 6px 16px -10px rgba(52, 41, 58, .5); }
.v2 .frame .kicker::before { width: 32px; height: 8px; background: var(--dots); background-repeat: no-repeat; margin-bottom: 10px; }
.v2 .frame .kicker::after { width: 32px; height: 1px; background: var(--line); }
.v2 .frame .figure { font-family: var(--serif-display); font-weight: 400; font-size: 30px; }

/* Zone de dépôt : verre sombre, halo de couleur qui suit le pointeur */
.v2 .drop { --mx: 50%; --my: 50%; inset: 26px; border-radius: var(--r-lg); border: 1.5px dashed rgba(255, 255, 255, .55); background: rgba(36, 28, 41, .28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: border-color .4s var(--ease), background .4s var(--ease), transform .5s var(--ease); }
.v2 .drop::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(320px circle at var(--mx) var(--my), rgba(240, 150, 64, .35), rgba(168, 4, 90, .18) 45%, transparent 70%); opacity: 0; transition: opacity .4s var(--ease); pointer-events: none; }
.v2 .drop:hover::before, .v2 .drop.over::before { opacity: 1; }
.v2 .drop:hover, .v2 .drop.over { border-color: var(--white); border-style: solid; background: rgba(36, 28, 41, .4); }
.v2 .drop.over { transform: scale(.985); }
.v2 .drop > * { position: relative; }
.v2 .drop > input.sr-only { position: absolute; }
.v2 .drop svg { transition: transform .6s var(--ease); }
.v2 .drop:hover svg { transform: translateY(-5px); }

/* ---------- Boutons en pilule ---------- */
.v2 .btn { border-radius: var(--pill); padding: 14px 30px; background: var(--aubergine); border-color: transparent; box-shadow: 0 10px 22px -12px rgba(52, 41, 58, .8); transition: background .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease), color .3s var(--ease); }
.v2 .btn:hover { background: linear-gradient(110deg, var(--prune), var(--rouge) 60%, var(--orange) 130%); box-shadow: 0 16px 30px -14px rgba(168, 4, 90, .75); transform: translateY(-2px); }
.v2 .btn:active { transform: translateY(0); }
.v2 .btn.ghost { background: rgba(255, 255, 255, .55); color: var(--aubergine); border: 1px solid rgba(52, 41, 58, .25); box-shadow: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.v2 .btn.ghost:hover { background: var(--aubergine); color: var(--white); border-color: var(--aubergine); }
.v2 .btn.small { padding: 9px 18px; }
.v2 .btn:disabled { transform: none; box-shadow: none; background: var(--aubergine); }
.v2 .abtn { border-radius: var(--pill); padding: 7px 14px; }
.v2 .linkbtn { text-underline-offset: 3px; }

/* ---------- Étapes et blocs : cartes en verre sur le fond ---------- */
.v2 .step { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.v2 .step > .frame-ref { background: var(--aubergine) !important; color: var(--white); border-color: var(--aubergine) !important; padding: 6px 18px 6px 40px; }
.v2 .step > .frame-ref::before { content: ''; position: absolute; left: 12px; top: 50%; width: 32px; height: 8px; margin-top: -4px; background: var(--dots); background-repeat: no-repeat; transform: scale(.7); transform-origin: left center; }
.v2 h2.section { color: var(--aubergine); }
.v2 .compare, .v2 .nfsm, .v2 .nfsm-new { border: 1px solid var(--glass-line); border-radius: var(--r-lg); background: rgba(255, 255, 255, .55); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.v2 .compare.over, .v2 .nfsm.over { background: rgba(255, 255, 255, .85); border-color: var(--prune); }
.v2 .nfsm-new > summary { border-radius: var(--r-sm); }
.v2 .subhead .opt { border-radius: var(--pill); }

.v2 .dl { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r-xl); box-shadow: var(--shadow); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.v2 .dl:hover { transform: translateY(-4px); box-shadow: var(--shadow-up); }
.v2 .dl .frame { border-radius: var(--r-lg); }

/* Listes, alertes, tableaux */
.v2 .files li { border-radius: var(--pill); background: var(--glass-strong); border-color: var(--glass-line); }
.v2 .doclist li { border-radius: var(--r-sm); background: var(--glass-strong); }
.v2 .doclist .tagm { border-radius: var(--pill); }
.v2 .alerts li { border-radius: var(--r-md); }
.v2 .alerts li:not(.alerte):not(.attention) { background: var(--glass-strong); }
.v2 .table-scroll { border-radius: var(--r-md); border-color: rgba(52, 41, 58, .12); background: var(--white); }
.v2 .kpi { border-radius: var(--r-lg); background: var(--glass-strong); border: 1px solid var(--glass-line); }
.v2 .kpi b { font-family: var(--serif-display); font-weight: 400; }
.v2 .checklist li span { border-radius: 50%; }
.v2 .callout div { border-radius: var(--r-lg); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--shadow); }
.v2 .callout b::before { content: ''; display: block; width: 32px; height: 8px; margin-bottom: 10px; background: var(--dots); background-repeat: no-repeat; }

/* Champs de saisie */
.v2 .field input, .v2 .field select, .v2 .field textarea, .v2 .fix input, .v2 .fix select, .v2 table.edit input, .v2 .years input { border-radius: var(--r-sm); border-color: rgba(52, 41, 58, .16); background: rgba(255, 255, 255, .85); transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.v2 .field input:focus, .v2 .field select:focus, .v2 .field textarea:focus { border-color: var(--prune); box-shadow: 0 0 0 4px rgba(168, 4, 90, .12); }
.v2 .field input[type="color"] { padding: 4px; }
.v2 .paste textarea { border-radius: var(--r-sm); }

/* Présentation */
.v2 .pr-block { border-radius: var(--r-lg); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--shadow); overflow: hidden; }
.v2 .pr-block > summary { transition: background .3s var(--ease); }
.v2 .pr-block > summary:hover { background: rgba(255, 255, 255, .5); }
.v2 .pr-block > summary b { border-radius: var(--pill); }
.v2 .pr-block > summary em { border-radius: var(--pill); background: linear-gradient(110deg, var(--prune), var(--rouge)); }
.v2 .pr-block > summary::after { transition: transform .4s var(--ease); }
.v2 .pr-photos figure, .v2 .pr-photos img { border-radius: var(--r-md); }
.v2 #pr-docs li { border-radius: var(--r-sm); }
/* Barre d'actions collée en bas : une pilule de verre qui flotte au-dessus du contenu */
.v2 .pr-actions { bottom: 16px; margin: 26px 0; padding: 10px 10px 10px 10px; gap: 10px; border: 1px solid var(--glass-line); border-radius: var(--pill); background: rgba(255, 255, 255, .6); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 2px 2px rgba(52, 41, 58, .05), 0 22px 44px -18px rgba(52, 41, 58, .45); }
.v2 .pr-actions .btn { padding: 12px 24px; }
.v2 .pr-actions .linkbtn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--pill); color: var(--aubergine); text-decoration: none; font-size: 13px; transition: background .3s var(--ease), color .3s var(--ease); cursor: pointer; }
.v2 .pr-actions .linkbtn:hover { background: rgba(255, 255, 255, .85); }
.v2 .pr-actions .linkbtn:focus-within { outline: 2px solid var(--prune); outline-offset: 2px; }
.v2 .pr-actions #pr-reset { color: var(--rouge); }
.v2 .pr-actions #pr-reset:hover { background: rgba(179, 5, 30, .08); }
@media (max-width: 760px) {
  .v2 .pr-actions { bottom: 10px; border-radius: var(--r-lg); justify-content: center; gap: 6px; padding: 8px; }
  .v2 .pr-actions .sep { flex-basis: 100%; height: 0; }
  .v2 .pr-actions .btn { flex: 1 1 0; min-width: 0; padding: 10px 8px; font-size: 11px; line-height: 1.2; white-space: normal; text-align: center; }
  .v2 .pr-actions .linkbtn { min-height: 32px; padding: 0 6px; font-size: 11.5px; }
}

/* Photos */
.v2 .wm-bar { border-radius: var(--r-lg); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--shadow); }
.v2 .wm-logo { border-radius: var(--r-md); overflow: hidden; }
.v2 .photo-grid li { border-radius: var(--r-md); background: var(--glass-strong); box-shadow: var(--shadow); transition: transform .5s var(--ease); }
.v2 .photo-grid li:hover { transform: translateY(-3px); }
.v2 .photo-grid img { border-radius: 10px; }

/* Documents */
.v2 .legal-note { border-radius: var(--r-md); }
.v2 .doc-form { border-radius: var(--r-lg); }

/* Visionneuse, notifications */
.v2 .viewer { border-radius: var(--r-lg); overflow: hidden; }
.v2 .viewer::backdrop { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.v2 .vbtn { border-radius: var(--pill); }
.v2 .toast { border-radius: var(--pill); background: rgba(52, 41, 58, .88); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 18px 40px -18px rgba(36, 28, 41, .7); }

/* ---------- Pied de page ---------- */
.v2 .site-footer { background: var(--aubergine); color: rgba(255, 255, 255, .7); border-radius: var(--r-xl) var(--r-xl) 0 0; margin-top: 70px; }
.v2 .site-footer b { color: var(--white); }
.v2 .site-footer b::before { content: ''; display: block; width: 32px; height: 8px; margin-bottom: 10px; background: var(--dots); background-repeat: no-repeat; }

/* ---------- Apparitions : les blocs arrivent en sortant d'un léger flou ---------- */
@media (prefers-reduced-motion: no-preference) {
  .v2-js .rv { opacity: 0; transform: translateY(22px); filter: blur(8px); transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); transition-delay: var(--d, 0s); }
  .v2-js .rv.in { opacity: 1; transform: none; filter: none; }
  .v2 [data-section].active { animation: v2-in .6s var(--ease) both; }
  @keyframes v2-in { from { opacity: 0; filter: blur(6px); } }
}
@media (prefers-reduced-motion: reduce) {
  .v2-ambiance i { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .v2 .listing-body { padding: 24px 18px 18px; }
  .v2 .listing::after { background: linear-gradient(180deg, rgba(36, 28, 41, .05), rgba(36, 28, 41, .45)); }
  .v2 .mainnav { gap: 4px; }
  .v2 .mainnav a { padding: 8px 12px; }
}
@media (max-width: 560px) {
  .v2 .drop { inset: 16px; }
  .v2 .step { border-radius: var(--r-lg); }
  .v2 .listing { border-radius: var(--r-lg); }
}

/* ---------- Impression : on revient au sobre ---------- */
@media print {
  .v2-ambiance { display: none !important; }
  .v2 { background: var(--white); }
  .v2 .step, .v2 .dl, .v2 .pr-block, .v2 .callout div { backdrop-filter: none; box-shadow: none; }
}
