/* ============================================
   TGV Candidatures — Modal CSS
   Charte : bleu profond #0D4F5C, bleu ciel #7ABFDC, Inter
   ============================================ */

.cand-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 79, 92, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.cand-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cand-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.cand-overlay.show .cand-modal {
  transform: translateY(0) scale(1);
}

/* Header */
.cand-head {
  padding: 32px 40px 24px;
  border-bottom: 1px solid rgba(61, 65, 68, 0.06);
  position: relative;
}
.cand-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: #7ABFDC !important;
  margin: 0 0 8px !important;
}
.cand-titre {
  font-family: 'Inter', sans-serif !important;
  font-size: 22px !important;
  font-weight: 300 !important;
  color: #0D4F5C !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  padding-right: 40px !important;
}
.cand-titre strong {
  font-weight: 600 !important;
}
.cand-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #EDF5F8;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.cand-close:hover {
  background: #7ABFDC;
}
.cand-close:hover svg path {
  stroke: #fff;
}

/* Body */
.cand-body {
  padding: 32px 40px;
}
.cand-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.cand-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cand-field.full {
  grid-column: 1 / -1;
}
.cand-lab {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #3D4144 !important;
  margin: 0 !important;
}
.cand-lab sup {
  color: #F5A623;
  font-size: 10px;
}
.cand-inp,
.cand-tex {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #3D4144 !important;
  background: #FAFBFC !important;
  border: 1.5px solid rgba(61, 65, 68, 0.12) !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  outline: none !important;
  transition: border-color 0.2s !important;
  width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}
.cand-inp:focus,
.cand-tex:focus {
  border-color: #7ABFDC !important;
}
.cand-tex {
  resize: vertical !important;
  min-height: 90px !important;
  font-family: 'Inter', sans-serif !important;
}

/* Dropzone CV */
.cand-dz {
  position: relative;
  border: 1.5px dashed rgba(61, 65, 68, 0.2);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #FAFBFC;
  margin: 0;
}
.cand-dz:hover {
  border-color: #7ABFDC;
  background: rgba(122, 191, 220, 0.04);
}
.cand-dz.has-file {
  border-style: solid;
  border-color: #7ABFDC;
  background: rgba(122, 191, 220, 0.06);
  text-align: left;
  padding: 20px;
}
.cand-dz-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(122, 191, 220, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.cand-dz-txt {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0D4F5C !important;
  margin: 0 0 4px !important;
}
.cand-dz-hint {
  font-size: 12px !important;
  color: #9A9DA0 !important;
  margin: 0 !important;
}
.cand-dz input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.cand-dz-file {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cand-dz-file-ico {
  width: 40px;
  height: 40px;
  background: #7ABFDC;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cand-dz-file-info {
  flex: 1;
  min-width: 0;
}
.cand-dz-file-name {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0D4F5C !important;
  margin: 0 0 2px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cand-dz-file-size {
  font-size: 12px !important;
  color: #9A9DA0 !important;
  margin: 0 !important;
}
.cand-dz-remove {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(61, 65, 68, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  padding: 0;
}
.cand-dz-remove:hover {
  background: #F5A623;
}
.cand-dz-remove:hover svg path {
  stroke: #fff;
}

/* Consent */
.cand-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 0;
  font-size: 12px;
  color: #5D6266;
  line-height: 1.5;
  cursor: pointer;
}
.cand-consent input {
  margin-top: 2px;
  accent-color: #7ABFDC;
  flex-shrink: 0;
}
.cand-consent a {
  color: #7ABFDC;
  text-decoration: none;
}
.cand-consent a:hover {
  text-decoration: underline;
}

/* Error message */
.cand-error {
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(245, 166, 35, 0.08);
  border-left: 3px solid #F5A623;
  border-radius: 4px;
  color: #3D4144;
  font-size: 13px;
  line-height: 1.5;
}

/* Footer */
.cand-foot {
  padding: 20px 40px 32px;
  border-top: 1px solid rgba(61, 65, 68, 0.06);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.cand-foot-info {
  font-size: 12px;
  color: #9A9DA0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cand-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  padding: 6px 6px 6px 28px !important;
  gap: 20px !important;
  border-radius: 6px !important;
  min-width: 220px !important;
  box-sizing: border-box !important;
  border: none !important;
  min-height: 52px !important;
  background: #0D4F5C !important;
  color: #fff !important;
  position: relative !important;
}
.cand-submit:hover {
  background: #0a3f4a !important;
}
.cand-submit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}
.cand-submit .btn-tgv-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  background: #C5E4F0 !important;
}

/* Loading state */
.cand-submit.loading .cand-submit-txt {
  opacity: 0;
}
.cand-submit.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tgv-spin 0.8s linear infinite;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
}
@keyframes tgv-spin {
  to { transform: rotate(360deg); }
}

/* Success screen */
.cand-success {
  padding: 64px 40px 48px;
  text-align: center;
  display: none;
}
.cand-success.show {
  display: block;
}
.cand-success-ico {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(122, 191, 220, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
}
.cand-success-ico::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(122, 191, 220, 0.25);
  animation: tgv-pulse 2s infinite;
}
@keyframes tgv-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 0.3; }
}
.cand-success-t {
  font-size: 24px !important;
  font-weight: 300 !important;
  color: #0D4F5C !important;
  margin: 0 0 12px !important;
}
.cand-success-t strong {
  font-weight: 600 !important;
}
.cand-success-p {
  font-size: 15px !important;
  color: #5D6266 !important;
  line-height: 1.7 !important;
  max-width: 440px !important;
  margin: 0 auto 32px !important;
}
.cand-success-close {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #7ABFDC !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 8px 16px !important;
  font-family: 'Inter', sans-serif !important;
}
.cand-success-close:hover {
  color: #0D4F5C !important;
}

/* Hide form when success */
.cand-modal.on-success form {
  display: none;
}

/* Block scroll on body */
body.tgv-cand-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .cand-modal {
    max-height: 95vh;
  }
  .cand-head,
  .cand-body,
  .cand-foot {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  .cand-row {
    grid-template-columns: 1fr !important;
  }
  .cand-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .cand-submit {
    width: 100% !important;
  }
}
