/* contact-modal.css — PROMETI */

/* ─── Overlay ──────────────────────────────────────────── */
.contact-modal {
  display: none;
  position: fixed; inset: 0; z-index: 5000;
  align-items: center; justify-content: center;
  padding: 24px;
}
.contact-modal.open { display: flex; }

.cm-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 8, 20, 0.80);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: cmFadeIn .28s ease both;
}
@-webkit-keyframes cmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Panel principal ───────────────────────────────────── */
.cm-panel {
  position: relative; z-index: 1;
  display: flex;
  width: min(940px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 48px 120px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(14, 165, 233, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: cmSlideIn .36s cubic-bezier(.22, 1, .36, 1) both;
}
@-webkit-keyframes cmSlideIn {
  from { -webkit-transform: translateY(36px) scale(0.95); transform: translateY(36px) scale(0.95); opacity: 0; }
  to   { -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes cmSlideIn {
  from { transform: translateY(36px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ─── Sidebar gauche — navy identité PROMETI ────────────── */
.cm-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #28405c;
  padding: 34px 28px 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(14, 165, 233, 0.14);
}

/* Ligne d'accent bleu en haut */
.cm-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6, #0ea5e9);
  pointer-events: none;
}

/* Cercles décoratifs lumineux */
.cm-sidebar::after {
  content: '';
  position: absolute;
  bottom: -80px; right: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,0.09) 0%, transparent 70%);
  pointer-events: none;
}

/* Cercle déco supplémentaire en haut */
.cm-sidebar-deco {
  position: absolute;
  top: -60px; left: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Marque */
.cm-sidebar-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  margin-bottom: 32px;
  position: relative; z-index: 1;
}
.cm-sidebar-logo {
  height: 42px; width: auto; flex-shrink: 0; display: block;
  object-fit: contain;
}
.cm-sidebar-tagline {
  font-size: 9.5px; color: rgba(14, 165, 233, 0.70); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; margin-top: 0;
  margin-left: 58px;
}
.cm-sidebar-brand::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 8px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.32), transparent 75%);
}

/* Titre accroche */
.cm-sidebar-heading {
  font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  font-size: 26px; font-weight: 900; color: #fff; line-height: 1.18;
  margin-bottom: 12px;
  position: relative; z-index: 1;
  letter-spacing: .02em; text-transform: uppercase;
}
.cm-sidebar-heading em {
  font-style: normal;
  color: #0ea5e9;
}
.cm-sidebar-sub {
  font-size: 13px; color: rgba(255, 255, 255, 0.58); line-height: 1.72;
  margin-bottom: auto;
  padding-bottom: 28px;
  position: relative; z-index: 1;
}

/* Contacts */
.cm-sidebar-contacts {
  display: flex; flex-direction: column; gap: 14px;
  position: relative; z-index: 1;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid rgba(14, 165, 233, 0.18);
}
.cm-contact-item {
  display: flex; align-items: flex-start; gap: 12px;
}
.cm-contact-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: none;
  border: none;
  display: flex; align-items: center; justify-content: center;
}
.cm-contact-icon svg {
  width: 19px; height: 19px;
  stroke: #0ea5e9; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.cm-contact-info { min-width: 0; padding-top: 1px; }
.cm-contact-label {
  font-size: 11px; font-weight: 800;
  color: rgba(14, 165, 233, 0.60);
  letter-spacing: .14em; text-transform: uppercase;
}
.cm-contact-val {
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.88);
  margin-top: 3px; line-height: 1.45;
}
.cm-contact-val a { color: rgba(255,255,255,0.88); text-decoration: none; }
.cm-contact-val a:hover { color: #0ea5e9; text-decoration: none; }

/* ─── Zone formulaire droite ────────────────────────────── */
.cm-form-area {
  flex: 1; min-width: 0;
  background: #f8fafc;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.cm-form-area::-webkit-scrollbar { width: 4px; }
.cm-form-area::-webkit-scrollbar-track { background: transparent; }
.cm-form-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }

/* ─── En-tête formulaire ────────────────────────────────── */
.cm-form-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 28px 30px 0;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 20px;
}
.cm-form-title {
  font-size: 17px; font-weight: 800; color: #0f172a; letter-spacing: .01px;
}
.cm-form-sub {
  font-size: 12px; color: #64748b; font-weight: 500; margin-top: 5px; line-height: 1.5;
}

