/* ================================
   CONTACT PAGE — light theme
   ================================ */

.contact-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Full-page blue gradient — solid colors, fixed attachment so it stays as you scroll */
  background:
    linear-gradient(
      180deg,
      #0c1a3a 0%,
      #142244 8%,
      #1c3860 18%,
      #244b7a 30%,
      #3d6a9a 44%,
      #7099be 58%,
      #a8c2d8 72%,
      #d4e4ef 84%,
      #f5f8fb 92%,
      #ffffff 100%
    );
  background-attachment: fixed;
  background-size: 100% 100%;
  color: #0d0d0d;
}

/* Noise grain over the gradient (fine texture / aspérité) */
.contact-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cNoise)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

.contact-page > * {
  position: relative;
  z-index: 1;
}

/* Navbar */
.contact-page .navbar {
  background: transparent;
  border-bottom: none;
}

.contact-page .navbar__logo {
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.25);
}

.navbar__back {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.navbar__back:hover {
  color: #ffffff;
}

/* Main */
.contact-page main.contact {
  flex: 1;
  padding: 3rem 1.5rem 5rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.contact__container {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* Header */
.contact__header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.contact__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 1rem;
  text-shadow: 0 1px 12px rgba(0,0,0,0.25), 0 2px 30px rgba(0,0,0,0.15);
}

.contact__title span {
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
}

.contact__subtitle {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  max-width: 38rem;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 0 1px 12px rgba(0,0,0,0.2);
}

/* Progress */
.contact__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.contact__progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.contact__progress-dot.active {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.65);
}

.contact__progress-dot.done {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.7);
}

.contact__progress-line {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

/* Form card */
.contact__form {
  width: 100%;
  min-height: 380px;
  padding: 2.5rem 2.25rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1.25rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -12px rgba(36, 75, 122, 0.18);
}

/* Steps */
.form-step {
  display: none;
  animation: fadeStep 0.4s ease;
}

.form-step.active {
  display: block;
}

@keyframes fadeStep {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-step__title {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 500;
  color: #0d0d0d;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

/* Fields */
.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.65);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.form-field__optional {
  font-weight: 400;
  color: rgba(0, 0, 0, 0.4);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.25rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: #0d0d0d;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.625rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: rgba(0, 0, 0, 0.32);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue-light);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(107, 159, 212, 0.18);
}

.form-field input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: rgba(165, 34, 40, 0.45);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.form-field__hint {
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.45);
  margin-top: 0.5rem;
}

/* Honeypot (hidden) */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Textarea + dictation */
.form-textarea-wrap {
  position: relative;
}

.dictation-btn {
  position: absolute;
  bottom: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  color: rgba(0, 0, 0, 0.65);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.dictation-btn:hover {
  color: #0d0d0d;
  border-color: rgba(0, 0, 0, 0.25);
}

.dictation-btn.listening {
  color: #ffffff;
  background: #cc3333;
  border-color: #cc3333;
  box-shadow: 0 0 0 4px rgba(204, 51, 51, 0.18);
  animation: btn-pulse 1.6s ease-in-out infinite;
}

.dictation-btn.listening .dictation-btn__icon {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(204, 51, 51, 0.18); }
  50%      { box-shadow: 0 0 0 8px rgba(204, 51, 51, 0.06); }
}

/* Actions */
.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* btn-primary: keep landing-page cosmic gradient hover, just resize for form context */
.contact-page .btn-primary {
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  border: 1px solid rgba(0, 0, 0, 0.12); /* subtle outline so white button is visible on white card */
}

.contact-page .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* btn-secondary: light theme variant */
.contact-page .btn-secondary {
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  background: transparent;
  color: #0d0d0d;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.contact-page .btn-secondary:hover {
  border-color: rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.02);
}

/* Recap */
.form-recap {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.form-recap__row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.form-recap__label {
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.8125rem;
  padding-top: 2px;
}

.form-recap__value {
  color: #0d0d0d;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Success & error */
.form-success,
.form-error {
  text-align: center;
  padding: 1rem 0;
}

.form-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(107, 159, 212, 0.15);
  border: 1px solid rgba(107, 159, 212, 0.45);
  color: #244b7a;
  font-size: 1.625rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.form-success__text,
.form-error__text {
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.form-success__text strong {
  color: #0d0d0d;
}

.form-error__text a {
  color: #244b7a;
  text-decoration: underline;
}

.form-success .btn-secondary {
  margin: 0 auto;
}

/* Footer override for white page */
.contact-page .footer-wrapper {
  background: #ffffff;
}

.contact-page .footer {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.contact-page .footer__copy {
  color: rgba(0, 0, 0, 0.4);
}

.contact-page .footer__links {
  color: rgba(0, 0, 0, 0.4);
}

.contact-page .footer__links a:hover {
  color: rgba(0, 0, 0, 0.65);
}

.contact-page .footer__star {
  filter: invert(1) brightness(0.4);
  opacity: 0.18;
}

/* Mobile */
@media (max-width: 640px) {
  .contact-page main.contact {
    padding: 2rem 1rem 4rem;
  }
  .contact__form {
    padding: 1.75rem 1.25rem;
  }
  .form-step__title { font-size: 1.4rem; }
  .form-actions { flex-direction: column-reverse; gap: 0.625rem; }
  .form-actions .btn-primary,
  .form-actions .btn-secondary { width: 100%; }
  .form-recap__row { grid-template-columns: 1fr; gap: 0.25rem; }
}
