/* ============================================================
   Design : "Certificat" — parchemin, filets or, sceau de cire
   Feuille de style commune : login, changement de mot de passe,
   profil superadmin, profil user — SAM-AC GestGrade
   ============================================================ */

:root {
  --parchment: #f6efdf;
  --parchment-deep: #ecdfc0;
  --paper: #fbf7ec;
  --ink: #2c2119;
  --ink-soft: #6b5d4d;
  --wine: #1f4b34;
  --wine-deep: #12301f;
  --gold: #a5792c;
  --gold-light: #cf9f45;
  --sage: #3d6349;
  --rose: #8a2331;
  --slate: #756a5b;
  --rule: rgba(165, 121, 44, 0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top, #fffdf7 0%, var(--parchment) 55%, var(--parchment-deep) 100%);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- En-tête / lettrine ---------- */

.letterhead {
  position: relative;
  flex: 0 0 auto;
  padding: clamp(0.7rem, 2.5vh, 1.3rem) 1.5rem clamp(0.6rem, 2vh, 1rem);
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.letterhead::before,
.letterhead::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 88%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
}
.letterhead::before { top: 7px; }
.letterhead::after   { top: 12px; }

.crest-wrap {
  display: inline-block;
  position: relative;
  animation: crest-in 700ms ease-out both;
}

@keyframes crest-in {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.crest-ring {
  width: clamp(52px, 9vh, 78px);
  height: clamp(52px, 9vh, 78px);
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 180deg, var(--gold-light), var(--gold), var(--gold-light), var(--gold), var(--gold-light));
  box-shadow: 0 10px 30px -8px rgba(61, 15, 23, 0.35);
}

.crest-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--paper);
  display: block;
}

.eyebrow {
  margin: clamp(6px, 1.2vh, 10px) 0 0;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.page-title {
  margin: clamp(0.25rem, 1vh, 0.5rem) 0 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.15rem, 3.2vh, 1.7rem);
  color: var(--ink);
  letter-spacing: 0.01em;
}

.page-title::after {
  content: "";
  display: block;
  width: 38px;
  height: 2px;
  margin: 8px auto 0;
  background: var(--gold);
}

/* ---------- Zone centrale ---------- */

.content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(0.6rem, 1.6vh, 1.2rem) 1.25rem;
}

/* ---------- Carte parchemin (formulaire) ---------- */

.parchment-card {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1rem, 2.6vh, 1.75rem) clamp(1.1rem, 3vw, 1.9rem);
  box-shadow: 0 18px 40px -22px rgba(61, 15, 23, 0.28);
  position: relative;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.parchment-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(165, 121, 44, 0.18);
  border-radius: 2px;
  pointer-events: none;
}

.parchment-card--sm { max-width: 420px; }
.parchment-card--md { max-width: 520px; }
.parchment-card--lg { max-width: 900px; }

.card-title-cert {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vh, 1.55rem);
  color: var(--wine-deep);
  margin: 0 0 clamp(0.9rem, 2.4vh, 1.5rem);
}

.card-title-cert::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: 8px auto 0;
  background: var(--gold);
}

/* ---------- Champs de formulaire ---------- */

.parchment-card .form-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.parchment-card .form-control {
  border: 1px solid rgba(44, 33, 25, 0.18);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 0.8rem;
  font-size: 0.92rem;
}

.parchment-card .form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(165, 121, 44, 0.16);
}

.parchment-card .form-control[readonly] {
  background: rgba(165, 121, 44, 0.06);
  color: var(--ink-soft);
}

.parchment-card .input-group .btn-outline-secondary {
  border: 1px solid rgba(44, 33, 25, 0.18);
  border-left: none;
  color: var(--ink-soft);
  background: #fff;
}

.parchment-card .input-group .btn-outline-secondary:hover,
.parchment-card .input-group .btn-outline-secondary:focus {
  background: rgba(165, 121, 44, 0.1);
  color: var(--wine);
  border-color: rgba(44, 33, 25, 0.18);
}

.parchment-card .mb-3,
.parchment-card .mb-4 {
  margin-bottom: clamp(0.6rem, 1.6vh, 1rem) !important;
}

/* ---------- Bouton sceau ---------- */

.btn-seal {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: clamp(0.4rem, 1.2vh, 0.8rem);
  background: linear-gradient(160deg, var(--wine), var(--wine-deep));
  color: #f6ead2 !important;
  border: 1px solid var(--gold);
  border-radius: 30px;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn-seal:hover {
  background: linear-gradient(160deg, #2f6b48, var(--wine-deep));
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -12px rgba(61, 15, 23, 0.55);
  color: #f6ead2;
}

.btn-seal:active { transform: translateY(0); }

.btn-seal:disabled,
.btn-seal.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Pied ---------- */

footer.foot {
  flex: 0 0 auto;
  text-align: center;
  padding: clamp(0.4rem, 1.2vh, 0.75rem) 1rem;
  color: var(--ink-soft);
  font-size: 0.7rem;
  border-top: 1px solid var(--rule);
}