.cm-close {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  border: 1.5px solid #e2e8f0; background: #f8fafc; color: #94a3b8;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  margin-top: 1px;
}
.cm-close:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.cm-close svg {
  width: 13px; height: 13px;
  stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round;
}

/* ─── Séparateur — masqué (remplacé par border-bottom du header) ── */
.cm-divider { display: none; }

/* ─── Formulaire ────────────────────────────────────────── */
.cm-form {
  padding: 22px 30px 30px;
  display: flex; flex-direction: column; gap: 16px;
  flex: 1;
}
.cm-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.cm-field { display: flex; flex-direction: column; gap: 6px; }
.cm-field label {
  font-size: 10.5px; font-weight: 800; color: #334155;
  letter-spacing: .11em; text-transform: uppercase;
}
.cm-field label .req { color: #0ea5e9; }

.cm-field input,
.cm-field select,
.cm-field textarea {
  padding: 11px 14px; border-radius: 11px;
  border: 1.5px solid #e2e8f0; background: #fff;
  font-size: 14px; color: #0f172a; font-family: inherit;
  outline: none; width: 100%; box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s, background .18s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.cm-field input:focus,
.cm-field select:focus,
.cm-field textarea:focus {
  border-color: #0ea5e9; background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.cm-field input::placeholder,
.cm-field textarea::placeholder { color: #94a3b8; }
.cm-field select { cursor: pointer; }
.cm-field textarea { resize: none; height: 110px; line-height: 1.68; }

/* ─── Pied de formulaire ────────────────────────────────── */
.cm-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding-top: 4px;
}

.cm-btn-cancel {
  padding: 10px 22px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; background: #fff;
  color: #64748b; font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.cm-btn-cancel:hover { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }

.cm-btn-send {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.32);
  transition: transform .18s, box-shadow .18s, opacity .15s;
  white-space: nowrap;
}
.cm-btn-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.44);
}
.cm-btn-send:disabled { opacity: .58; cursor: default; transform: none; }
.cm-btn-send svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ─── Message d'erreur inline ───────────────────────────── */
.cm-error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.30);
  border-radius: 8px;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.5;
  animation: cmFadeIn .22s ease both;
}
@keyframes cmFadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ─── État succès ───────────────────────────────────────── */
.cm-success {
  flex: 1;
  padding: 56px 30px;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 16px;
  background: #f8fafc;
}
.cm-success-ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 44px rgba(14, 165, 233, 0.34);
  animation: cmPop .4s cubic-bezier(.22, 1, .36, 1) both;
}
@-webkit-keyframes cmPop {
  from { -webkit-transform: scale(0.5); transform: scale(0.5); opacity: 0; }
  to   { -webkit-transform: scale(1); transform: scale(1); opacity: 1; }
}
@keyframes cmPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.cm-success-ring svg {
  width: 34px; height: 34px;
  stroke: #fff; stroke-width: 2.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.cm-success-title { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0; }
.cm-success-text {
  color: #64748b; font-size: 14.5px; line-height: 1.75;
  max-width: 300px; margin: 0;
}

/* ─── Responsive mobile ─────────────────────────────────── */
@media (max-width: 680px) {
  .contact-modal { padding: 0; align-items: flex-end; }
  .cm-panel {
    flex-direction: column;
    width: 100%; max-height: 94dvh;
    border-radius: 20px 20px 0 0;
  }
  .cm-sidebar {
    width: 100%; padding: 22px 22px 18px;
  }
  .cm-sidebar::after { display: none; }
  .cm-sidebar-heading { font-size: 22px; margin-bottom: 8px; }
  .cm-sidebar-sub { font-size: 12.5px; padding-bottom: 16px; margin-bottom: 0; }
  .cm-sidebar-contacts { flex-direction: row; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
  .cm-contact-item { flex: 1; min-width: 130px; }
  .cm-form-area { min-height: 0; }
  .cm-form-header { padding: 18px 20px 16px; }
  .cm-form { padding: 16px 20px 24px; }
  .cm-row2 { grid-template-columns: 1fr; gap: 12px; }
  .cm-footer { justify-content: stretch; }
  .cm-btn-cancel, .cm-btn-send { flex: 1; justify-content: center; }
  @-webkit-keyframes cmSlideIn {
    from { -webkit-transform: translateY(60px); transform: translateY(60px); opacity: 0; }
    to   { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; }
  }
  @keyframes cmSlideIn {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
}

/* ══════════════════════════════════════════════════
   COMPATIBILITÉ CROSS-BROWSER — MODAL CONTACT
   Chrome · Edge · Firefox · Safari
   ══════════════════════════════════════════════════ */

/* Reset apparence boutons (Safari/iOS) */
.cm-btn-cancel,
.cm-btn-send,
.cm-close,
button {
  -webkit-appearance: none;
  -moz-appearance:    none;
  appearance:         none;
}

/* Animations avec -webkit- */
.cm-backdrop {
  -webkit-animation: cmFadeIn .28s ease both;
  animation: cmFadeIn .28s ease both;
}
.cm-panel {
  -webkit-animation: cmSlideIn .36s cubic-bezier(.22, 1, .36, 1) both;
  animation: cmSlideIn .36s cubic-bezier(.22, 1, .36, 1) both;
}
.cm-success-ring {
  -webkit-animation: cmPop .4s cubic-bezier(.22, 1, .36, 1) both;
  animation: cmPop .4s cubic-bezier(.22, 1, .36, 1) both;
}

/* Hover transforms avec -webkit- */
.cm-btn-send:hover {
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
}
.cm-btn-cancel:hover {
  -webkit-transform: none;
  transform: none;
}

/* Transitions avec -webkit- */
.cm-btn-send,
.cm-btn-cancel,
.cm-close {
  -webkit-transition: all .18s ease;
  transition: all .18s ease;
}
.cm-field input,
.cm-field select,
.cm-field textarea {
  -webkit-transition: border-color .18s, box-shadow .18s, background .18s;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

/* Scroll fluide iOS */
.cm-form-area,
.cm-panel {
  -webkit-overflow-scrolling: touch;
}

/* backdrop-filter déjà préfixé dans le CSS d'origine */

/* Inputs — reset iOS Safari */
.cm-field input,
.cm-field select,
.cm-field textarea {
  -webkit-appearance: none;
  -moz-appearance:    none;
  appearance:         none;
  border-radius: 11px;
}
.cm-select-wrap {
  position: relative;
}
.cm-select-wrap select {
  background-image: none;
  padding-right: 36px;
  width: 100%;
}
.cm-select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.4,0,.2,1), color .25s;
  -webkit-transition: -webkit-transform .25s cubic-bezier(.4,0,.2,1), color .25s;
}
.cm-select-wrap:focus-within .cm-select-chevron {
  transform: translateY(-50%) rotate(-180deg);
  -webkit-transform: translateY(-50%) rotate(-180deg);
  color: #0ea5e9;
}

/* Line-height cohérent sur les boutons */
.cm-btn-send,
.cm-btn-cancel {
  line-height: 1;
}

/* Fallback gap flexbox pour Safari < 14.1 */
.cm-sidebar-brand > * + * { margin-top: 8px; }
.cm-contact-item > * + *  { margin-left: 12px; }
@supports (gap: 1px) {
  .cm-sidebar-brand > * + * { margin-top: 0; }
  .cm-contact-item > * + *  { margin-left: 0; }
}
