html {
  background: var(--bordeaux);
}
body.guest {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: #fff;
  font-family: var(--ui-font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 20px max(30px, env(safe-area-inset-bottom));
}

/* ---------- En-tête ---------- */
.intro {
  text-align: center;
}
.paw {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 6px;
  border-radius: 12px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55);
}
.intro h1 {
  margin: 0.15em 0 0.3em;
  font-family: var(--title-font);
  font-weight: 300;
  font-size: clamp(28px, 8.2vw, 38px);
  line-height: 1.08;
}
.lead {
  max-width: 30ch;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.4;
  opacity: 0.86;
}

/* ---------- Polaroïd à remplir ---------- */
.composer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}
.composer[hidden] {
  display: none;
}
#pola {
  --w: min(78vw, 340px);
  transform: rotate(-1.3deg);
}
.picker {
  display: block;
  cursor: pointer;
}
.pick-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: repeating-linear-gradient(-45deg, #e9e5dc 0 14px, #e3dfd5 14px 28px);
  color: #6f6a60;
  font-size: 17px;
  font-weight: 600;
}
.pick-hint svg {
  width: 54px;
  height: 54px;
  fill: currentColor;
  opacity: 0.75;
}
.change {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.change[hidden],
#preview[hidden],
.pick-hint[hidden] {
  display: none;
}
#pola figcaption {
  overflow: visible;
}
#pola input {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
}
#pola input::placeholder {
  color: #aaa497;
  opacity: 1;
}
#pola:focus-within figcaption {
  background: linear-gradient(transparent 82%, rgba(138, 0, 10, 0.12) 82% 86%, transparent 86%);
}

/* ---------- Bouton et messages ---------- */
.btn {
  width: min(78vw, 340px);
  min-height: 54px;
  margin-top: 26px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--bordeaux);
  font: 600 18px var(--ui-font);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}
.progress {
  width: min(78vw, 340px);
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
}
.progress[hidden] {
  display: none;
}
.progress .bar {
  width: 0;
  height: 100%;
  background: #fff;
  transition: width 0.2s;
}
.msg {
  max-width: 340px;
  min-height: 1.4em;
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
}
.msg.error {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
}
.msg.ok {
  font-weight: 600;
}
.notice {
  margin-top: 26px;
  padding: 22px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 17px;
  line-height: 1.45;
  text-align: center;
}
.notice[hidden] {
  display: none;
}

/* ---------- Confirmation avant l'envoi ---------- */
html:has(.confirm[open]) {
  overflow: hidden;
}
.confirm {
  width: min(calc(100vw - 40px), 360px);
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.confirm::backdrop {
  background: rgba(38, 0, 4, 0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.confirm[open] {
  animation: confirm-in 0.24s cubic-bezier(0.2, 1.15, 0.4, 1);
}
.confirm[open]::backdrop {
  animation: confirm-fade 0.24s ease;
}
@keyframes confirm-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}
@keyframes confirm-fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .confirm[open],
  .confirm[open]::backdrop {
    animation: none;
  }
}
.confirm-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 22px 16px;
  text-align: center;
}
#confirm-pola {
  --w: min(46vw, 160px);
  margin: 0 0 22px;
  transform: rotate(-2deg);
}
#confirm-pola[hidden] {
  display: none;
}
.confirm h2 {
  margin: 0 0 6px;
  font-family: var(--title-font);
  font-weight: 300;
  font-size: 25px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.confirm p {
  margin: 0;
  color: #5e5a54;
  font-size: 16px;
  line-height: 1.45;
}
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 22px;
}
.confirm .btn {
  width: 100%;
  margin: 0;
  background: var(--bordeaux);
  color: #fff;
  box-shadow: 0 8px 20px rgba(138, 0, 10, 0.28);
}
.confirm .btn:focus-visible,
.btn-quiet:focus-visible {
  outline: 3px solid rgba(138, 0, 10, 0.35);
  outline-offset: 2px;
}
.btn-quiet {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: 600 16px var(--ui-font);
  cursor: pointer;
}
.btn-quiet:active {
  background: rgba(0, 0, 0, 0.05);
}

/* ---------- Mes photos ---------- */
.mine {
  margin-top: 44px;
}
.mine[hidden] {
  display: none;
}
.mine h2 {
  margin: 0 0 4px;
  font-family: var(--title-font);
  font-weight: 300;
  font-size: 24px;
  text-align: center;
}
.mine h2 span {
  font-size: 0.7em;
  opacity: 0.75;
}
.mine-help {
  margin: 0 0 20px;
  font-size: 13px;
  text-align: center;
  opacity: 0.72;
}
.mine-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mine-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mine-list .polaroid {
  --w: min(38vw, 168px);
  transform: rotate(-2deg);
}
.mine-list li:nth-child(even) .polaroid {
  transform: rotate(2.2deg);
}
.badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 600;
}
.del {
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: 500 14px var(--ui-font);
  cursor: pointer;
}
.del:disabled {
  opacity: 0.5;
}

/* ---------- Pied de page ---------- */
.foot {
  margin-top: 46px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0.78;
}
.foot p {
  margin: 0 0 8px;
}
.foot a {
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
#contact[hidden] {
  display: none;
}
