/* ============================================================
   Contact page — multi-step form
   ============================================================ */

.contact-page {
  /* Page has no hero — make navbar permanently solid */
}

.c-contact {
  padding-top: calc(var(--navbar-h) + var(--s-16));
  padding-bottom: var(--s-20);
  background: var(--color-bg);
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .c-contact {
    padding-top: calc(var(--navbar-h-mobile) + var(--s-10));
    padding-bottom: var(--s-12);
  }
}

.c-contact__header {
  max-width: 840px;
  margin: 0 auto var(--s-12);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

@media (max-width: 640px) {
  .c-contact__header {
    text-align: left;
    margin-bottom: var(--s-8);
  }
}

.c-contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: var(--ls-tight);
  color: var(--color-text-strong);
}

.c-contact__subtitle {
  color: var(--color-text-muted);
  font-size: var(--fs-base);
  max-width: 60ch;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .c-contact__subtitle { margin-inline: 0; }
}

/* === Form card ========================================== */
.c-contact__form-wrap {
  max-width: 440px;
  margin-inline: auto;
}

@media (max-width: 1024px) {
  .c-contact__form-wrap { max-width: 100%; }
}

.c-contact__form-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}

.c-contact__step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
  color: var(--color-text-strong);
  letter-spacing: var(--ls-tight);
}

.c-contact__step-help {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* === Progress bar ====================================== */
.c-stepbar {
  display: flex;
  gap: 6px;
  margin-bottom: var(--s-6);
}

.c-stepbar__seg {
  flex: 1;
  height: 4px;
  background: var(--gray-100);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.c-stepbar__seg::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--brand-red);
  border-radius: 999px;
  transition: width var(--t-base) var(--ease-out);
}

.c-stepbar__seg.is-complete::after { width: 100%; }
.c-stepbar__seg.is-current::after  { width: 100%; opacity: 0.85; }

[data-theme="dark"] .c-stepbar__seg { background: rgba(255,255,255,0.10); }

/* === Form fields ======================================= */
.c-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}

.c-field__label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-strong);
}

.c-field__label-hint {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: var(--fs-xs);
}

.c-input,
.c-select,
.c-textarea {
  width: 100%;
  height: 48px;
  padding: 0 var(--s-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-strong);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
  outline: none;
}

.c-textarea {
  height: auto;
  min-height: 120px;
  padding: var(--s-3) var(--s-4);
  resize: vertical;
  font-family: var(--font-body);
  line-height: 1.5;
}

.c-input::placeholder,
.c-textarea::placeholder {
  color: var(--color-text-muted);
}

.c-input:hover,
.c-select:hover,
.c-textarea:hover {
  border-color: var(--color-text-strong);
}

.c-input:focus,
.c-select:focus,
.c-textarea:focus,
.c-input:focus-visible,
.c-select:focus-visible,
.c-textarea:focus-visible {
  border-color: var(--brand-black);
  box-shadow: 0 0 0 4px rgba(19, 19, 25, 0.08);
  outline: none;
}

.c-input.is-invalid,
.c-select.is-invalid,
.c-textarea.is-invalid {
  border-color: var(--brand-red);
}

.c-input.is-invalid:focus,
.c-textarea.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(255, 0, 34, 0.12);
}

.c-field__error {
  font-size: var(--fs-xs);
  color: var(--brand-red);
  display: none;
  margin-top: 2px;
  align-items: center;
  gap: 6px;
}
.c-field__error::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF0022' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4'/><path d='M12 16h.01'/></svg>") center / contain no-repeat;
}

.c-field.is-invalid .c-field__error {
  display: inline-flex;
}

/* === Inline alert banner =============================== */
.c-alert {
  display: none;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.45;
  margin-bottom: var(--s-4);
  border: 1px solid transparent;
  animation: alertIn 220ms var(--ease-out);
}
.c-alert.is-show { display: flex; }

.c-alert--error {
  background: #FFF1F3;
  border-color: #FFC9D2;
  color: #8E0014;
}
.c-alert--success {
  background: #E6F6EC;
  border-color: #BBE4C9;
  color: #0E6A2C;
}
.c-alert--info {
  background: #EAF4FB;
  border-color: #C5E1F2;
  color: #135884;
}

