/*
  Palette : papier clair et encre — un formulaire sobre, lisible en plein jour
  comme après une session en mode sombre.
  bg          #F6F4EF  papier clair, presque blanc, fond de page
  fg          #1B1A17  encre presque noire, texte principal
  muted       #1B1A17  (à opacité réduite) texte secondaire
  accent      #2B3A55  bleu d'encre, liens / bouton / focus
  accent-ink  #F3F5F8  texte sur fond accent
  line        #E2DED3  ligne fine, séparations
  error       #8C2F26  rouge d'annotation, messages d'erreur
*/

:root {
  --bg: #f6f4ef;
  --fg: #1b1a17;
  --accent: #2b3a55;
  --accent-ink: #f3f5f8;
  --line: #e2ded3;
  --error: #8c2f26;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4rem 1.6rem;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2.4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.brand-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.brand-name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 0;
}

.brand-tagline {
  font-size: 0.9rem;
  color: var(--fg);
  opacity: 0.65;
  margin: 0.15rem 0 0;
}

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

.intro {
  font-size: 1.05rem;
  color: var(--fg);
  opacity: 0.75;
  margin: 0 0 2.4rem;
  line-height: 1.55;
}

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;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.file-button {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  border-radius: 0;
  display: inline-block;
}

.file-button:hover {
  background: var(--fg);
  color: var(--bg);
}

.field:has(input[type="file"]:disabled) .file-button,
.field:has(input[type="file"]:disabled) .field-hint {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.file-name {
  font-size: 0.95rem;
  color: var(--fg);
  opacity: 0.7;
}

.field-hint {
  font-size: 0.85rem;
  opacity: 0.6;
}

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

#upload-form button[type="submit"]:hover,
#reset-button:hover {
  background: #4a473f;
}

#upload-form button[type="submit"]:disabled {
  background: var(--line);
  color: #8a867a;
  cursor: not-allowed;
}

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

.note {
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.65;
  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-row {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
  margin: 0 0 1.2rem;
}

.result-uuid {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.result-uuid-row .text-button {
  flex: 0 0 auto;
  align-self: center;
}

.icon-button {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: #000;
}

.icon-button:hover svg {
  opacity: 0.7;
}

.icon-button .icon-check {
  display: none;
  fill: #1a7f37;
}

.icon-button.is-copied .icon-copy {
  display: none;
}

.icon-button.is-copied .icon-check {
  display: block;
}

.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);
}

.verify-heading {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--fg);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.verify-heading:hover {
  opacity: 0.75;
}

.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(--fg);
}

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

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

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

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

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

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

@media (max-width: 480px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

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

  h1 {
    font-size: 1.9rem;
  }
}
