:root {
  color-scheme: dark;
  --bg: #211b24; --panel: #302531; --panel-soft: #3b2b39;
  --ink: #f6ead9; --muted: #c6b9b6; --gold: #e8c28a;
  --gold-glow: rgba(232, 194, 138, 0.45);
  --line: rgba(231, 194, 138, .24); --focus: #ffe1a5;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 85% -20%, #5a344d, transparent 36%), linear-gradient(160deg, #29202d, var(--bg) 56%);
  font-family: "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}
button, input, textarea { font: inherit }
button { cursor: pointer }
button:disabled { cursor: not-allowed; opacity: .5 }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0 }

.topbar {
  min-height: 86px;
  padding: 16px clamp(20px, 4vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(25, 20, 28, .55);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; letter-spacing: .17em }
.brand img { border-radius: 50%; background: #f8edda; padding: 2px; box-shadow: 0 0 10px rgba(232,194,138,.3) }
.brand span { display: grid; gap: 3px }
.brand strong { font-size: .76rem }.brand small { color: var(--gold); font-size: .56rem; letter-spacing: .28em }
.session { display: flex; align-items: center; gap: 18px; font-size: .83rem; color: var(--muted) }
.text-button, .back-button { border: 0; background: none; color: var(--gold); padding: 8px 0 }
.text-button:hover, .back-button:hover { text-decoration: underline }

main { padding: 0 clamp(20px, 4vw, 64px) 64px }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400 }
h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); margin: 12px 0 14px; line-height: 1.08 }
h2 { font-size: 1.55rem; margin: 0 }
h3 { font-size: 1.14rem; margin: 0 0 14px }
.eyebrow { margin: 0; color: var(--gold); font-size: .67rem; font-weight: 700; letter-spacing: .21em }

.primary, .secondary { min-height: 42px; padding: 10px 20px; border-radius: 4px; transition: background .2s, transform .2s, box-shadow .2s }
.primary {
  border: 1px solid #e8c28a;
  color: #2a1c25;
  background: linear-gradient(130deg, #f6daa7, #dcb779);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(232, 194, 138, 0.2);
}
.primary:hover:not(:disabled) { background: #ffe4ad; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232, 194, 138, 0.35) }
.secondary { border: 1px solid var(--line); color: var(--ink); background: rgba(255,255,255,.03) }
.secondary:hover { background: rgba(255,255,255,.08) }

.message { min-height: 1.5em; color: var(--muted); font-size: .84rem; line-height: 1.45 }
.message[data-kind="error"] { color: #ffb9af }.message[data-kind="success"] { color: #b9e6c4 }

input, textarea { color: var(--ink); border: 1px solid rgba(230, 195, 147, .32); background: #211b25; border-radius: 4px; transition: border-color .2s, box-shadow .2s }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 8px rgba(232, 194, 138, 0.25) }
input { height: 43px; padding: 0 12px }textarea { padding: 16px; line-height: 1.6; resize: vertical; width: 100%; min-height: 240px }
input::placeholder { color: #aa9a9a }

/* --- CARTE DE CONNEXION --- */
.login-card {
  max-width: 1020px;
  margin: clamp(35px, 8vh, 100px) auto 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  box-shadow: 0 25px 70px rgba(10, 6, 13, .35);
  border-radius: 8px;
  overflow: hidden;
}

/* --- ZONE GAUCHE : VITRINE VERTICALE AUTOMATIQUE SANS BOÎTE --- */
.login-art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-right: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 50%, rgba(232, 194, 138, 0.13) 0%, rgba(65, 34, 58, 0.26) 50%, rgba(24, 18, 26, 0.7) 85%);
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

.vertical-carousel-wrapper {
  position: relative;
  width: 100%;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 194, 138, 0.25) 0%, rgba(138, 77, 107, 0.16) 48%, transparent 70%);
  filter: blur(34px);
  pointer-events: none;
  animation: carouselGlowPulse 5s ease-in-out infinite alternate;
}

@keyframes carouselGlowPulse {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.12); opacity: 0.95; }
}

.vertical-carousel-viewport {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0%, black 16%, black 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 16%, black 84%, transparent 100%);
}

.vertical-carousel-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  will-change: transform;
}

