/* Onyx · Style Apple
   Couche au-dessus de verre.css, activée par la classe « apple » sur <html> (en plus de « verre »).
   Retirer « apple » rétablit le verre ; retirer les deux rétablit Indigo nuit.
   Pas de barre latérale : une barre de navigation flottante en verre en haut (ordinateur), la barre du bas sur téléphone. */

html.apple[data-theme="light"] {
  --bg: #F5F5F7; --surface: #FFFFFF; --sunk: rgba(120, 120, 128, .09);
  --line: rgba(0, 0, 0, .09); --line-soft: rgba(0, 0, 0, .05); --line-strong: rgba(0, 0, 0, .18);
  --ink: #1D1D1F; --ink-2: #3A3A3C; --muted: #66666B;
  --accent-soft: rgba(109, 74, 255, .10);
  --glass: #FFFFFF; --glass-hi: #FFFFFF; --edge: transparent; --fill: rgba(120, 120, 128, .12); --fill-hi: rgba(120, 120, 128, .2);
  --bar: rgba(255, 255, 255, .72);
  --sh: 0 1px 2px rgba(0, 0, 0, .04), 0 14px 34px -18px rgba(0, 0, 0, .16); --shadow: var(--sh);
  --nav: var(--bar); --nav-ink: #1D1D1F; --nav-mu: #6E6E73; --nav-on: rgba(109, 74, 255, .10); --nav-line: rgba(0, 0, 0, .09);
}
html.apple[data-theme="dark"] {
  --bg: #000000; --surface: #1C1C1E; --sunk: rgba(0, 0, 0, .3);
  --line: rgba(255, 255, 255, .10); --line-soft: rgba(255, 255, 255, .06); --line-strong: rgba(255, 255, 255, .2);
  --ink: #F5F5F7; --ink-2: #D1D1D6; --muted: #A1A1A6;
  --accent-soft: rgba(165, 139, 255, .18);
  --glass: #1C1C1E; --glass-hi: #2C2C2E; --edge: transparent; --fill: rgba(120, 120, 128, .24); --fill-hi: rgba(120, 120, 128, .36);
  --bar: rgba(28, 28, 30, .72);
  --sh: 0 0 0 1px rgba(255, 255, 255, .05); --shadow: 0 20px 50px -20px rgba(0, 0, 0, .8);
  --nav: var(--bar); --nav-ink: #F5F5F7; --nav-mu: #A1A1A6; --nav-on: rgba(165, 139, 255, .18); --nav-line: rgba(255, 255, 255, .10);
}
html.apple { --r-card: 28px; --r-ctl: 12px; }

/* Fond calme : pas de halos, pas de lueur qui suit le curseur */
html.apple .orbs { display: none; }
html.apple .card::before, html.apple .kpi::before, html.apple .ticket::before, html.apple .login-form::before { display: none; }
html.apple .main:has(> .cols > .card:hover) > .cols > .card:not(:hover) { opacity: 1; filter: none; }

/* Cartes : blanches (noires en nuit), très arrondies, sans flou */
html.apple .card, html.apple .kpi, html.apple .ticket, html.apple .menu-list, html.apple .login-form {
  background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; box-shadow: var(--sh);
}
html.apple .card { padding: 28px; gap: 20px; }
html.apple .card.dark { background: var(--surface); }

/* Titres : grands, gras, serrés, en minuscules comme sur apple.com */
html.apple h1, html.apple .page-title { font-weight: 600; letter-spacing: -.03em; }
html.apple .hello h1 { font-size: 44px; line-height: 1.08; }
html.apple .page-title { font-size: 34px; }
html.apple .card-head h2, html.apple .rail-head h2 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; text-transform: none; color: var(--ink); }
html.apple .hello .date, html.apple .hello p { font-size: 17px; }
html.apple .login-form h1 { font-size: 34px; font-weight: 600; }

/* Navigation : plus de barre. On part du tableau de bord (grille de tuiles) ; chaque page a un bouton de retour.
   Il ne reste qu'une ligne discrète en haut de page : logo à gauche, voyant, avatar et thème à droite. */
