/* =============================================
   Assurance Photo — Formulaire public
   ============================================= */

:root {
  --ap-primary:   #1a1a2e;
  --ap-accent:    #0f3460;
  --ap-highlight: #e94560;
  --ap-bg:        #f8f9fa;
  --ap-border:    #dee2e6;
  --ap-radius:    8px;
  --ap-shadow:    0 2px 12px rgba(0,0,0,.08);
  --ap-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ap-form-container { font-family: var(--ap-font); max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.ap-form-header { text-align: center; margin-bottom: 32px; }
.ap-form-header h2 { font-size: 26px; font-weight: 700; color: var(--ap-primary); margin-bottom: 8px; }
.ap-form-header p { color: #6c757d; font-size: 15px; }
.req { color: var(--ap-highlight); font-weight: 700; }

/* Columns ----------------------------------- */
.ap-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 768px) { .ap-columns { grid-template-columns: 1fr; } }

.ap-col { background: #fff; border: 1px solid var(--ap-border); border-radius: var(--ap-radius); padding: 28px; box-shadow: var(--ap-shadow); }

/* Section titles ---------------------------- */
.ap-section-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--ap-primary); margin: 0 0 20px; padding-bottom: 10px; border-bottom: 2px solid var(--ap-bg); }
.ap-step { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--ap-primary); color: #fff; border-radius: 50%; font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* Fields ------------------------------------ */
.ap-field { margin-bottom: 16px; }
.ap-field label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 5px; }
.ap-field input[type="text"],
.ap-field input[type="email"],
.ap-field input[type="tel"],
.ap-field input[type="number"],
.ap-field select,
.ap-field textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--ap-border); border-radius: 6px;
  font-size: 14px; font-family: var(--ap-font); color: #333; background: #fff;
  transition: border-color .2s, box-shadow .2s; -webkit-appearance: none;
}
.ap-field input:focus, .ap-field select:focus, .ap-field textarea:focus {
  outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px rgba(15,52,96,.12);
}
.ap-field textarea { resize: vertical; min-height: 80px; }

/* Field rows -------------------------------- */
.ap-field-row { display: grid; gap: 12px; margin-bottom: 0; }
.ap-field-row--2 { grid-template-columns: 1fr 1fr; }
.ap-field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.ap-col-2 { grid-column: span 2; }
@media (max-width: 480px) {
  .ap-field-row--2, .ap-field-row--3 { grid-template-columns: 1fr; }
  .ap-col-2 { grid-column: span 1; }
}

/* Radio + checkbox -------------------------- */
.ap-radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; margin-bottom: 16px; }
.ap-radio-label input[type="radio"] { accent-color: var(--ap-accent); }
.ap-checkbox-field label { display: flex; gap: 10px; font-size: 13px; align-items: flex-start; cursor: pointer; }
.ap-checkbox-field input[type="checkbox"] { margin-top: 2px; accent-color: var(--ap-accent); flex-shrink: 0; }

