/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  min-height: 100vh;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid #0066cc;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.header-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
}

h1 {
  color: #0066cc;
  font-size: 2rem;
  margin: 0;
  flex: 0 0 auto;
}

/* Responsive header for mobile */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .header-logo {
    height: 50px;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Form Sections */
.form-section {
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border-left: 4px solid #0066cc;
}

.form-section h2 {
  color: #0066cc;
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

/* Form Layout */
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1;
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

/* Form Controls */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 5px rgba(0, 102, 204, 0.3);
}

textarea {
  resize: vertical;
  font-family: inherit;
}

select {
  cursor: pointer;
}

/* Radio Buttons */
input[type="radio"] {
  width: auto;
  margin-right: 8px;
  margin-bottom: 0;
}

.form-group label:has(input[type="radio"]) {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-weight: normal;
  cursor: pointer;
}

/* Buttons */
.form-actions {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 10px;
  min-width: 150px;
}

.btn-primary {
  background-color: #0066cc;
  color: white;
}

.btn-primary:hover {
  background-color: #0052a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Validation States */
input:invalid,
select:invalid,
textarea:invalid {
  border-color: #dc3545;
}

input:valid,
select:valid,
textarea:valid {
  border-color: #28a745;
}

/* Success/Error Messages */
.message {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 600;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 0;
    min-height: 100vh;
    box-shadow: none;
  }

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

  h1 {
    font-size: 1.5rem;
  }

  .form-section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .btn {
    display: block;
    width: 100%;
    margin: 10px 0;
    min-width: auto;
  }

  .form-actions {
    padding-top: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .form-section {
    padding: 10px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .form-section h2 {
    font-size: 1.1rem;
  }

  input,
  select,
  textarea,
  .btn {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading .btn {
  position: relative;
}

.loading .btn:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Signature Preview */
.signature-preview {
  margin-top: 10px;
  padding: 10px;
  border: 2px dashed #ddd;
  border-radius: 4px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fafafa;
}

.signature-preview img {
  max-width: 100%;
  max-height: 80px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.signature-preview.empty {
  color: #999;
  font-style: italic;
}

.signature-preview.empty::before {
  content: "Aucune signature sélectionnée";
}

/* Privacy Notice Footer */
.privacy-notice {
  margin-top: 40px;
  padding: 20px;
  background-color: #f0f8ff;
  border: 1px solid #d1e7dd;
  border-radius: 8px;
  text-align: center;
}

.privacy-notice p {
  margin: 0;
  font-size: 14px;
  color: #0f5132;
  line-height: 1.5;
}

.privacy-notice a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 600;
}

.privacy-notice a:hover {
  text-decoration: underline;
}

.privacy-notice a[href^="mailto:"] {
  color: #0066cc;
  font-weight: normal;
}

.privacy-notice .contact-info {
  margin-top: 15px;
  font-size: 12px;
  color: #666;
}