html.apple .tabbar { display: none; }
html.apple .shell { display: block; }
html.apple .side, html.apple .mobile-top {
  position: static; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 1240px; height: auto; margin: 0 auto; padding: 22px 40px 0; overflow: visible;
  background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; z-index: 5;
}
@media (min-width: 861px) { html.apple .mobile-top { display: none; } }
html.apple .nav { display: none; }
html.apple .brand { padding: 0; gap: 10px; }
html.apple .brand-sub { display: none; }
html.apple .brand-name { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
html.apple .side-foot { margin: 0; padding: 0; border: 0; flex-direction: row; align-items: center; gap: 12px; }
html.apple .side-status { padding: 0; }
html.apple .side-status .mono { display: none; }
html.apple .side-row { gap: 10px; }
html.apple .main { max-width: 1240px; padding-top: 28px; }
@media (max-width: 860px) {
  html.apple .mobile-top { display: flex; padding: calc(16px + env(safe-area-inset-top)) 16px 0; position: static; }
  html.apple .side { display: none; }
  html.apple .main { padding-bottom: 40px; }
}

/* Tuiles du tableau de bord : une par page, avec un résumé en direct */
html.apple .hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
html.apple .tile {
  display: flex; flex-direction: column; gap: 4px; min-height: 156px; padding: 22px; border-radius: 28px;
  background: var(--surface); box-shadow: var(--sh); color: var(--ink); text-decoration: none;
  animation: enter .45s var(--ease) both; transition: transform .35s var(--ease), box-shadow .35s;
}
html.apple .tile:nth-child(2) { animation-delay: .04s; } html.apple .tile:nth-child(3) { animation-delay: .08s; }
html.apple .tile:nth-child(4) { animation-delay: .12s; } html.apple .tile:nth-child(5) { animation-delay: .16s; }
html.apple .tile:nth-child(6) { animation-delay: .20s; } html.apple .tile:nth-child(7) { animation-delay: .24s; }
html.apple .tile:nth-child(n+8) { animation-delay: .28s; }
html.apple .tile:hover { transform: translateY(-3px); color: var(--ink); box-shadow: var(--sh), 0 18px 34px -18px rgba(0, 0, 0, .35); }
html.apple .tile:active { transform: scale(.98); }
html.apple .tile-ico { width: 48px; height: 48px; margin-bottom: auto; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); transition: transform .35s var(--ease); }
html.apple .tile:hover .tile-ico { transform: scale(1.08) rotate(-4deg); }
html.apple .tile-title { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
html.apple .tile-sub { font-size: 14px; line-height: 1.35; color: var(--muted); }
@media (max-width: 860px) {
  html.apple .hub { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  html.apple .tile { min-height: 140px; padding: 18px; border-radius: 24px; }
}

/* Bouton de retour sur chaque page */
html.apple .back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; background: var(--fill); color: var(--accent-link); font-weight: 500; font-size: 15px; text-decoration: none; transition: background .25s, transform .25s var(--ease); }
html.apple .back:hover { background: var(--fill-hi); color: var(--accent-link); transform: translateX(-2px); }
html.apple .back:active { transform: scale(.97); }
html.apple .theme-btn { background: var(--fill); border: 0; }
html.apple .theme-btn:hover { background: var(--fill-hi); }

/* Boutons et champs : gris « tinté » d'Apple, pilules, aucune bordure */
html.apple .btn { background: var(--fill); border: 0; box-shadow: none; color: var(--ink); font-weight: 500; }
html.apple .btn:hover { background: var(--fill-hi); transform: none; box-shadow: none; color: var(--ink); }
html.apple .btn:active { transform: scale(.97); opacity: .85; }
html.apple .btn-primary, html.apple .btn-dark { background: var(--accent); color: var(--on-accent); }
html.apple .btn-primary:hover, html.apple .btn-dark:hover { background: var(--accent-hover); box-shadow: none; }
html.apple .btn-primary::after, html.apple .btn-dark::after { display: none; }
html.apple .btn-ghost { background: transparent; color: var(--accent-link); }
html.apple .btn-ghost:hover { background: var(--fill); color: var(--accent-link); }
html.apple .input { background: var(--fill); border: 1px solid transparent; }
html.apple .input:hover { border-color: transparent; background: var(--fill-hi); }
html.apple .input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
html.apple .chip, html.apple .planbar, html.apple .rep-item { background: var(--fill); border: 0; box-shadow: none; }
html.apple .tabs { background: var(--fill); border: 0; }
html.apple .tab[aria-current="page"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
html.apple .rep-item[aria-current="true"] { background: var(--accent-soft); }

/* Rail et tâches : cartes simples, un léger relief au survol */
html.apple .rail::before { display: none; }
html.apple .rail { padding-top: 0; }
html.apple .ticket { border-radius: 24px; padding: 20px; }
html.apple .ticket:hover { transform: translateY(-2px); box-shadow: var(--sh), 0 16px 30px -18px rgba(0, 0, 0, .3); border: 0; }
html.apple .col { background: var(--sunk); border: 0; border-radius: 20px; }
html.apple .task { background: var(--glass-hi); border: 0; border-radius: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
html.apple .task:hover { transform: none; border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 18px -10px rgba(0, 0, 0, .3); }
html.apple .task.blocked { box-shadow: 0 0 0 1px var(--warn-line); }
html.apple .task-btns button { background: var(--fill); border: 0; }
html.apple .task-btns button:hover { background: var(--fill-hi); }
html.apple .kpi { padding: 20px; border-radius: 24px; }

/* Notification : pastille sombre, comme un message système Apple */
html.apple .toast:not(.err) { background: rgba(28, 28, 30, .86); color: #F5F5F7; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border: 0; box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .5); }

/* Connexion : une carte nette au centre */
html.apple .login-form { border-radius: 32px; padding: 40px 34px 32px; box-shadow: var(--sh), 0 30px 60px -30px rgba(0, 0, 0, .25); }
html.apple .login-form .field .input { background: var(--fill); }
html.apple .login-form .field:has(.input:focus) .input { background: var(--surface); }

/* Téléphone : barre du bas et en-tête en verre, comme iOS */
@media (max-width: 860px) {
  html.apple .mobile-top, html.apple .tabbar { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); }
  html.apple .hello h1 { font-size: 34px; }
  html.apple .card { padding: 20px; border-radius: 24px; }
}

/* ===== Relief et mouvement (Apple, avec de la profondeur) ===== */
html.apple { --spring: cubic-bezier(.34, 1.56, .64, 1); }
html.apple[data-theme="light"] {
  --sh: inset 0 1px 0 rgba(255, 255, 255, .95), 0 1px 1px rgba(0, 0, 0, .04), 0 3px 6px rgba(0, 0, 0, .04), 0 12px 24px -8px rgba(0, 0, 0, .07), 0 28px 56px -22px rgba(70, 45, 170, .22);
  --sh-up: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 3px rgba(0, 0, 0, .05), 0 8px 14px rgba(0, 0, 0, .06), 0 22px 36px -10px rgba(0, 0, 0, .12), 0 40px 70px -24px rgba(70, 45, 170, .32);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, .35); --btn-glow: 0 10px 22px -8px rgba(109, 74, 255, .65);
  --top-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(245, 243, 255, .55) 100%);
}
html.apple[data-theme="dark"] {
  --sh: inset 0 1px 0 rgba(255, 255, 255, .09), 0 0 0 1px rgba(255, 255, 255, .05), 0 2px 4px rgba(0, 0, 0, .5), 0 20px 44px -18px rgba(0, 0, 0, .95);
  --sh-up: inset 0 1px 0 rgba(255, 255, 255, .13), 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 8px rgba(0, 0, 0, .5), 0 30px 60px -20px rgba(0, 0, 0, 1), 0 0 50px -20px rgba(165, 139, 255, .4);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, .4); --btn-glow: 0 10px 24px -8px rgba(165, 139, 255, .6);
  --top-sheen: linear-gradient(180deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, 0) 45%);
}
html.apple .card, html.apple .kpi, html.apple .ticket { background-image: var(--top-sheen); transition: background-color .4s, box-shadow .35s, transform .4s var(--ease); }
html.apple .kpi:hover, html.apple .ticket:hover { transform: translateY(-3px); box-shadow: var(--sh-up); }
html.apple .task { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .1), 0 6px 12px -6px rgba(0, 0, 0, .15); transition: transform .3s var(--ease), box-shadow .3s; }
html.apple .task:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 4px rgba(0, 0, 0, .1), 0 14px 22px -10px rgba(0, 0, 0, .3); }
html.apple .task.dragging { transform: rotate(-1.5deg) scale(1.03); box-shadow: var(--sh-up); }
html.apple .col { box-shadow: inset 0 2px 6px -2px rgba(0, 0, 0, .12); }

