:root {
  --bg: #f5faff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #60a5fa;     /* bleu ciel */
  --accent-soft: #dbeafe;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}


.topbar {
  position: sticky;
  top: 0;
  background: rgba(245,250,255,.9);
  backdrop-filter: blur(12px);
  z-index: 1000;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--accent-soft);
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
}

.nav button {
  background: none;
  border: none;
  margin-left: 14px;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
}
.nav button:hover {
  color: var(--accent);
}

/* CONTAINER */
.container {
  max-width: 720px;
  margin: 30px auto;
  padding: 0 14px;
}

/* CARD / POST */
.work {
  position: relative;
  background: var(--card);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(96,165,250,0.15);
}

/* HEADER */
.workTitle {
  font-size: 18px;
  font-weight: 700;
}
.workMeta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* PDF VIEW */
.pdf-viewer {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 18px;
  margin: 18px 0;
  border: none;
  z-index: 1;
}

/* ACTIONS */
.actions {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.icon-btn {
  cursor: pointer;
  font-size: 20px;
  user-select: none;
}
.icon-btn:hover {
  transform: scale(1.1);
}

/* FEEDBACK */
.feedback {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  background: #f8fbff;
  color: var(--text);
}

select:disabled {
  opacity: .6;
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.role-choice {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.role-btn {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  font-size: 16px;
  border: 1px solid var(--accent-soft);
  cursor: pointer;
  text-align: left;
}

.role-btn span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.role-btn.primary {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  color: var(--muted);
}

.form-group input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  font-size: 15px;
}

.role-btn.active {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 6px;
  font-size: 14px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.link-btn:hover {
  color: #2563eb;
}

#btnLogout {
  color: #ef4444;
}

#btnLogout:hover {
  color: #dc2626;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(96,165,250,0.15);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-top: 12px;
}

.checkbox input {
  accent-color: var(--accent);
}

.btn-primary {
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(
    135deg,
    var(--accent),
    #3b82f6
  );
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(96,165,250,0.35);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(96,165,250,0.45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(96,165,250,0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--card);
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(96,165,250,0.15);
  text-align: center;
  font-size: 14px;
}
.stat-card strong {
  display: block;
  font-size: 22px;
  margin-top: 6px;
}

textarea {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
}

.info-box {
  background: #f8fbff;
  border: 1px solid var(--accent-soft);
  padding: 16px;
  border-radius: 16px;
  font-size: 14px;
  margin: 20px 0;
}

.dropzone {
  border: 2px dashed var(--accent-soft);
  border-radius: 20px;
  padding: 28px;
  margin: 20px 0;
  cursor: pointer;
  background: #f8fbff;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dropzone-icon {
  font-size: 34px;
}

.dropzone-text strong {
  display: block;
  font-size: 15px;
}

.dropzone-text span {
  font-size: 13px;
  color: var(--muted);
}

.dropzone:hover {
  border-color: var(--accent);
  background: #eef5ff;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #eaf1ff;
}
.genres {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}

.genre-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #2563eb;
  font-weight: 600;
  font-size: 14px;
}

.pitch-toggle {
  margin: 10px 0 6px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.pitch-toggle:hover {
  color: #475569;
}

.pitch-box {
  background: #f8fbff;
  border: 1px solid var(--accent-soft);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.work-links {
  margin: 14px 0 0;
  font-size: 14px;

  display: flex;
  flex-direction: column;
  align-items: center;   /* 👈 centre horizontalement */
  text-align: center;    /* 👈 centre le texte */
  gap: 6px;
}

.work-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.work-links a:hover {
  text-decoration: underline;
}

.search-layer {
  position: sticky;
  top: 90px;
  z-index: 50;
}

.search-wrapper {
  max-width: 100%;
  margin: 0 auto;

  display: flex;
  justify-content: flex-end;

  padding-right: 40px; /* distance depuis le bord écran */
}

body:has(.topbar) .search-wrapper {
  transform: translateY(0);
}

.search-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.search-box input {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  font-size: 14px;
  width: 260px;
}

.search-box button {
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  background: white;
  padding: 10px 14px;
  cursor: pointer;
}

.hidden {
  display: none;
}
.btn-lite {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent-soft);
  background: white;
  cursor: pointer;
  color: var(--text);
}

.btn-lite:hover {
  border-color: var(--accent);
}

.pal-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.pal-item {
  background: var(--card);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(96,165,250,0.15);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.pal-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(96,165,250,0.25);
}

.pal-item-title {
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}

.pal-item-author {
  font-size: 12px;
  color: var(--muted);
}

.pal-card {
  background: white;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(96,165,250,0.18);
  transition: transform .15s ease;
}

.pal-card:hover {
  transform: translateY(-2px);
}

.pal-card strong {
  display: block;
  font-size: 15px;
}

.pal-card span {
  font-size: 13px;
}


.reader {
  position: fixed;
  inset: 0;
  background: #000;
  display: grid;
  grid-template-columns: 60px 1fr;
  z-index: 1000;
}

.reader.hidden {
  display: none;
}

.reader-center {
  height: 100vh;
  overflow-y: auto;
  background: #111;
}


.reader-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.reader-btn {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 999px; /* forme pillule */
  border: 1px solid rgba(255, 255, 255, 0.18);

  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);

  cursor: pointer;
  font-size: 14px;
  font-weight: 500;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.reader-btn .icon {
  font-size: 16px;
}

.reader-btn .label {
  white-space: nowrap;
}

/* hover */
.reader-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* état actif (BLEU) */
.reader-btn.active {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.8);
  color: #60a5fa;
}

/* clic */
.reader-btn:active {
  transform: translateY(0);
}

/* canvas pdf.js */
#pdfContainer canvas {
  display: block;
  margin: 20px auto;
}

