/* =======================
   🎨 Palette & Variables
   ======================= */
:root {
  --col-bg: #f7f4ef;          /* fond doux */
  --col-card: #ffffff;        /* cartes */
  --col-primary: #1e3a5f;     /* bleu profond */
  --col-accent: #b56a2a;      /* cuivre/terre */
  --col-muted: #6b7280;       /* texte secondaire */
  --col-border: #e5e7eb;      /* bordures */
  --focus: #2563eb;
}

/* =======================
   🧱 Base & Structure
   ======================= */
body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background-color: #fdfaf6;
  color: #1a1a1a;
}

/* =======================
   🧭 Header & Navigation
   ======================= */
header {
  background-image: url('/assets/img/Image_fond.png');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 30px 20px;
  position: relative;
}
header::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
}
header > * {
  position: relative;
  z-index: 1;
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.logo img {
  width: 80px;
  height: 80px;
  min-width: 80px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}
.logo-title {
  font-size: 20px;
  font-weight: 700;
  color: #0d2d5f;
  letter-spacing: 0.5px;
}
.logo-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #f4d03f;
  letter-spacing: 1px;
}
nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
nav ul li a {
  color: white;
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}
nav ul li a:hover {
  background-color: #f57c00;
}

/* =======================
   🏞 Hero Sections
   ======================= */
.hero {
  background-color: #0b1c2c;
  color: white;
  text-align: center;
  padding: 1rem;
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.hero input {
  padding: 0.6rem;
  width: 50%;
  max-width: 400px;
  border: none;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.hero button {
  background-color: #f57c00;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.hero button:hover {
  background-color: #c75c1d;
}

/* Hero spécifique à l'authentification */
.hero--auth {
  background: linear-gradient(180deg, rgba(30,58,95,0.06), rgba(30,58,95,0));
  padding: 40px 20px;
  text-align: center;
}
.hero__title {
  font-size: 2rem;
  color: var(--col-primary);
  margin: 0 0 8px;
  letter-spacing: 0.3px;
}
.hero__subtitle {
  color: var(--col-muted);
  max-width: 640px;
  margin: 0 auto;
}

/* =======================
   📦 Layout & Containers
   ======================= */
.section--auth {
  background: var(--col-bg);
  padding: 40px 16px;
}
.auth__container {
  max-width: 720px;
  margin: 0 auto;
}
.card--auth {
  background: var(--col-card);
  border: 1px solid var(--col-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(30,58,95,0.08);
  padding: 28px;
}

/* =======================
   📝 Formulaires
   ======================= */
.form--auth {
  max-width: 480px;
  margin: 0 auto;
}
.form__title {
  font-size: 1.25rem;
  color: var(--col-primary);
  margin-bottom: 16px;
}
.form__group {
  margin-bottom: 16px;
}
.form__label {
  display: block;
  font-weight: 600;
  color: var(--col-primary);
  margin-bottom: 6px;
}

/* RTL support for Arabic */
[dir="rtl"] .form__label {
  text-align: right;
}

[dir="ltr"] .form__label {
  text-align: left;
}
.form__input-wrapper {
  position: relative;
}
.form__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--col-border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form__input::placeholder {
  color: #9aa1ad;
}
.form__input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  outline: none;
}

/* Afficher/Masquer mot de passe */
.form__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--col-accent);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

/* RTL support for Arabic */
[dir="rtl"] .form__toggle {
  right: auto;
  left: 8px;
}

[dir="ltr"] .form__toggle {
  right: 8px;
  left: auto;
}

.form__toggle:hover {
  color: #8f511f;
}

/* =======================
   🔘 Boutons
   ======================= */
.button {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.button--primary {
  width: 100%;
  background: var(--col-primary);
  color: #fff;
  border-color: var(--col-primary);
}
.button--primary:hover {
  background: #16304d;
}
.button--ghost {
  margin-left: 8px;
  color: var(--col-accent);
  background: transparent;
  border-color: transparent;
}
.button--ghost:hover {
  color: #8f511f;
  text-decoration: underline;
}

/* =======================
   📎 Meta & Messages
   ======================= */
.form__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--col-muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.form__divider {
  flex: 1;
  min-width: 30px;
  max-width: 80px;
  height: 2px;
  background: var(--col-border);
  margin: 0 4px;
}
.form-message {
  text-align: center;
  margin: 8px 0 14px;
  font-size: 0.95rem;
}
.form-message.error {
  color: #b00020;
}
.form-message.success {
  color: #0f7b3a;
}
.footer {
  background-color: #0b1c2c;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
}
/* =======================
   📱 Responsive
   ======================= */
/* Responsive pour tablette (768px) */
@media (max-width: 768px) {
  .card--auth {
    width: 90%;
    max-width: 450px;
    padding: 2rem;
  }
  
  .form__title {
    font-size: 1.5rem;
  }
  
  .form__input {
    font-size: 16px;
  }
  
  nav ul {
    gap: 0.8rem;
  }
  
  nav ul li a {
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
  }
  
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .hero input {
    width: 80%;
    padding: 0.5rem;
    font-size: 14px;
  }
  
  .hero button {
    padding: 0.5rem 1rem;
    font-size: 14px;
  }
  
  header {
    padding: 15px 12px;
  }
  
  .header-container {
    gap: 0.8rem;
  }
  
  .logo img {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }
  
  .logo-title {
    font-size: 16px;
  }
  
  .logo-subtitle {
    font-size: 11px;
  }
}

/* Responsive pour mobile (480px) */
@media (max-width: 480px) {
  .card--auth {
    width: 95%;
    max-width: 100%;
    padding: 1.3rem;
    margin: 0.8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .form__title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .form__input {
    padding: 0.5rem;
    font-size: 14px;
    border: 1px solid #ddd;
  }
  
  .form__input:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
  }
  
  .form__group {
    margin-bottom: 0.8rem;
  }
  
  .button {
    width: 100%;
    padding: 0.6rem;
    font-size: 13px;
  }
  
  .form__row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form__note {
    font-size: 0.8rem;
    margin-top: 10px;
  }
  
  .form__divider {
    max-width: none;
    margin: 8px 0;
  }
  
  nav ul {
    flex-direction: column;
    gap: 0.3rem;
  }
  
  nav ul li a {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    display: block;
    text-align: center;
  }
  
  .hero {
    padding: 0.8rem 0.5rem;
  }
  
  .hero h1 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
  }
  
  .hero input {
    width: 100%;
    padding: 0.4rem;
    font-size: 12px;
    margin-bottom: 0.6rem;
  }
  
  .hero button {
    padding: 0.4rem 0.8rem;
    font-size: 12px;
  }
  
  header {
    padding: 10px 6px;
  }
  
  .logo img {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
  
  .logo-title {
    font-size: 7px;
  }
  
  .logo-subtitle {
    font-size: 4px;
  }
  
  .footer {
    padding: 0.8rem 0.5rem;
    font-size: 0.8rem;
  }
}