/*
  Palette : encre et papier — inspirée de la nature morte au porte-plume.
  paper   #DDD4BC  parchemin vieilli, fond du panneau formulaire
  ink     #262420  encre presque noire, texte principal
  panel   #1B1A17  encre profonde, fond du panneau image
  accent  #33475B  bleu d'encre ancienne, focus / bouton
  brass   #A4813C  laiton, accent secondaire / état de réussite
  line    #B8AD8E  ligne fine, séparations
*/

:root {
  --paper: #ddd4bc;
  --ink: #262420;
  --panel: #1b1a17;
  --accent: #33475b;
  --accent-ink: #eef1f4;
  --brass: #8a6a2f;
  --line: #b8ad8e;
  --error: #7a2e22;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", "Iowan Old Style", Georgia, serif;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.hero {
  position: relative;
  background: var(--panel);
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.94;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset -40px 0 60px -40px rgba(0, 0, 0, 0.6);
}

.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 3rem;
}

.panel-inner {
  width: 100%;
  max-width: 27rem;
}

h1 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 2.5rem;
  line-height: 1.15;
  margin: 0 0 0.6rem;
  letter-spacing: 0.01em;
}

.intro {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
  opacity: 0.82;
  margin: 0 0 2.4rem;
  line-height: 1.5;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.field-label {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

input[type="file"] {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1rem;
  color: var(--ink);
}

input[type="file"]::file-selector-button {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  margin-right: 0.9rem;
  cursor: pointer;
  border-radius: 0;
}

input[type="file"]::file-selector-button:hover {
  background: var(--ink);
  color: var(--paper);
}

.field-hint {
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.72;
}

#upload-form button[type="submit"],
#reset-button {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 0;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 0.15s ease;
}

#upload-form button[type="submit"]:hover,
#reset-button:hover {
  background: var(--ink);
}

#upload-form button[type="submit"]:disabled {
  background: var(--line);
  color: var(--ink);
  cursor: progress;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.note {
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.75;
  margin: 0;
}

.error {
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  color: var(--error);
  border-left: 2px solid var(--error);
  padding-left: 0.7rem;
  margin: 0;
}

.result {
  animation: reveal 0.4s ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-label {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0 0 0.6rem;
}

.result-uuid {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  word-break: break-all;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  margin: 0 0 1.2rem;
}

.result .note {
  margin-bottom: 1.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .result {
    animation: none;
  }
}

.verify {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.text-button {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
}

#verify-form {
  margin-top: 1.1rem;
  gap: 1rem;
}

#verify-uuid {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.3rem 0;
  color: var(--ink);
}

#verify-uuid:focus-visible {
  outline: none;
  border-bottom-color: var(--brass);
}

.back-link {
  margin-top: 2.2rem;
}

.back-link a {
  font-style: italic;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.back-link a:hover {
  color: var(--ink);
}

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
  }

  .hero {
    height: 34vh;
  }

  .hero::after {
    box-shadow: inset 0 -40px 60px -40px rgba(0, 0, 0, 0.6);
  }

  .panel {
    padding: 2.6rem 1.6rem 3.5rem;
  }

  h1 {
    font-size: 2.1rem;
  }
}