.pal-card {
  cursor: pointer;
  position: relative;
}

.pal-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.pal-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}


#btnCloseReader {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 22px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 10;
}


.bookmark-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  color: white;

  padding: 10px 18px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 500;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 2000;

  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bookmark-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

.bookmark-hint.hidden {
  display: none;
}


.comment-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.comment-modal.hidden {
  display: none;
}

.comment-box {
  background: white;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.comment-layer {
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-box h3 {
  margin-top: 0;
  font-size: 18px;
}

.comment-page {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
}

.comment-box label {
  display: block;
  font-size: 13px;
  color: #475569;
  margin-top: 12px;
}

.comment-box input,
.comment-box textarea,
.comment-box select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #cbd5f5;
  font-family: inherit;
  font-size: 14px;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.pdf-comment {
  position: absolute;
  right: -220px; /* sort légèrement de la page */
  top: 40px;

  width: 200px;
  background: #fff9c4;
  border-radius: 10px;
  padding: 10px 12px;

  font-size: 13px;
  color: #333;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);

  transform: rotate(-1deg);
}

.pdf-comment + .pdf-comment {
  margin-top: 10px;
}

.pdf-comment-category {
  font-weight: 700;
  font-size: 12px;
  color: #6b4f00;
}

.pdf-comment-title {
  font-weight: 600;
  margin: 4px 0;
}

.pdf-comment-detail {
  font-size: 12px;
  color: #444;
}

.pdf-page {
  position: relative;
  margin: 20px auto 40px;
  overflow: visible;
}

#pdfContainer canvas {
  display: block;
  margin: 0 auto;
}

.pdf-comment-note {
  position: absolute;
  right: -300px;
  width: 240px;

  background: #fff8c5;
  border-left: 5px solid #facc15;
  padding: 12px 14px;
  border-radius: 10px;

  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 10;
}

.pdf-comment-note .cat {
  font-weight: 700;
  font-size: 12px;
  color: #92400e;
}

.pdf-comment-note .title {
  font-style: italic;
  margin: 4px 0;
}

.pdf-comment-note .detail {
  margin-top: 6px;
  font-size: 12px;
  color: #374151;
}

.pdf-layer {
  position: relative;
  margin: 0 auto;
}

.pdf-bookmark {
  position: absolute;
  right: 150px;
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  cursor: pointer;
  z-index: 20;
  opacity: 0.95;
}

.pdf-bookmark:hover {
  transform: translateY(-50%) scale(1.08);
}

.pdf-comment-note {
  position: absolute;
  right: 100px;
  width: 240px;

  background: #fff8c5;
  border-left: 5px solid #facc15;
  padding: 12px 14px;
  border-radius: 10px;

  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 10;
}

.review-box {
  text-align: center;
}

.review-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 18px;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 10px;
}

.stars span {
  font-size: 36px;
  cursor: pointer;
  color: #e5e7eb; /* gris doux */
  transition:
    color 0.2s ease,
    transform 0.15s ease,
    text-shadow 0.2s ease;
}

.stars span:hover,
.stars span.hovered {
  color: #facc15;
  transform: scale(1.15);
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.stars span.selected {
  color: #f59e0b;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
}

.review-label {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
}

.pal-card {
  position: relative;
}

.pal-rating {
  position: absolute;
  top: 12px;
  right: 14px;

  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1f2937;

  font-size: 13px;
  font-weight: 700;

  padding: 6px 10px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  gap: 4px;

  box-shadow: 0 6px 18px rgba(250, 204, 21, 0.45);
}

.btnDelete {
  position: absolute;
  top: 14px;
  right: 14px;

  width: 36px;
  height: 36px;
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);

  border: 1px solid #e5e7eb;
  color: #ef4444;

  font-size: 16px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.btnDelete:hover {
  background: #fee2e2;
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(239,68,68,0.35);
}

.btnDelete:active {
  transform: scale(0.95);
}
#feedSentinel {
  height: 40px;
}

.share-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.2rem;
  margin: 1.5rem 0;
  box-shadow: 0 10px 25px rgba(0,0,0,.05);
}

.share-card h3 {
  margin: 0 0 .5rem;
}

.share-card p {
  color: var(--muted);
  font-size: .95rem;
}

.share-buttons {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
   justify-content: center;
}

.share-buttons button {
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  padding: .5rem .9rem;
  border-radius: .6rem;
  cursor: pointer;
  font-size: .85rem;

}

.share-buttons button:hover {
  background: var(--accent);
  color: white;
}

select.done {
  background: #eef5ff;
  border-color: var(--accent-soft);
  color: #475569;
}