/* Boutons : reflet, ombre colorée, ressort à l'appui */
html.apple .btn { transition: transform .3s var(--spring), background-color .25s, box-shadow .3s; }
html.apple .btn:hover { transform: translateY(-1px); }
html.apple .btn:active { transform: scale(.95); }
html.apple .btn-primary, html.apple .btn-dark { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent)); box-shadow: var(--btn-hi), var(--btn-glow); }
html.apple .btn-primary:hover, html.apple .btn-dark:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-hover) 84%, #fff), var(--accent-hover)); box-shadow: var(--btn-hi), 0 14px 28px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
html.apple .btn-ghost, html.apple .btn-ghost:hover { box-shadow: none; }
html.apple .theme-btn { transition: transform .5s var(--spring), background .25s; }
html.apple .theme-btn:hover { transform: rotate(25deg) scale(1.1); }

/* Tuiles : icônes « d'application » bombées, inclinaison 3D, reflet qui suit le curseur */
html.apple .hub { perspective: 1200px; }
html.apple .tile {
  position: relative; transform-style: preserve-3d; box-shadow: var(--sh); background-image: var(--top-sheen);
  transform: perspective(800px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)) translateY(var(--lift, 0px)) scale(var(--sc, 1));
  transition: transform .3s var(--ease), box-shadow .4s, background-color .4s;
}
html.apple .tile:hover { --lift: -5px; box-shadow: var(--sh-up); }
html.apple .tile:active { --sc: .97; }
html.apple .tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .55), transparent 65%);
  mix-blend-mode: soft-light;
}
html.apple[data-theme="dark"] .tile::after { background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(165, 139, 255, .28), transparent 65%); mix-blend-mode: normal; }
html.apple .tile:hover::after { opacity: 1; }
html.apple .tile > * { position: relative; }
html.apple .tile-ico {
  transform: translateZ(26px); transition: transform .45s var(--spring), box-shadow .4s;
  color: #fff; background: linear-gradient(155deg, #9B84FF 0%, #6D4AFF 62%, #5A38E6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 5px rgba(0, 0, 0, .16), 0 10px 20px -8px rgba(109, 74, 255, .7);
}
html.apple[data-theme="dark"] .tile-ico { color: #140C2E; background: linear-gradient(155deg, #C9B9FF 0%, #A58BFF 60%, #8D6EF5 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -3px 5px rgba(0, 0, 0, .18), 0 10px 22px -8px rgba(165, 139, 255, .65); }
html.apple .tile:hover .tile-ico { transform: translateZ(40px) scale(1.12) rotate(-6deg); }
html.apple .tile-title, html.apple .tile-sub { transform: translateZ(12px); }
html.apple .tile::before {
  content: "›"; position: absolute; top: 16px; right: 20px; font-size: 26px; line-height: 1; color: var(--muted);
  opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .4s var(--ease);
}
html.apple .tile:hover::before { opacity: 1; transform: translateX(0); }

/* Bouton de retour et pastille de notification : ressort */
html.apple .back { transition: background .25s, transform .4s var(--spring); }
html.apple .toast { animation-timing-function: var(--spring); }
html.apple .tick { transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--spring); }
html.apple .tick:active { transform: scale(.85); }

