html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #16202b 0%, #0a0e14 70%);
}

#page {
  position: relative;
  display: flex;
  height: 100vh;
  width: 100vw;
}

#photobooth-scroll {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

#photobooth-stage {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  box-sizing: border-box;
}

#top-panel {
  flex: 0 0 320px;
  width: 320px;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(8, 11, 16, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

#top-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

#brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

#brand {
  font: 700 20px/1 system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  margin-right: 0.2em;
}

.brand-globe {
  color: #4fc3f7;
  margin-right: 0.2em;
}

.brand-trip {
  color: #ffcf3f;
}

#lang-switcher {
  position: relative;
  flex: 0 0 auto;
}

#lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 12px/1 system-ui, sans-serif;
  color: #e6ebf0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

#lang-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

#lang-toggle img {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  display: block;
}

#lang-toggle .bi-chevron-down {
  font-size: 9px;
  color: #98a2ae;
  margin-left: 1px;
  transition: transform 0.2s ease;
}

#lang-toggle[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

#lang-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 112px;
  background: rgba(12, 16, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: 20;
}

#lang-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 system-ui, sans-serif;
  color: #e6ebf0;
  padding: 8px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

#lang-list li img {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  display: block;
}

#lang-list li:hover {
  background: rgba(255, 255, 255, 0.08);
}

#lang-list li[aria-selected="true"] {
  background: rgba(79, 195, 247, 0.15);
  color: #4fc3f7;
}

#download-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 2em;
}

.download-text {
  margin: 0;
  text-align: center;
  color: rgba(230, 235, 240, 0.85);
  font: 13px/1.5 system-ui, sans-serif;
}

.store-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  color: #e6ebf0;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s ease;
}

.store-btn i {
  font-size: 1.2rem;
  color: #4fc3f7;
}

.store-btn:hover {
  background: rgba(10, 14, 20, 0.75);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.store-sub {
  font-size: 0.6rem;
  color: #98a2ae;
  line-height: 1;
}

.store-name {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1px;
}

.store-btn-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 700px) {
  #page {
    flex-direction: column;
  }

  #photobooth-scroll {
    flex: 1 1 auto;
  }

  #top-panel {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    max-height: 45vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ---- Écran d'upload ---- */

.photobooth-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.photobooth-upload h1 {
  margin: 0;
  color: #e6ebf0;
  font: 700 30px/1.2 system-ui, sans-serif;
}

.photobooth-intro {
  margin: 0;
  max-width: 46ch;
  color: rgba(230, 235, 240, 0.75);
  font: 15px/1.5 system-ui, sans-serif;
}

.photo-slots {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.photo-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.photo-slot:hover,
.photo-slot:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.photo-slot.empty .bi-plus-lg {
  font-size: 2rem;
  color: rgba(230, 235, 240, 0.4);
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(10, 14, 20, 0.75);
  color: #e6ebf0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.photo-remove:hover {
  background: rgba(10, 14, 20, 0.95);
}

.country-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
}

.country-field span {
  font: 600 13px/1 system-ui, sans-serif;
  color: #98a2ae;
}

.select-wrap {
  position: relative;
  width: 100%;
}

.country-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 40px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  /* Couleur pleine (pas rgba transparent) : le popup natif du <select> hérite
     de ce fond, un fond translucide y apparaîtrait presque blanc. */
  background-color: #12161d;
  color: #e6ebf0;
  font: 15px/1 system-ui, sans-serif;
  appearance: none;
  -webkit-appearance: none;
  /* Indique au navigateur de rendre le popup d'options en thème sombre —
     sans ça, Chrome/Windows affiche le texte clair sur un popup natif blanc
     (illisible), quel que soit le style CSS posé sur le <select> lui-même. */
  color-scheme: dark;
  cursor: pointer;
}

.country-field select:focus-visible {
  outline: 2px solid #4fc3f7;
  outline-offset: 1px;
}

.select-wrap .bi-chevron-down {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: #98a2ae;
  font-size: 13px;
  pointer-events: none;
}

.export-error {
  margin: 0;
  color: #ff8a80;
  font: 13px/1.5 system-ui, sans-serif;
  text-align: center;
  max-width: 40ch;
}

.generate-btn,
.result-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font: 700 15px/1 system-ui, sans-serif;
}

.generate-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  background: linear-gradient(135deg, #4fc3f7, #2b90c9);
  color: #06131c;
}

.generate-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.generate-btn:not(:disabled):hover {
  filter: brightness(1.08);
}

/* ---- Écran résultat ---- */

.photobooth-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.photobooth-canvas {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 10px;
}

.result-actions button {
  padding: 8px 16px;
  background: transparent;
  color: #e6ebf0;
}

.result-actions button:hover {
  color: #4fc3f7;
}

.result-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
}