.c-alert__icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.c-alert__title {
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

[data-theme="dark"] .c-alert--error   { background: rgba(255,0,34,0.10);  color: #FFB7C0; border-color: rgba(255,0,34,0.30); }
[data-theme="dark"] .c-alert--success { background: rgba(14,160,55,0.10); color: #B4E7C4; border-color: rgba(14,160,55,0.28); }
[data-theme="dark"] .c-alert--info    { background: rgba(11,165,236,0.10); color: #BBE0F3; border-color: rgba(11,165,236,0.30); }

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Toast (top-right, transient) ====================== */
.c-toast-wrap {
  position: fixed;
  top: calc(var(--navbar-h) + var(--s-4));
  right: var(--s-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  pointer-events: none;
  max-width: calc(100% - var(--s-10));
}

.c-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  animation: toastIn 260ms var(--ease-out);
  color: var(--color-text-strong);
}

.c-toast.is-leaving {
  animation: toastOut 200ms var(--ease-in) forwards;
}

.c-toast__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.c-toast--success .c-toast__icon { background: #E6F6EC; color: #0E6A2C; }
.c-toast--error   .c-toast__icon { background: var(--brand-red-soft); color: var(--brand-red); }
.c-toast--info    .c-toast__icon { background: #EAF4FB; color: #135884; }

.c-toast__body { flex: 1; min-width: 0; }
.c-toast__title { font-weight: 700; }
.c-toast__msg { color: var(--color-text-muted); font-size: var(--fs-xs); margin-top: 1px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 640px) {
  .c-toast-wrap {
    top: auto;
    bottom: var(--s-4);
    left: var(--s-4);
    right: var(--s-4);
  }
  .c-toast { min-width: 0; max-width: none; }
}

/* select chevron */
.c-select-wrap {
  position: relative;
}
.c-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23494950' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
  padding-right: 44px;
}

/* === Civilité (radio pills) ============================ */
.c-radio-group {
  display: inline-flex;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}

.c-radio-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding-inline: var(--s-5);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out);
  user-select: none;
}

.c-radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.c-radio-pill:hover {
  color: var(--color-text-strong);
}

.c-radio-pill.is-checked {
  background: var(--brand-black);
  color: var(--white);
}

/* === Name pair (Nom + Prénom side by side on desktop) === */
.c-field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

@media (max-width: 640px) {
  .c-field-grid-2 { grid-template-columns: 1fr; }
}

/* === Phone input with country code prefix ============== */
.c-phone {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s-2);
}

.c-phone__prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-inline: var(--s-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--color-text-strong);
  gap: 6px;
}
.c-phone__prefix::before {
  content: "🇲🇦";
  font-size: 18px;
  line-height: 1;
}

/* === Navigation buttons ================================= */
.c-contact__actions {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-8);
}

.c-contact__actions .c-btn {
  flex: 1;
}

.c-contact__actions .c-btn--ghost {
  flex: 0 0 auto;
  padding-inline: var(--s-5);
}

/* === Info cards row =================================== */
.c-contact__info {
  margin-top: var(--s-20);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  max-width: 1040px;
  margin-inline: auto;
}

@media (max-width: 1024px) {
  .c-contact__info {
    margin-top: var(--s-12);
  }
}

@media (max-width: 640px) {
  .c-contact__info { grid-template-columns: 1fr; }
}

.c-info-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.c-info-card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.c-info-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-strong);
}

.c-info-card__label {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.c-info-card__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--color-text-strong);
  line-height: 1.35;
  letter-spacing: var(--ls-tight);
}

.c-info-card__sub {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* === Success state ===================================== */
.c-contact__success {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-10) 0 var(--s-6);
}

/* hidden attr trumps display: flex */
[hidden] { display: none !important; }

.c-contact__success-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-red);
}

.c-contact__success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-2xl);
  color: var(--color-text-strong);
  letter-spacing: var(--ls-tight);
}

.c-contact__success-body {
  color: var(--color-text-muted);
  max-width: 36ch;
}

.c-contact__summary {
  margin-top: var(--s-6);
  width: 100%;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--s-5);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.c-contact__summary-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  align-items: baseline;
}

.c-contact__summary-key {
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-size: var(--fs-xs);
}

.c-contact__summary-val {
  color: var(--color-text-strong);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* === Step transitions (cross-fade) ===================== */
.c-step {
  display: none;
  animation: stepIn var(--t-base) var(--ease-out);
}
.c-step.is-active {
  display: block;
}

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

/* Force solid navbar for non-hero pages */
.contact-page .c-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-strong);
}
[data-theme="dark"] .contact-page .c-navbar {
  background: rgba(11, 11, 18, 0.92);
  border-bottom-color: rgba(255,255,255,0.08);
  color: var(--white);
}