/* Changement de page : la page quitte en s'estompant, la suivante arrive en douceur */
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; } }
html.apple::view-transition-old(root) { animation: vt-out .2s var(--ease) both; }
html.apple::view-transition-new(root) { animation: vt-in .35s var(--ease) both; }

/* Apparition échelonnée des grands blocs, un peu plus marquée */
html.apple .main > * { animation-duration: .55s; }
html.apple .main > *:nth-child(2) { animation-delay: .05s; } html.apple .main > *:nth-child(3) { animation-delay: .1s; }
html.apple .main > *:nth-child(4) { animation-delay: .15s; } html.apple .main > *:nth-child(5) { animation-delay: .2s; }
html.apple .main > *:nth-child(n+6) { animation-delay: .25s; }
@media (max-width: 860px) {
  html.apple .tile { transform: translateY(var(--lift, 0px)) scale(var(--sc, 1)); }
  html.apple .tile-ico, html.apple .tile-title, html.apple .tile-sub { transform: none; }
}
html.apple .tile { animation-fill-mode: backwards; }
html.apple .tile:hover, html.apple .tile:active { transform: perspective(800px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)) translateY(var(--lift, 0px)) scale(var(--sc, 1)); }
@media (max-width: 860px) { html.apple .tile:hover, html.apple .tile:active { transform: translateY(var(--lift, 0px)) scale(var(--sc, 1)); } }

