#phototheque {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.phototheque-shell {
  width: min(1180px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(9, 156, 172, 0.98) 0%, rgba(11, 141, 164, 0.98) 100%);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: #ffffff;
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.phototheque-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-right: 56px;
}

.phototheque-header h2 {
  margin: 0 0 8px 0;
  font-size: 2rem;
  text-align: left;
  text-shadow: 2px 3px 8px rgba(0, 0, 0, 0.35);
}

.phototheque-header p {
  margin: 0;
  text-align: left;
  max-width: 760px;
  opacity: 0.95;
}

.phototheque-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #a80698;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.phototheque-close:hover {
  background: #820564;
}

.phototheque-selector-form,
.phototheque-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.phototheque-selector-form select,
.phototheque-form input,
.phototheque-form label {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border-radius: 14px;
  box-sizing: border-box;
}

.phototheque-selector-form select,
.phototheque-form input {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.92);
  color: #222;
}

.phototheque-selector-form label,
.phototheque-form label {
  text-align: left;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: none;
  padding: 8px 0;
}

.phototheque-btn {
  border: none;
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.phototheque-btn.primary {
  background: #a80698;
  color: #fff;
}

.phototheque-btn.primary:hover {
  background: #820564;
  transform: translateY(-2px);
}

.phototheque-btn.secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.phototheque-panel {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 24px;
  backdrop-filter: blur(4px);
  box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.22);
}

.phototheque-panel-head {
  margin-bottom: 20px;
  text-align: center;
}

.phototheque-panel-head h3 {
  margin: 10px 0 0;
  font-size: 1.4rem;
}

.phototheque-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(168, 6, 152, 0.9);
  color: #fff;
  font-size: 0.92rem;
  font-weight: bold;
}

.phototheque-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.phototheque-thumb {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease;
}

.phototheque-thumb:hover {
  transform: translateY(-4px);
}

.phototheque-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.phototheque-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 100%);
  color: #fff;
  font-weight: bold;
  text-align: center;
  font-size: 0.9rem;
}

.phototheque-message {
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  font-size: 1.1rem;
}

.phototheque-message.error {
  background: rgba(168, 6, 152, 0.3);
  color: #fff;
}

.phototheque-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.phototheque-viewer-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phototheque-figure img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.phototheque-nav {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(168, 6, 152, 0.8);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.phototheque-nav:hover {
  background: #a80698;
}

.phototheque-nav.prev {
  left: 20px;
}

.phototheque-nav.next {
  right: 20px;
}

.viewer-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 50px;
  height: 50px;
  background: #a80698;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}