/* Modern Bootstrap Design - Fiche d'adhésion */
:root {
  --primary-color: #0056b3;
  --secondary-color: #004494;
  --accent-color: #0275d8;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4caf50;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(67, 97, 238, 0.15);
  --transition: all 0.3s ease;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: #f5f7ff;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230056b3' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--dark-color);
  position: relative;
}

/* Header Styling */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  padding: 40px 0;
  color: white;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  margin-bottom: 20px;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  opacity: 0.8;
  z-index: 1;
  animation: pulse 15s infinite alternate;
}

.header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
  z-index: 0;
}

.header h1 {
  margin: 0;
  font-weight: 700;
  font-size: 2.5rem;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}

.header h1 i {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  margin-right: 12px;
  font-size: 2.6rem;
  vertical-align: middle;
}

/* Main Content */
main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 15px;
}

/* Form Section */
.form-section {
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  max-width: 800px;
  width: 100%;
  box-shadow: var(--box-shadow);
  animation: fadeInUp 0.7s ease;
  position: relative;
  overflow: hidden;
  border-top: 5px solid var(--primary-color);
  background-image: linear-gradient(to bottom, rgba(0, 86, 179, 0.02) 0%, rgba(255, 255, 255, 0) 200px);
}

.form-section::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(67, 97, 238, 0.1) 0%, rgba(67, 97, 238, 0) 70%);
  border-radius: 50%;
  z-index: 0;
}

/* Form Elements */
.form-label {
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  letter-spacing: 0.2px;
}

.form-label i {
  margin-right: 0.4rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

.form-control, .form-select {
  border-radius: 10px;
  padding: 0.7rem 1rem;
  border: 1px solid #dee2e6;
  transition: var(--transition);
  background-color: #f8f9fa;
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:hover, .form-select:hover {
  border-color: #c1c9d0;
  background-color: #f1f3f5;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
  background-color: white;
}

/* Form Groups */
.form-group-row {
  display: flex;
  gap: 20px;
  margin-bottom: 1.5rem;
}

.form-group-row > div {
  flex: 1;
}

/* File Inputs */
input[type="file"].form-control {
  padding: 0.8rem;
  background-color: #f8f9fa;
  border: 2px dashed #c1c9d0;
  transition: all 0.3s ease;
  cursor: pointer;
}

input[type="file"].form-control:hover {
  background-color: #e9ecef;
  border-color: var(--accent-color);
}

input[type="file"].form-control:focus {
  border-style: dashed;
  border-color: var(--primary-color);
  background-color: rgba(0, 86, 179, 0.05);
}

/* Custom file input styling */
input[type="file"].form-control::file-selector-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

input[type="file"].form-control::file-selector-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
}

/* Radio Buttons */
.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Residence Cards */
.residence-options {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.residence-card {
  flex: 1;
  border: 2px solid #dee2e6;
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  background-color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.residence-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.residence-card.selected {
  border-color: var(--primary-color);
  background-color: rgba(0, 86, 179, 0.05);
  box-shadow: 0 6px 15px rgba(0, 86, 179, 0.15);
}

.residence-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
  background-color: rgba(255, 255, 255, 0.8);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.residence-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.diaspora-icon-container {
  width: 100%;
  height: 100px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diaspora-icon {
  font-size: 3.5rem;
  color: var(--primary-color);
}

.gabon-map-container {
  width: 100%;
  height: 100px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gabon-map {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.residence-label {
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}

.residence-description {
  font-size: 0.85rem;
  color: #6c757d;
  display: block;
}

/* Image Preview */
.preview-container {
  position: relative;
  margin-top: 15px;
  border-radius: var(--border-radius);
  overflow: hidden;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeIn 0.5s ease;
}

.preview-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.img-preview {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--border-radius);
  border: 2px solid #e9ecef;
  object-fit: cover;
  aspect-ratio: 4/3;
  background-color: #f8f9fa;
}

.btn-remove-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0.8;
  z-index: 10;
}

.btn-remove-preview:hover {
  background-color: #fff;
  opacity: 1;
  transform: scale(1.1);
}

.btn-remove-preview:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.btn-remove-preview i {
  color: #dc3545;
  font-size: 1.3rem;
}

/* Signature Pad */
.signature-container {
  border: 2px solid #dee2e6;
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: white;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  margin-top: 10px;
}

.signature-container:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(0, 86, 179, 0.15);
}

.signature-container::before {
  content: "Signez ici";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(0, 0, 0, 0.1);
  font-size: 1.8rem;
  font-weight: 300;
  pointer-events: none;
  z-index: 0;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
}

.signature-container.has-signature::before {
  display: none;
}

canvas#signature-pad {
  width: 100%;
  height: 200px;
  display: block;
  background-color: white;
  position: relative;
  z-index: 1;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="%230056b3"><circle cx="12" cy="12" r="5" fill="%230056b3"/></svg>') 0 15, pointer;
}

.signature-actions {
  position: absolute;
  bottom: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.signature-actions .btn {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  background-color: white;
  border: none;
}

.signature-actions .btn:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.signature-actions .btn i {
  font-size: 1.2rem;
  color: var(--primary-color);
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 4px 6px rgba(67, 97, 238, 0.2);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(67, 97, 238, 0.25);
}

.btn-danger {
  border-radius: 6px;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
}

/* Submit Button */
button[type="submit"] {
  transition: var(--transition);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  padding: 0.8rem 2.5rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  z-index: -1;
  transition: transform 0.6s ease;
  transform: translateX(-100%);
}

button[type="submit"]:hover {
  box-shadow: 0 6px 15px rgba(67, 97, 238, 0.25);
}

button[type="submit"]:hover::before {
  transform: translateX(100%);
}

button[type="submit"]:active {
  box-shadow: 0 3px 8px rgba(67, 97, 238, 0.2);
}

/* Success Alert */
.alert-success {
  background-color: rgba(76, 175, 80, 0.1);
  border-color: var(--success-color);
  color: var(--success-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  animation: fadeIn 0.5s ease;
  margin-top: 2rem;
}

/* Section Dividers */
.section-divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
}

.section-divider::before, .section-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #dee2e6;
}

.section-divider h5 {
  margin: 0 1rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .form-section {
    padding: 30px;
  }

  .form-group-row {
    flex-direction: column;
    gap: 0;
  }

  .header h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  .form-section {
    padding: 25px;
    margin: 10px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  canvas#signature-pad {
    height: 150px;
  }

  button[type="submit"] {
    width: 100% !important;
  }
}

/* Logo discret en haut à gauche */
.logo-coin-gauche {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 100px;
  height: auto;
  z-index: 10;
}
