.brw-widget {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 900px;
  margin: 2rem auto;
}

.brw-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.brw-btn-primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}
.brw-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45);
}

.brw-btn-secondary {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}
.brw-btn-secondary:hover {
  background: #e5e7eb;
}

.brw-btn-ghost {
  background: transparent;
  border-color: #d1d5db;
  color: #374151;
}
.brw-btn-ghost:hover {
  background: #f3f4f6;
}

/* Modal générique */
.brw-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.brw-modal[aria-hidden="false"] {
  display: block;
}
.brw-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}
.brw-modal-panel {
  position: relative;
  max-width: 900px;
  margin: 3vh auto;
  background: radial-gradient(circle at top left, #1f2937, #020617);
  color: #e5e7eb;
  border-radius: 1.2rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  padding: 1.5rem 1.75rem;
}
.brw-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.brw-modal-close:hover {
  color: #e5e7eb;
}
.brw-modal-content {
  display: flex;
  gap: 1.75rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.brw-modal-content-list {
  flex-direction: column;
}

/* Couverture */
.brw-book-cover {
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brw-book-cover-inner {
  position: relative;
  width: 180px;
  height: 260px;
  perspective: 1000px;
}
.brw-book-cover-spine {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1d4ed8, #4f46e5);
  border-radius: 10px;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.6);
  transform: rotateY(-18deg);
}
.brw-book-cover-front {
  position: absolute;
  inset: 10px;
  background: linear-gradient(145deg, #0f172a, #1d4ed8);
  border-radius: 10px;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #e5e7eb;
}
.brw-book-cover-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.brw-book-cover-author {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Détails du livre & formulaire */
.brw-book-details {
  flex: 1 1 0;
  min-width: 260px;
}
.brw-book-title {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.25rem;
}
.brw-book-meta {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.brw-book-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e5e7eb;
}
.brw-divider {
  border: none;
  border-top: 1px solid rgba(55, 65, 81, 0.7);
  margin: 1.25rem 0 1rem;
}
.brw-section-title {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.brw-form {
  font-size: 0.95rem;
}
.brw-field {
  margin-bottom: 0.85rem;
}
.brw-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.brw-stars {
  display: inline-flex;
  gap: 0.15rem;
}
.brw-star {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #4b5563;
  transition: transform 0.1s, color 0.1s;
}
.brw-star:hover {
  transform: translateY(-1px) scale(1.05);
}
.brw-star.brw-star-active {
  color: #facc15;
}

.brw-textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #374151;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 0.5rem 0.7rem;
  resize: vertical;
  font-size: 0.95rem;
}
.brw-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.7);
}

.brw-char-counter {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: right;
}

.brw-actions-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.brw-message {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.brw-message--success {
  color: #4ade80;
}
.brw-message--error {
  color: #f97373;
}

/* Liste des avis */
.brw-review-list {
  margin-top: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}
.brw-review-item {
  border-radius: 0.9rem;
  border: 1px solid #1f2937;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
}
.brw-review-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 0.2rem;
}
.brw-review-text {
  font-size: 0.95rem;
  color: #e5e7eb;
  white-space: pre-wrap;
}
.brw-review-stars {
  color: #facc15;
}
.brw-empty-message {
  font-size: 0.95rem;
  color: #9ca3af;
}

@media (max-width: 768px) {
  .brw-modal-panel {
    margin: 1rem;
    padding: 1rem 1.1rem;
  }
  .brw-modal-content {
    flex-direction: column;
  }
  .brw-book-cover {
    justify-content: flex-start;
  }
}