/* ===== Pop : tout jaillit avec du rebond, les clics font éclater une onde ===== */
@keyframes pop-in { 0% { opacity: 0; transform: scale(.78) translateY(18px); } 55% { opacity: 1; transform: scale(1.06) translateY(-3px); } 78% { transform: scale(.985); } 100% { opacity: 1; transform: none; } }
@keyframes pop-soft { 0% { opacity: 0; transform: scale(.95) translateY(16px); } 60% { opacity: 1; transform: scale(1.012) translateY(-2px); } 100% { opacity: 1; transform: none; } }
@keyframes burst { from { opacity: .55; transform: translate(-50%, -50%) scale(0); } to { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
@keyframes tick-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }
html.apple .tile { animation-name: pop-in; animation-duration: .7s; animation-timing-function: cubic-bezier(.2, .9, .3, 1); }
html.apple .tile:nth-child(2) { animation-delay: .06s; } html.apple .tile:nth-child(3) { animation-delay: .12s; }
html.apple .tile:nth-child(4) { animation-delay: .18s; } html.apple .tile:nth-child(5) { animation-delay: .24s; }
html.apple .tile:nth-child(6) { animation-delay: .30s; } html.apple .tile:nth-child(7) { animation-delay: .36s; }
html.apple .tile:nth-child(n+8) { animation-delay: .42s; }
html.apple .main > * { animation-name: pop-soft; animation-duration: .7s; animation-timing-function: cubic-bezier(.2, .9, .3, 1); }
html.apple .ticket { animation-name: pop-in; animation-duration: .7s; }
html.apple .tile:hover { --lift: -7px; --sc: 1.045; }
html.apple .tile:active { --sc: .95; }
html.apple .tile:hover .tile-ico { transform: translateZ(44px) scale(1.2) rotate(-8deg); }
html.apple .btn:hover, html.apple .back:hover { transform: translateY(-2px) scale(1.05); }
html.apple .btn:active, html.apple .back:active { transform: scale(.9); }
html.apple .theme-btn:hover { transform: rotate(35deg) scale(1.18); }
html.apple .task:hover { transform: translateY(-3px) scale(1.02); }
html.apple .tick.on, html.apple .task.ticked .tick { animation: tick-pop .5s var(--spring); }
html.apple .toast { animation-name: toast-in; animation-duration: .65s; animation-timing-function: cubic-bezier(.2, 1.3, .4, 1); }
html.apple .avatar { transition: transform .4s var(--spring); } html.apple a.avatar:hover { transform: scale(1.2) rotate(-6deg); }
html.apple .burst { position: absolute; left: 0; top: 0; width: 220px; height: 220px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 68%); animation: burst .6s var(--ease) forwards; z-index: 0; }
html.apple .back, html.apple .theme-btn, html.apple .tick { position: relative; }
@media (max-width: 860px) { html.apple .tile:hover { --lift: -3px; --sc: 1.02; } }html.apple .burst-clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }

/* En-tête simplifié : logo, thème et avatar. Le logo reste aligné sur le bord du contenu, à toutes les largeurs. */
html.apple .side-status { display: none; }
html.apple .side, html.apple .mobile-top { padding-left: 40px; padding-right: 40px; }
@media (max-width: 1100px) { html.apple .side, html.apple .mobile-top { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 860px) { html.apple .mobile-top { padding-left: 16px; padding-right: 16px; } }
