@import url("./base.css");

/* ==========================================================
   Page de contact
   ========================================================== */

main .wrap { max-width: 44rem; }

.page-title {
  padding: 4.5rem 0 1.5rem;
}
.page-title h1 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.75rem, 10vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.05em;
  margin: 0;
}

form {
  display: grid;
  gap: 1.4rem;
  margin: 1rem 0 5rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 40rem) {
  form { padding: 2.25rem; }
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
input, textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  min-height: 3rem;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
input:hover, textarea:hover { border-color: var(--muted); }
input:focus, textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input.invalide, textarea.invalide {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}
textarea {
  min-height: 14rem;
  resize: vertical;
  line-height: 1.6;
}

form .btn {
  justify-self: start;
  min-width: 10rem;
}
.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  box-shadow: none;
}

/* ---------- Confirmation d'envoi ---------- */

.succes {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 60;
  cursor: pointer;
}
.succes.visible {
  display: flex;
  animation: fade 0.25s var(--ease);
}
.succes svg { width: 7rem; height: 7rem; }
.succes circle { fill: var(--ok); }
.succes path {
  fill: none;
  stroke: #fff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}
.succes.visible path { animation: trace 0.5s 0.15s var(--ease) forwards; }
.succes p {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0;
}
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 34rem) {
  .row { grid-template-columns: 1fr; }
  form .btn { justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .succes path { stroke-dashoffset: 0; }
}
