:root {
  --bg: #342620;
  --fg: #fde9c8;
  --muted: #9cc3fb;
  --accent: #e25e86;
  --beige: #fff;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
}

/* ===== Fond + frise ===== */
.page-contact {
  min-height: 100dvh;
  position: relative;
}

/* ===== Barre haute ===== */
.topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 2;
}
.back {
  display: inline-block;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 28px;
  padding: 8px 18px;
  transition: all 0.25s ease;
}
.back:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== Conteneur principal ===== */
.contact-wrap {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12vh 4vw 6vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2vh;
}
h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 96px);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ===== 2 colonnes ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
  align-items: start; /* la gauche reste compacte */
}
.col {
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
}

/* ===== Cartes ===== */
.card {
  background: color-mix(in srgb, #000 18%, transparent);
  backdrop-filter: blur(2px);
  border-radius: 14px;
  padding: 16px 18px;
}
.card h2 {
  margin: 0.1em 0 0.3em;
  font-size: clamp(18px, 2.2vw, 24px);
}
.card p {
  margin: 0.25em 0;
  color: var(--muted);
  font-size: clamp(14px, 1.2vw, 18px);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===== Formulaire ===== */
.card-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%; /* cette carte s’étire sur toute la hauteur de sa colonne */
}
form {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fg label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: clamp(13px, 1vw, 16px);
}
input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  font-size: clamp(14px, 1.1vw, 16px);
  font-family: inherit;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}
textarea {
  flex: 1;
  min-height: 160 px; /* pour agrandir visuellement la carte de droite */
  max-height: none;
  resize: none;
}

/* ===== Bouton ===== */
.submit-btn {
  justify-self: start;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 26px;
  padding: 10px 22px;
  font-size: clamp(14px, 1.1vw, 16px);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
}
.submit-btn:hover {
  background: #c94c72;
}

/* ===== Desktop ===== */
@media (min-width: 901px) {
  .contact-wrap {
    padding-top: 10vh;
    padding-bottom: 4vh;
  }
  .card {
    padding: 14px 16px;
  }
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .contact-wrap {
    height: auto;
    padding: 16vh 20px 10vh;
    grid-template-rows: auto auto;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr;
  }
}

/* ========================= */
/* Animations - Page Contact */
/* ========================= */

/* ===== Apparition du titre ===== */
.page-contact h1 {
  opacity: 0;
  transform: translateY(-12px);
  animation: contactTitleIn 600ms ease forwards 100ms;
}
@keyframes contactTitleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Apparition des cartes (stagger progressif) ===== */
.page-contact .card {
  opacity: 0;
  transform: translateY(10px);
  animation: contactCardIn 420ms ease forwards;
}
.page-contact .col:first-child .card:nth-child(1) {
  animation-delay: 80ms;
}
.page-contact .col:first-child .card:nth-child(2) {
  animation-delay: 160ms;
}
.page-contact .col:first-child .card:nth-child(3) {
  animation-delay: 240ms;
}
.page-contact .col:last-child .card-form {
  animation-delay: 180ms;
}

@keyframes contactCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Hover cartes ===== */
@media (hover: hover) and (pointer: fine) {
  .page-contact .card {
    transition: transform 220ms ease, box-shadow 220ms ease,
      background 220ms ease;
  }
  .page-contact .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    background: color-mix(in srgb, #000 22%, transparent);
  }
}

/* ===== Bouton animé ===== */
.page-contact .submit-btn {
  transition: transform 140ms ease, box-shadow 200ms ease, background 200ms ease;
  box-shadow: 0 6px 14px rgba(226, 94, 134, 0.25);
}
@media (hover: hover) and (pointer: fine) {
  .page-contact .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(226, 94, 134, 0.3);
  }
}
.page-contact .submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(226, 94, 134, 0.25);
}

/* ===== Focus doux sur les champs ===== */
.page-contact input,
.page-contact textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease,
    background 160ms ease;
}
.page-contact input:focus,
.page-contact textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* ===== Accessibilité ===== */
@media (prefers-reduced-motion: reduce) {
  .page-contact * {
    animation: none !important;
    transition: none !important;
  }
}