.carousel-slot {
  height: 140px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 20px;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(0.85);
  opacity: 0.55;
  filter: brightness(0.82);
  user-select: none;
}

.carousel-slot.is-center {
  transform: scale(1.12);
  opacity: 1;
  filter: brightness(1.06);
}

.carousel-logo {
  max-width: 235px;
  width: auto;
  object-fit: contain;
  background: none;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  transition: filter 0.85s ease;
  pointer-events: none;
}

.carousel-slot.is-center .carousel-logo {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.75))
          drop-shadow(0 0 18px rgba(232, 194, 138, 0.45));
}

.carousel-logo.holiday { max-height: 82px; }
.carousel-logo.mystery { max-height: 80px; }
.carousel-logo.mirror { max-height: 74px; }
.carousel-logo.pica {
  max-height: 62px;
  border-radius: 50%;
  background: #f8edda;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(232, 194, 138, 0.35);
}

/* --- PANNEAU DE FORMULAIRE --- */
.login-content { padding: clamp(30px, 5vw, 60px) }
.login-content > p:not(.eyebrow) { color: var(--muted); line-height: 1.6 }
.login-content form { display: grid; gap: 10px; margin-top: 26px }
.login-content label { font-size: .85rem; font-weight: 600; margin-top: 6px }
.login-content form button { margin-top: 16px; display: flex; align-items: center; justify-content: space-between }

/* --- PROJETS & ATELIER --- */
.projects-view, .workspace { max-width: 1580px; margin: 0 auto }
.projects-view { padding-top: clamp(40px, 7vw, 90px) }.view-intro { color: var(--muted) }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 370px)); gap: 24px; margin-top: 32px }
.project-card { min-height: 315px; padding: 26px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 18px 40px rgba(0,0,0,.15); border-radius: 6px }
.project-card h2 { margin-top: 9px }.project-card img { width: 100%; max-height: 135px; object-fit: contain; margin: auto 0; padding: 15px }
.project-card button { align-self: flex-start; margin-top: auto }.project-card > p:last-child { color: var(--muted); margin-top: auto }

.workspace-heading { display: flex; align-items: center; justify-content: space-between; padding: 25px 0 22px; gap: 20px }
.workspace-heading .eyebrow { margin-top: 16px }.workspace-heading h1 { margin-bottom: 0 }
.project-logo { width: min(22vw, 190px); max-height: 95px; object-fit: contain }
.editor-layout { display: grid; grid-template-columns: minmax(275px, 340px) minmax(0, 1fr); gap: 20px; min-height: min(72vh, 780px) }
.entry-browser, .entry-editor { border: 1px solid var(--line); background: rgba(48, 37, 49, .92); box-shadow: 0 18px 35px rgba(0,0,0,.12); border-radius: 6px }
.entry-browser { display: flex; flex-direction: column; min-height: 0 }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 22px; border-bottom: 1px solid var(--line) }
.panel-heading > span { font-size: .76rem; color: var(--muted); white-space: nowrap }
.search-label { padding: 16px 20px 7px; color: var(--muted); font-size: .76rem }
#entry-search { margin: 0 20px 15px; width: calc(100% - 40px) }
.entry-list { overflow: auto; flex: 1; max-height: 620px }
.entry-item { display: grid; text-align: left; width: 100%; gap: 6px; color: var(--ink); background: transparent; border: 0; border-top: 1px solid rgba(231,194,138,.11); padding: 14px 20px; transition: background .18s }
.entry-item:hover { background: rgba(239, 206, 158, .08) }.entry-item[aria-selected="true"] { background: rgba(239, 206, 158, .14); box-shadow: inset 3px 0 var(--gold) }
.entry-id { color: var(--gold); font-size: .66rem; letter-spacing: .07em; overflow: hidden; text-overflow: ellipsis }
.entry-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Georgia, serif; font-size: 1rem }
.entry-status { color: var(--muted); font-size: .7rem }.list-empty { padding: 10px 20px; color: var(--muted) }
.paging { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 55px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem }
.paging button { width: 35px; height: 32px; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); background: none }

