/* ============================================
   VARIABLES CSS - CHARTE ZÉBRA
   ============================================ */
:root {
  /* COULEURS PRINCIPALES - IDENTITÉ ZÉBRA */
  --zebra-brown: #73493f;
  --zebra-brown-hover: #5d3a33;
  --zebra-brown-light: #8f5e52;
  
  /* Accents chauds */
  --zebra-sand: #c7ad9e;
  --zebra-terracotta: #a67472;
  --zebra-ocre: #d89a6a;
  
  /* NEUTRES - FONDS & TEXTES */
  --zebra-dark: #2e2e2e;
  --zebra-slate: #465459;
  --zebra-gray-light: #c1c2bd;
  
  /* Fonds */
  --zebra-bg: #eae9e4;
  --zebra-beige: #d6cdbb;
  --zebra-white: #ffffff;
  
  /* COULEURS SÉMANTIQUES */
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* TYPOGRAPHIE */
  --font-title: 'Nave', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Spline Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* ESPACEMENTS */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* BORDER RADIUS */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* OMBRES */
  --shadow-sm: 0 2px 8px rgba(115, 73, 63, 0.08);
  --shadow-md: 0 4px 16px rgba(115, 73, 63, 0.12);
  --shadow-lg: 0 8px 32px rgba(115, 73, 63, 0.16);
  
  /* TRANSITIONS */
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--zebra-dark);
  background-color: var(--zebra-bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--space-2xl);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

header {
  text-align: center;
  margin: var(--space-2xl) 0;
}

.logo {
  height: 60px;
  margin-bottom: var(--space-lg);
}

h1 {
  font-family: var(--font-title);
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--zebra-brown);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.subtitle {
  color: var(--zebra-slate);
  font-size: var(--text-sm);
}

/* ============================================
   SECTIONS & CARDS
   ============================================ */
section {
  background-color: var(--zebra-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

section:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

h2 {
  font-family: var(--font-title);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--zebra-brown);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--zebra-gray-light);
  padding-bottom: var(--space-xs);
}

/* ============================================
   FORMULAIRES
   ============================================ */
/* Grilles de formulaires pour réduire la hauteur */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--zebra-dark);
  margin-bottom: var(--space-xs);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 0.875rem 1rem;
  border: 2px solid var(--zebra-gray-light);
  border-radius: var(--radius-md);
  background-color: var(--zebra-white);
  color: var(--zebra-dark);
  transition: all var(--transition-base);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--zebra-brown);
  box-shadow: 0 0 0 3px rgba(115, 73, 63, 0.1);
}

.error-message {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-xs);
  display: none;
}

.is-invalid {
  border-color: var(--color-error) !important;
}

/* Interlocuteurs blocks */
.interlocuteur-block {
  background-color: var(--zebra-bg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.interlocuteur-block h3 {
  font-family: var(--font-title);
  font-size: var(--text-lg);
  color: var(--zebra-brown);
  margin-bottom: var(--space-sm);
}

/* Support Grid */
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.support-option {
  position: relative;
}

.support-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.support-label {
  display: block;
  padding: var(--space-md);
  border: 2px solid var(--zebra-gray-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 500;
  background: var(--zebra-white);
}

.support-option input:checked + .support-label {
  border-color: var(--zebra-brown);
  background: rgba(115, 73, 63, 0.05);
  color: var(--zebra-brown);
  box-shadow: var(--shadow-sm);
}

.conditional-fields {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--zebra-bg);
  border-radius: var(--radius-md);
  display: none;
}

.info-box {
  margin-top: var(--space-xs);
  padding: var(--space-md);
  background: rgba(166, 116, 114, 0.08); /* Terracotta très léger */
  color: var(--zebra-slate);
  border-left: 4px solid var(--zebra-terracotta);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Toggle Switch Zébra */
.toggle-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--zebra-gray-light);
  transition: .4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--zebra-brown);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Alert Messages */
.alert-message {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-top: var(--space-md);
  border-left: 4px solid transparent;
}

.alert-info {
  background: var(--zebra-bg);
  color: var(--zebra-slate);
  border-left-color: var(--zebra-slate);
}

.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  color: #b45309;
  border-left-color: var(--color-warning);
}

/* Upload Zones */
.upload-zone {
  border: 2px dashed var(--zebra-gray-light);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--zebra-white);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--zebra-brown);
  background: rgba(115, 73, 63, 0.02);
}

.file-list {
  margin-top: var(--space-md);
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem var(--space-md);
  background: var(--zebra-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
}

.btn-remove {
  background: none;
  border: none;
  color: var(--color-error);
  cursor: pointer;
  font-size: 1.2rem;
}

/* Boutons Zébra */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--zebra-brown);
  color: var(--zebra-bg);
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-lg);
  cursor: pointer;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--zebra-brown-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Global Alert Overlay */
.global-alert {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: white;
  box-shadow: var(--shadow-lg);
  display: none;
  font-weight: 500;
}

/* Loader */
.loader {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

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

/* Responsive Mobile */
@media (max-width: 767px) {
  .container { padding: 0 var(--space-md); }
  section { padding: var(--space-md); }
  h1 { font-size: var(--text-2xl); }
  .support-grid { grid-template-columns: 1fr; }
}
