/* =========================================
   Base
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: #f9fafb;
  font-family: Arial, sans-serif;
  color: #1f2937;
}

/* =========================================
   Conteneur principal
   ========================================= */
.container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
}

.container.dark {
  background-color: #1f2937;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
}

.logo {
  display: block;
  height: 4rem;
  margin: 0 auto 1rem auto;
}

h1 {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* =========================================
   Formulaires
   ========================================= */
.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-description {
  margin-bottom: 24px;
  color: #5f6b7a;
  line-height: 1.5;
}

.form-help {
  display: block;
  margin-top: 7px;
  color: #697386;
  line-height: 1.4;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #374151;
}

.required {
  color: #c62828;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  color: #374151;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
  border-color: #f97316;
  outline: none;
}

/* Champs numériques alignés à droite */
input[type="number"] {
  text-align: right;
}

select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  color: #374151;
  background-color: #ffffff;
}

select:focus {
  border-color: #f97316;
  outline: none;
}

.form-group select {
  padding: 12px;
  border: 1px solid #ccd3dc;
  border-radius: 4px;
  font-size: 16px;
}

/* Case à cocher personnalisée */
input[type="checkbox"] {
  appearance: none;
  position: relative;
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
  background-color: #ffffff;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background-color: #f97316;
  border-color: #f97316;
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.25rem;
  width: 0.2rem;
  height: 0.4rem;
  border: solid #ffffff;
  border-width: 0 0.15rem 0.15rem 0;
  transform: rotate(45deg);
}

.remember {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

/* =========================================
   Boutons
   ========================================= */
.btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: #f97316;
  color: #ffffff;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
}

.btn:hover {
  background-color: #e87c04;
}

/* =========================================
   Messages
   ========================================= */
.error-message,
.success-message {
  margin-bottom: 20px;
  padding: 12px 16px;
  text-align: center;
  border-radius: 4px;
}

.error-message {
  color: #842029;
  background-color: #f8d7da;
  border: 1px solid #f5c2c7;
}

.success-message {
  color: #0f5132;
  background-color: #d1e7dd;
  border: 1px solid #badbcc;
}

/* =========================================
   Séparateur « OR » et liens
   ========================================= */
.space {
  display: flex;
  align-items: center;
  justify-content: center;
}

.space span {
  padding: 10px;
  font:
    normal normal bold 20px/40px Roboto,
    Arial,
    sans-serif;
  letter-spacing: 0;
  color: #111111;
  text-align: center;
  text-transform: uppercase;
}

.space .border {
  width: 40%;
  border: 1px solid #000000;
}

.first-connection {
  text-align: center;
  text-transform: uppercase;
}

.blue {
  color: #004990;
}

.back-to-login,
.login-link {
  margin-top: 22px;
  text-align: center;
}

.back-to-login span {
  margin-right: 5px;
}

/* =========================================
   En-tête utilisateur / déconnexion
   ========================================= */
.user-info {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: bold;
  text-align: right;
  color: #1f2937;
}

.logout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.logout img {
  width: 32px;
  height: 32px;
  padding-bottom: 15px;
  cursor: pointer;
}

.logout a {
  display: flex;
  align-items: center;
  color: #1f2937;
  text-decoration: none;
}

.logout a:hover {
  color: #f97316;
}

/* =========================================
   Page de connexion : fond vidéo
   (uniquement avec <body class="login-page">)
   ========================================= */
.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0e2841;
}

.login-page .bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.login-page .bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 40, 65, 0.45);
  z-index: -1;
}

.login-page .container {
  position: relative;
  width: 100%;
  margin: 2rem 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.login-page .container {
  max-width: 420px;
  padding: 2.5rem;
}

.login-page .first-connection {
  text-transform: none;
  font-size: 0.95rem;
}

.login-page .space span {
  font-size: 0.85rem;
  line-height: 1;
  color: #6b7280;
  padding: 0 12px;
}

.login-page .space .border {
  border: 0;
  border-top: 1px solid #e5e7eb;
}

.login-page .space {
  margin: 1.5rem 0 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .login-page .bg-video {
    display: none;
  }
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