.entry-editor { padding-bottom: 14px }.editor-empty { display: grid; place-items: center; min-height: 420px; padding: 30px; text-align: center; color: var(--muted) }
.editor-heading { align-items: flex-end }.editor-heading .eyebrow { margin-bottom: 6px }.editor-heading h2 { overflow-wrap: anywhere }
.revision { font-size: .75rem; color: var(--muted) }.entry-meta { margin: 16px 24px; color: var(--muted); font-size: .8rem }
.text-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 24px }
.source-panel, .translation-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); background: rgba(20, 17, 24, .3); border-radius: 4px }
.source-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font: 1rem/1.7 Georgia, serif; margin: 0 }
.translation-heading { display: flex; justify-content: space-between; gap: 10px; align-items: start }.translation-heading span { color: var(--gold); font-size: .72rem; white-space: nowrap }
.translation-panel textarea:disabled { opacity: .6 }.editor-hint { margin: 10px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.5 }
.editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 15px 24px 0 }.editor-actions .message { margin: 0 auto 0 0 }

/* --- RESPONSIVE --- */
@media(max-width: 1050px) {
  .editor-layout { grid-template-columns: 280px minmax(0, 1fr) }
  .text-columns { grid-template-columns: 1fr }
  .source-panel pre { max-height: 190px; overflow: auto }
/* --- VUE DU COMPTE / PROFIL --- */
.account-view {
  max-width: 1580px;
  margin: 0 auto;
}
.account-card {
  max-width: 960px;
  margin: clamp(35px, 8vh, 90px) auto 0;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  box-shadow: 0 25px 70px rgba(10, 6, 13, .35);
  border-radius: 8px;
  overflow: hidden;
}

.account-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(30px, 5vw, 50px) 30px;
  border-right: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 50%, rgba(232, 194, 138, 0.12) 0%, rgba(65, 34, 58, 0.25) 50%, rgba(24, 18, 26, 0.7) 85%);
  position: relative;
  gap: 12px;
}

.account-avatar img {
  border-radius: 50%;
  background: #f8edda;
  padding: 5px;
  box-shadow: 0 0 20px rgba(232, 194, 138, 0.35);
}

.account-user-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  margin: 4px 0 0;
  color: var(--ink);
}

.account-role-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(232, 194, 138, 0.08);
}

.account-side-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 14px;
  max-width: 260px;
}

.account-content {
  padding: clamp(30px, 5vw, 55px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.account-content form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.account-content label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
}
.account-content label small {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.76rem;
}

.account-force-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(232, 194, 138, 0.45);
  background: rgba(232, 194, 138, 0.09);
  border-radius: 4px;
  margin-top: 16px;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--ink);
}
.account-force-alert .alert-icon {
  color: var(--gold);
  font-size: 1.1rem;
}
.account-force-alert p {
  margin: 0;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.user-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #2a1c25;
  background: var(--gold);
  padding: 2px 7px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* --- RESPONSIVE --- */
@media(max-width: 1050px) {
  .editor-layout { grid-template-columns: 280px minmax(0, 1fr) }
  .text-columns { grid-template-columns: 1fr }
  .source-panel pre { max-height: 190px; overflow: auto }
}
@media(max-width: 760px) {
  .login-card { grid-template-columns: 1fr }
  .account-card { grid-template-columns: 1fr }
  .account-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px;
  }
  .account-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .login-art {
    min-height: 250px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .vertical-carousel-wrapper { height: 230px; }
  .vertical-carousel-viewport { height: 210px; }
  .carousel-slot { height: 105px; }
  .carousel-logo.holiday { max-height: 60px; }
  .carousel-logo.mystery { max-height: 58px; }
  .carousel-logo.mirror { max-height: 52px; }
  .carousel-logo.pica { max-height: 48px; }
  .editor-layout { grid-template-columns: 1fr }
  .entry-list { max-height: 280px }
  .workspace-heading { align-items: flex-end }
  .project-logo { width: 110px }
  .editor-actions { flex-wrap: wrap }
  .editor-actions .message { flex-basis: 100% }
}
@media(max-width: 450px) {
  .topbar { align-items: flex-start }
  .session { display: grid; justify-items: end; gap: 4px }
  .brand strong { font-size: .66rem }
  .brand small { font-size: .49rem }
  .project-logo { display: none }
  .text-columns { padding: 0 15px }
  .panel-heading { padding: 17px 15px }
  .entry-meta { margin: 14px 15px }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