/* Toggle PRO -------------------------------- */
.ap-pro-toggle { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f0f4fa; border: 1px solid #c8d8f0; border-radius: var(--ap-radius); cursor: pointer; margin-bottom: 16px; font-size: 14px; font-weight: 600; color: var(--ap-accent); }
.ap-pro-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ap-accent); cursor: pointer; flex-shrink: 0; }
.ap-pro-badge { display: inline-block; background: var(--ap-accent); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 3px; font-weight: 700; margin-left: 4px; }
.ap-pro-fields { display: none; background: #f6f9ff; border: 1px dashed #c8d8f0; border-radius: var(--ap-radius); padding: 16px; margin-bottom: 16px; }
.ap-pro-fields.visible { display: block; }

/* Matériel items ---------------------------- */
.ap-mat-item { border: 1px solid var(--ap-border); border-radius: var(--ap-radius); padding: 18px; margin-bottom: 14px; background: #fdfdfd; position: relative; }
.ap-mat-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ap-mat-num { font-weight: 700; color: var(--ap-primary); font-size: 14px; }
.ap-mat-remove { background: none; border: 1px solid #f5c2c7; color: #a00; border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer; transition: background .2s; }
.ap-mat-remove:hover { background: #fdf0f0; }

.ap-add-mat-btn { display: flex; align-items: center; gap: 6px; background: none; border: 2px dashed var(--ap-accent); color: var(--ap-accent); padding: 10px 18px; border-radius: var(--ap-radius); font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; justify-content: center; margin-top: 4px; transition: background .2s; font-family: var(--ap-font); }
.ap-add-mat-btn:hover { background: #f0f4fa; }

/* Humour bloc ------------------------------- */
.ap-humor-block { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%); color: #fff; border-radius: var(--ap-radius); padding: 16px 18px; margin-bottom: 18px; }
.ap-humor-icon { font-size: 28px; flex-shrink: 0; }
.ap-humor-block p { margin: 0; font-size: 14px; line-height: 1.5; opacity: .92; }

/* Dropzone ---------------------------------- */
.ap-dropzone { border: 2px dashed var(--ap-border); border-radius: var(--ap-radius); padding: 32px 16px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; margin-bottom: 16px; background: var(--ap-bg); }
.ap-dropzone.drag-over { border-color: var(--ap-accent); background: #eef3fb; }
.ap-dropzone-icon { font-size: 40px; margin-bottom: 8px; }
.ap-dropzone-text { font-size: 15px; font-weight: 600; color: #444; margin: 0 0 4px; }
.ap-dropzone-sub  { font-size: 13px; color: #aaa; margin: 0 0 12px; }
.ap-browse-btn { display: inline-block; background: var(--ap-primary); color: #fff; padding: 9px 22px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .2s; }
.ap-browse-btn:hover { background: var(--ap-accent); }

/* File preview ------------------------------ */
.ap-file-preview { list-style: none; margin: 0 0 8px; padding: 0; }
.ap-file-preview li { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border: 1px solid var(--ap-border); border-radius: 6px; margin-bottom: 6px; font-size: 13px; background: #fff; gap: 8px; }
.ap-file-preview li .ap-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-file-preview li .ap-file-size { color: #999; flex-shrink: 0; }
.ap-file-preview li .ap-file-remove { cursor: pointer; color: #c00; font-size: 16px; background: none; border: none; padding: 0 2px; flex-shrink: 0; }

.ap-upload-hint { font-size: 13px; color: #666; background: #f0f4fa; border-left: 3px solid var(--ap-accent); padding: 10px 12px; border-radius: 0 6px 6px 0; margin-bottom: 20px; }
.ap-upload-counter { font-size: 13px; color: #888; margin-bottom: 20px; }
.ap-captcha-wrap { margin-bottom: 20px; }

/* Submit ------------------------------------ */
.ap-submit-btn { display: block; width: 100%; padding: 14px; background: var(--ap-primary); color: #fff; border: none; border-radius: var(--ap-radius); font-size: 16px; font-weight: 700; cursor: pointer; transition: background .2s, transform .1s; margin: 20px 0 12px; font-family: var(--ap-font); }
.ap-submit-btn:hover:not(:disabled) { background: var(--ap-accent); }
.ap-submit-btn:active:not(:disabled) { transform: scale(.99); }
.ap-submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.ap-security-note { text-align: center; font-size: 12px; color: #888; margin-top: 4px; }

/* Messages ---------------------------------- */
.ap-error-msg { background: #fdf0f0; border: 1px solid #f5c2c7; color: #842029; border-radius: var(--ap-radius); padding: 12px 16px; font-size: 14px; margin-bottom: 20px; }

/* Success panel ----------------------------- */
.ap-success-panel { text-align: center; background: #fff; border: 1px solid #d1e7dd; border-radius: var(--ap-radius); padding: 48px 32px; box-shadow: var(--ap-shadow); }
.ap-success-icon { font-size: 52px; color: #198754; margin-bottom: 16px; }
.ap-success-panel h2 { font-size: 24px; color: #198754; margin-bottom: 12px; }
.ap-dossier-ref { display: inline-block; background: #e8f4fd; color: #1565c0; border-radius: 4px; padding: 6px 16px; font-size: 20px; font-weight: 700; margin: 8px 0; }
.ap-success-note { font-size: 13px; color: #888; }
