/* Page upload invité — mobile-first, sobre, sans dépendance externe.
   Système de design partagé avec la galerie admin (src/admin/gallery/style.css) :
   mêmes tokens de couleur/rayon/ombre, pour une identité cohérente entre les
   deux écrans (voir docs/decisions.md pour le contexte produit). */

:root {
  color-scheme: light;

  /* Couleurs — palette chaude et sobre, cohérente avec l'identité perso de
     Kévin Lecou (Rêves Liquides). L'accent brun/terracotta est inchangé par
     rapport à la V1 déployée : on affine la palette autour, pas de rupture. */
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-surface-muted: #f2ede4;
  --color-text: #262420;
  --color-muted: #6f6a62;
  --color-border: #e3ddd2;

  --color-accent: #8a5a44;
  --color-accent-hover: #6e4735;
  --color-accent-soft: #f1e3d8;
  --color-accent-contrast: #ffffff;

  --color-error-bg: #fbeceb;
  --color-error-text: #7a1f14;
  --color-success-bg: #eaf3ec;
  --color-success-text: #1e5c2d;

  /* Rayon à deux niveaux : sm pour les petits éléments (inputs, chips),
     base pour les blocs/cards — donne une identité "arrondie/artisanale"
     un peu plus marquée que le 10px uniforme de la V1. */
  --radius-sm: 8px;
  --radius: 14px;

  --shadow-sm: 0 1px 2px rgba(38, 36, 32, 0.06);
  --shadow-md: 0 6px 20px rgba(38, 36, 32, 0.10);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.45;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 3rem;
  min-height: 100dvh;
}

.page__header {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Bloc de marque — discret, rassure l'invité (outil "pro") et signe le
   produit pour les organisateurs/prestataires qui verront la page.
   Volontairement minuscule : ce n'est pas l'écran de l'invité qui doit
   porter la marque de Kévin, c'est un clin d'œil en filigrane. */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  color: var(--color-muted);
}

.brand__mark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-accent);
}

.brand__name {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page__header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.15rem 0 0;
}

.state-block {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.state-block--error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.state-block--success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.state-block p {
  margin: 0 0 0.75rem;
}

.state-block p:last-child {
  margin-bottom: 0;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field .optional {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 0.85rem;
}

input[type="text"],
input[type="file"],
textarea {
  font: inherit;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: inherit;
  width: 100%;
}

input[type="file"] {
  padding: 0.55rem 0.5rem;
}

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

.photo-source-buttons {
  display: flex;
  gap: 0.6rem;
}

.btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 0.6rem;
  min-height: 48px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  background: var(--color-surface);
  cursor: pointer;
}

.btn-secondary:active {
  background: var(--color-accent-soft);
  transform: translateY(1px);
}

/* Icônes SVG inline (aucune requête réseau) : remplacent les emoji des
   boutons "Prendre une photo" / "Depuis la galerie". Le rendu des emoji
   varie fortement selon l'OS (Android/iOS/Windows) — pas assez maîtrisé
   pour une pièce de portfolio. Les icônes héritent de currentColor, donc
   suivent l'état du bouton sans CSS supplémentaire. */
.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.file-chosen-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 1px;
}

.preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--color-surface-muted);
}

.legal-notice {
  font-size: 0.8rem;
  color: var(--color-muted);
  background: var(--color-surface-muted);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  margin: 0;
}

.progress-text {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0;
  text-align: center;
}

button {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  min-height: 48px;
  cursor: pointer;
}

#submit-btn,
#add-another-btn {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  box-shadow: var(--shadow-sm);
}

#submit-btn:active:not(:disabled),
#add-another-btn:active {
  background: var(--color-accent-hover);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#retry-btn {
  background: var(--color-error-text);
  color: #fff;
}

button:active {
  transform: translateY(1px);
}
