/* Demande de badge JACI — feuille A4 élégante */

:root {
  --jaci-ink: #1a1c1a;
  --jaci-muted: #5a5e5a;
  --jaci-faint: #8a8e8a;
  --jaci-line: #d8dbd6;
  --jaci-paper: #fffcf7;
  --jaci-desk: #e8ebe4;
  --jaci-green: #00853f;
  --jaci-gold: #c9a227;
  --jaci-red: #d41920;
  --jaci-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --jaci-display: "Fraunces", "Times New Roman", serif;
}

html:has(body.jaci-badge-public),
body.jaci-badge-public {
  margin: 0;
  min-height: 100%;
}

body.jaci-badge-public {
  min-height: 100dvh;
  font-family: var(--jaci-sans);
  color: var(--jaci-ink);
  background: var(--jaci-desk);
  -webkit-font-smoothing: antialiased;
}

body.jaci-badge-public *,
body.jaci-badge-public *::before,
body.jaci-badge-public *::after {
  box-sizing: border-box;
}

.jaci-sheet-desk {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 2.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(0, 133, 63, 0.07), transparent 55%),
    radial-gradient(ellipse 40% 35% at 100% 80%, rgba(212, 25, 32, 0.04), transparent 50%),
    linear-gradient(180deg, #f0f2ec 0%, var(--jaci-desk) 45%, #dde0d8 100%);
}

/* Feuille A4 (proportion 210×297) */
.jaci-sheet {
  width: min(210mm, 100%);
  min-height: min(297mm, auto);
  background: var(--jaci-paper);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 12px 28px rgba(40, 50, 40, 0.1),
    0 40px 80px rgba(40, 50, 40, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: jaci-sheet-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes jaci-sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.jaci-sheet__stripe {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 3px;
  flex-shrink: 0;
}

.jaci-sheet__stripe span:nth-child(1) { background: var(--jaci-green); }
.jaci-sheet__stripe span:nth-child(2) { background: var(--jaci-gold); }
.jaci-sheet__stripe span:nth-child(3) { background: var(--jaci-red); }

/* En-tête institutionnel */
.jaci-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.75rem 1.1rem;
  border-bottom: 1px solid var(--jaci-line);
}

.jaci-sheet__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.jaci-sheet__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.jaci-sheet__brand-text {
  min-width: 0;
}

.jaci-sheet__org {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--jaci-ink);
}

.jaci-sheet__org-sub {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  color: var(--jaci-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.jaci-sheet__doc-meta {
  text-align: right;
  flex-shrink: 0;
}

.jaci-sheet__doc-ref {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jaci-green);
}

.jaci-sheet__doc-place {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--jaci-muted);
  line-height: 1.4;
}

/* Corps du document */
.jaci-sheet__body {
  flex: 1;
  padding: 1.5rem 1.75rem 1.25rem;
}

.jaci-sheet__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jaci-green);
  animation: jaci-fade-up 0.5s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.jaci-sheet__title {
  margin: 0 0 0.55rem;
  font-family: var(--jaci-display);
  font-size: clamp(1.65rem, 4vw, 2.05rem);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--jaci-ink);
  animation: jaci-fade-up 0.5s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.jaci-sheet__lead {
  margin: 0 0 1.35rem;
  max-width: 38em;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--jaci-muted);
  animation: jaci-fade-up 0.5s 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes jaci-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.jaci-sheet__rule {
  height: 1px;
  margin: 0 0 1.25rem;
  background: linear-gradient(90deg, var(--jaci-line), transparent 85%);
  border: 0;
}

/* Formulaire type document */
.jaci-sheet__form {
  display: grid;
  gap: 0.95rem;
}

.jaci-sheet__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem 1.1rem;
}

.jaci-sheet__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.jaci-sheet__field--full {
  grid-column: 1 / -1;
}

.jaci-sheet__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jaci-faint);
}

.jaci-sheet__form .bo-input,
.jaci-sheet__form .bo-textarea,
.jaci-sheet__form select.bo-input {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.15rem 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--jaci-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--jaci-line);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.jaci-sheet__form select.bo-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a8e8a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding-right: 1.25rem;
}

.jaci-sheet__form .bo-input:focus,
.jaci-sheet__form .bo-textarea:focus,
.jaci-sheet__form select.bo-input:focus {
  border-bottom-color: var(--jaci-green);
  box-shadow: 0 1px 0 0 var(--jaci-green);
}

.jaci-sheet__form .bo-textarea {
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.45;
}

.jaci-sheet__error {
  margin: 0;
  font-size: 0.78rem;
  color: var(--jaci-red);
}

.jaci-sheet__alert {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--jaci-ink);
  background: rgba(0, 133, 63, 0.07);
  border-left: 3px solid var(--jaci-green);
}

.jaci-sheet__actions {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}

.jaci-sheet__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.65rem 1.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--jaci-ink);
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.jaci-sheet__submit:hover {
  background: var(--jaci-green);
}

.jaci-sheet__submit:active {
  transform: translateY(1px);
}

.jaci-sheet__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--jaci-faint);
  line-height: 1.4;
}

/* Pied de page document */
.jaci-sheet__foot {
  margin-top: auto;
  padding: 1rem 1.75rem 1.25rem;
  border-top: 1px solid var(--jaci-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.jaci-sheet__foot p {
  margin: 0;
  font-size: 0.68rem;
  color: var(--jaci-faint);
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.jaci-sheet__foot a {
  color: var(--jaci-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jaci-sheet__foot a:hover {
  color: var(--jaci-green);
}

/* Page merci */
.jaci-sheet--thanks .jaci-sheet__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 280px;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.jaci-sheet__seal {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border: 1.5px solid var(--jaci-green);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--jaci-green);
  font-size: 1.25rem;
  font-weight: 700;
  animation: jaci-fade-up 0.5s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.jaci-sheet__link-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 1.5rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--jaci-ink);
  text-decoration: none;
  border: 1px solid var(--jaci-line);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.jaci-sheet__link-btn:hover {
  border-color: var(--jaci-ink);
  color: var(--jaci-green);
}

@media (max-width: 640px) {
  /* 16 px minimum : pas de zoom automatique sur iOS + zones tactiles confortables */
  .jaci-sheet__form .bo-input,
  .jaci-sheet__form .bo-textarea,
  .jaci-sheet__form select.bo-input {
    font-size: 1rem;
    min-height: 2.75rem;
  }

  .jaci-sheet-desk {
    padding: 1rem 0.65rem 2rem;
  }

  .jaci-sheet__head {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.1rem 1.15rem 1rem;
  }

  .jaci-sheet__doc-meta {
    text-align: left;
  }

  .jaci-sheet__body {
    padding: 1.15rem 1.15rem 1rem;
  }

  .jaci-sheet__row {
    grid-template-columns: 1fr;
  }

  .jaci-sheet__foot {
    padding: 0.9rem 1.15rem 1.1rem;
    flex-direction: column;
  }

  .jaci-sheet__logo {
    width: 48px;
    height: 48px;
  }
}

@media print {
  body.jaci-badge-public {
    background: #fff;
  }

  .jaci-sheet-desk {
    padding: 0;
    background: none;
    min-height: auto;
  }

  .jaci-sheet {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
    border: 0;
    animation: none;
  }

  .jaci-sheet__submit,
  .jaci-sheet__actions,
  .jaci-sheet__link-btn {
    display: none !important;
  }
}
