* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: #111827;
  font-family: "Outfit", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../images/bg.jpg") center / cover no-repeat;
  opacity: 0.8;
  z-index: -1;
}

#container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* Carte formulaire */
form {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

/* Header */
.form-header {
  text-align: center;
  margin-bottom: 30px;
}

.form-logo {
  width: 150px;
  object-fit: contain;
}

.form-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #1f2937;
}

.form-subtitle {
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

/* Champs */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

label.required::after {
  content: " *";
  color: #ef4444;
}

input,
select,
textarea {
  width: 100%;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: 0.2s;
}

textarea {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(25, 76, 79, 0.12);
}

/* Ligne 2 colonnes */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Boutons */
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

button {
  height: 46px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

button[type="button"] {
  background: #fff;
  color: #111827;
}

button[type="submit"] {
  position: relative;
  border: none;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(25, 76, 79, 0.25);
}

button[type="submit"]:hover {
  background: var(--accent);
  color: var(--primary);
}

button[type="submit"].is-loading {
  color: transparent;
  pointer-events: none;
}

button[type="submit"].is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  width: min(500px, calc(100% - 40px));
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
  animation: modalShow 0.2s ease;
}

@keyframes modalShow {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 22px;
}

.modal-close:hover {
  background: #e5e7eb;
}

.modal-content h2 {
  margin: 0 0 15px;
  font-size: 22px;
  color: #111827;
}

.modal-content p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
  font-size: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
}

.modal-actions button {
  min-width: 150px;
  border: none;
  background: var(--primary);
  color: #fff;
}

.modal-actions button:hover {
  background: var(--accent);
  color: var(--primary);
}

/* Sélecteur d'application */
.app-selector {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.app-category:not(:first-of-type) {
  margin-top: 24px;
}

.app-category h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.app-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.app-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  text-decoration: none;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: 0.2s;
}

.app-card:hover {
  border-color: #194C4F;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
  #container {
    padding: 20px;
  }

  form {
    padding: 20px;
  }

  .form-row,
  .form-actions {
    grid-template-columns: 1fr;
  }
}