:root {
  color-scheme: dark;
  --bg: #0c0c0a;
  --text: #f5f5f0;
  --muted: #9b9b93;
  --accent: #f0a444;
  --accent-dark: #ce7c0c;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-border: rgba(255, 255, 255, 0.1);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --danger: #ff8b7f;
  --success: #7fcf7f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Raleway', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
  gap: 32px;
}

header {
  max-width: 960px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

header svg {
  display: block;
  margin: 0 auto 12px;
  max-width: clamp(160px, 20vw, 240px);
  height: auto;
}

header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

header p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 960px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  backdrop-filter: blur(6px);
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}

.required {
  color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="date"],
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Raleway', sans-serif;
  letter-spacing: 0.02em;
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 164, 68, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: rgba(240, 164, 68, 0.08);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.radio-option:hover {
  border-color: var(--accent);
  background: rgba(240, 164, 68, 0.16);
}

.radio-option input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
}

.radio-option span {
  flex: 1;
  cursor: pointer;
}

.conditional-field {
  margin-top: 16px;
  padding-top: 0;
  animation: slideDown 0.3s ease;
}

.conditional-field label {
  margin-bottom: 12px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rating-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.star {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.star:hover {
  transform: scale(1.1);
}

.star.active,
.star:hover {
  color: var(--accent);
}

.star.active .star-path,
.star:hover .star-path {
  fill: currentColor;
  stroke: currentColor;
}

.star .star-path {
  fill: none;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.rating-text {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  min-height: 20px;
}

.checkbox-group {
  margin-top: 8px;
}

.checkbox-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: rgba(240, 164, 68, 0.08);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.checkbox-label:hover {
  border-color: var(--accent);
  background: rgba(240, 164, 68, 0.16);
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label span {
  flex: 1;
  line-height: 1.6;
  cursor: pointer;
  font-size: 0.95rem;
}

.form-feedback {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  display: none;
}

.form-feedback.error {
  display: block;
  background: rgba(255, 139, 127, 0.15);
  border: 1px solid rgba(255, 139, 127, 0.4);
  color: var(--danger);
}

.form-feedback.success {
  display: block;
  background: rgba(127, 207, 127, 0.15);
  border: 1px solid rgba(127, 207, 127, 0.4);
  color: var(--success);
}

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Raleway', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #1b0f00;
  box-shadow: 0 12px 24px rgba(240, 164, 68, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(240, 164, 68, 0.45);
}

.btn-primary:disabled {
  background: rgba(240, 164, 68, 0.35);
  color: rgba(27, 15, 0, 0.6);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-primary:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Validation visuelle */
input:invalid:not(:focus):not(:placeholder-shown),
textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--danger);
}

input:valid:not(:focus):not(:placeholder-shown),
textarea:valid:not(:focus):not(:placeholder-shown) {
  border-color: rgba(127, 207, 127, 0.4);
}

/* Mobile optimizations */
@media (max-width: 720px) {
  body {
    padding: 24px 12px 40px;
    gap: 24px;
  }

  header {
    text-align: left;
  }

  header svg {
    margin: 0 0 12px;
  }

  .form-card {
    padding: 20px;
    gap: 24px;
  }

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

  .star svg {
    width: 36px;
    height: 36px;
  }

  .rating-group {
    gap: 4px;
  }

  .btn {
    width: 100%;
    padding: 16px 32px;
  }
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
