/* ========================================
   CONTACT FORM V2 — MicroNoxy
   Préfixe: cf2-
   ======================================== */

/* ===== OVERLAY (popup modal) ===== */
#mnx-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(5, 5, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

#mnx-popup-overlay.active {
  display: flex;
  animation: cf2-fadeIn 0.3s ease;
}

@keyframes cf2-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reset & fonts */
.cf2-panel *,
.cf2-panel *::before,
.cf2-panel *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Panel principal */
.cf2-panel {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: linear-gradient(170deg, rgba(10,22,45,0.98) 0%, rgba(6,12,24,0.99) 100%);
  border: 1px solid rgba(0,229,255,0.12);
  border-radius: 16px;
  padding: 22px 24px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 60px rgba(0,229,255,0.04);
  font-family: 'Exo 2', sans-serif;
  color: #e0e8f0;
}

/* Close button */
.cf2-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0,229,255,0.15);
  background: rgba(0,229,255,0.05);
  color: #00e5ff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, border-color 0.3s;
  z-index: 10;
}

.cf2-close:hover {
  background: rgba(0,229,255,0.12);
  border-color: rgba(0,229,255,0.3);
}

/* Header */
.cf2-header {
  margin-bottom: 16px;
}

.cf2-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 14px;
}

.cf2-sec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  display: inline-block;
}

.cf2-sec-text {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #00e5ff;
  font-weight: 700;
}

.cf2-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  font-family: 'Rajdhani', sans-serif;
  margin: 0 0 4px;
}

.cf2-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin: 0;
}

/* Toggle Particulier / Professionnel */
.cf2-toggle-wrap {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  background: rgba(0,229,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(0,229,255,0.08);
  padding: 3px;
}

.cf2-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  transition: color 0.3s, background-color 0.3s, box-shadow 0.3s;
  letter-spacing: 0.3px;
}

.cf2-toggle-btn.active {
  background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(139,92,246,0.1));
  color: #00e5ff;
  box-shadow: 0 2px 12px rgba(0,229,255,0.15);
}

.cf2-toggle-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Separators */
.cf2-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
}

.cf2-sep-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.12), transparent);
}

.cf2-sep-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 2.5px;
  color: rgba(0,229,255,0.35);
  font-weight: 700;
  white-space: nowrap;
}

/* Field groups */
.cf2-field-group {
  margin-bottom: 12px;
}

.cf2-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}

.cf2-label-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: inline-flex;
  vertical-align: middle;
}

.cf2-required {
  color: #00e5ff;
  font-size: 12px;
}

.cf2-row {
  display: flex;
  gap: 10px;
}

.cf2-row .cf2-field-group {
  flex: 1 1 0;
  min-width: 0;
}

/* Inputs */
.cf2-input,
.cf2-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0,20,40,0.5);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: 8px;
  color: #e0e8f0;
  font-size: 13px;
  font-family: 'Exo 2', sans-serif;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.cf2-input:focus,
.cf2-select:focus {
  border-color: rgba(0,229,255,0.4);
  box-shadow: 0 0 12px rgba(0,229,255,0.1), inset 0 0 0 1px rgba(0,229,255,0.05);
}

.cf2-input::placeholder {
  color: rgba(255,255,255,0.2);
  font-style: italic;
}

/* Select wrapper */
.cf2-select-wrap {
  position: relative;
}

.cf2-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background: rgba(0,20,40,0.5);
}

.cf2-select option {
  background: #0a1628;
  color: #e0e8f0;
  padding: 8px;
}

.cf2-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(0,229,255,0.4);
  font-size: 16px;
  pointer-events: none;
}

/* Textarea */
.cf2-textarea {
  min-height: 90px;
  line-height: 1.6;
  resize: vertical;
}

.cf2-char-count {
  text-align: right;
  font-size: 10px;
  color: rgba(255,255,255,0.15);
  font-family: 'Space Mono', monospace;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Pro fields (hidden by default) */
.cf2-pro-fields {
  display: none;
}

.cf2-pro-fields.visible {
  display: block;
}

/* Honeypot (anti-spam) */
.cf2-hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Submit button */
.cf2-submit {
  width: 100%;
  padding: 13px 20px;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #00e5ff 0%, #8b5cf6 100%);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.3s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(0,229,255,0.2);
}

.cf2-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cf2-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.cf2-submit.sending {
  opacity: 0.7;
}

.cf2-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: cf2-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes cf2-spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.cf2-footer {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,229,255,0.06);
}

.cf2-footer-sec {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cf2-footer-text {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.5px;
}

.cf2-rgpd {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
  margin: 0;
}

.cf2-rgpd a {
  color: rgba(0,229,255,0.5);
  text-decoration: underline;
}

/* Success state */
.cf2-success {
  display: none;
  text-align: center;
  padding: 40px 28px;
}

.cf2-success.visible {
  display: block;
}

.cf2-success-icon {
  margin-bottom: 24px;
}

.cf2-success-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  font-family: 'Rajdhani', sans-serif;
}

.cf2-success-text {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  margin: 0 0 24px;
}

.cf2-success-text .highlight {
  color: #00e5ff;
  font-weight: 600;
}

.cf2-success-ref {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 16px;
  background: rgba(0,229,255,0.04);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: 8px;
  margin-bottom: 24px;
}

.cf2-success-ref-label {
  opacity: 0.4;
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}

.cf2-success-ref-id {
  color: #00e5ff;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  letter-spacing: 2px;
}

.cf2-new-request-btn {
  padding: 12px 32px;
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 8px;
  background: transparent;
  color: #00e5ff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Exo 2', sans-serif;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cf2-new-request-btn:hover {
  background: rgba(0,229,255,0.08);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  /* Fix: popup scroll — le haut du formulaire était masqué */
  #mnx-popup-overlay {
    align-items: flex-start !important;
    padding: 12px !important;
  }

  .cf2-panel {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    max-height: none !important;
  }
}

@media (max-width: 600px) {
  .cf2-panel {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .cf2-title {
    font-size: 22px;
  }

  .cf2-row {
    flex-direction: column;
    gap: 0;
  }

  .cf2-toggle-btn {
    font-size: 12px;
    padding: 10px 12px;
  }
}

@media (max-width: 400px) {
  .cf2-title {
    font-size: 20px;
  }

  .cf2-sec-badge {
    padding: 4px 10px;
  }

  .cf2-sec-text {
    font-size: 8px;
  }
}
