:root {
  --bg: #F8F1E8;
  --surface: #ffffff;
  --ink: #2B2B2B;
  --muted: #6B6B6B;
  --accent: #A36A4F;       /* café */
  --accent-ink: #fff;
  --radius: 18px;
  --shadow-lg: 0 24px 60px rgba(0,0,0,.18);
  --shadow-md: 0 12px 30px rgba(0,0,0,.12);
  --shadow-sm: 0 6px 16px rgba(0,0,0,.10);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: url('../img/uf.png') no-repeat center/cover;
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  color: #3c3f42;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;  
  align-items: center;      
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,241,232,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

.nav-container {
  width: min(1200px, 92%);
  height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-left: -320px;}
.brand-logo { height: 60px; }

/* texte animé au centre */
.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.nav-center span {
  display: inline-block;
  opacity: 0;
  transform: translateX(100%);
  animation: slide-in 1s ease forwards;
}
@keyframes slide-in { from{opacity:0;transform:translateX(100%);} to{opacity:1;transform:translateX(0);} }
@keyframes slide-out{ from{opacity:1;transform:translateX(0);} to{opacity:0;transform:translateX(-100%);} }

.nav-links { display: flex; align-items: center; gap: 18px; margin-right: -610px; }
.nav-link {
  position: relative;
  text-decoration: none;
  color: #2b2b2b;
  font-weight: 500;
  opacity: .9;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px; height: 2px;
  background: #A36A4F;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link:hover::after { transform: scaleX(1); }

.btn-login {
  position: relative;
  text-decoration: none;
  color: #2b2b2b;
  font-weight: 500;
  opacity: .9;
}
.btn-login::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px; height: 2px;
  background: #A36A4F;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}
.btn-login:hover { opacity: 1; }
.btn-login:hover::after { transform: scaleX(1); }

/* ===== FORM ===== */
main { flex: 1; }

/* ===== CONTENU ===== */
.login-container {
  max-width: 90%;
  margin: 0 auto;
  width: 520px;
  background: rgba(255,255,255,.65);
  padding: 30px 25px;
  border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  text-align: left;
  align-items: center;      
}

.login-container h1 {
  text-align: center;
  margin-top: -10px;
  color: var(--accent);
  font-size: 32px;
}

.login-container p {
  text-align: center;
  margin-top: -20px;
}

form label {
  display: block;
  margin-top: 18px;
  font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"] {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  transition: border 0.3s, background-color 0.3s;
}
form input:focus,
form input:valid {
  border-color: #b2794c;
  background-color: #fcefe6;
  outline: none;
}

.password-field { position: relative; }
.toggle-password {
  position: absolute;
  right: 12px; top: 53%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #aaa;
}

/* Bouton submit */
button[type="submit"] {
  color: var(--accent);
  border: 1px solid var(--accent);
  background: rgba(255,255,255,.5);
  font-weight: 600;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 25px;
  width: 100%;
  font-size: 16px;
  transition: background-color 0.3s ease, transform .06s ease;
}
button[type="submit"]:hover { background: #ebba8c; }
button[type="submit"]:active{ transform: scale(.99); }

.forgot { text-align: right; margin-top: 10px; }
.forgot a { color: #555; font-size: 14px; text-decoration: none; }

.erreur {
  border: 1px solid #d8a39d;
  background-color: #fff2f0;
  color: #b23b3b;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

/* ====== FOOTER ====== */
footer {
  background: rgba(248,241,232,.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 -2px 12px rgba(0,0,0,.04);
  margin-top: auto;
}
.footer-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2b2b2b;
}

/* ===== Responsive ===== */

/* Tablettes */
@media (max-width: 900px) {
  .brand-logo { height: 52px; }
  .nav-center { font-size: 16px; }
  .login-container { width: 90%; padding: 20px; }
}

/* Mobiles */
@media (max-width: 768px) {
  .brand { margin-left: 0; }
  .nav-links { margin-right: 0; gap: 10px; }
  .brand-logo { height: 44px; }
  .login-container { margin: 60px 15px 30px; padding: 18px; }
  .login-container h1 { font-size: 24px; }
  form label, form input, button[type="submit"] { font-size: 14px; }
}

/* Très petits écrans (ex: 320px) */
@media (max-width: 400px) {
  .login-container { margin: 40px 10px 20px; padding: 15px; }
  .login-container h1 { font-size: 20px; }
  button[type="submit"] { font-size: 13px; padding: 12px; }
}


/* Masquer footer et message navbar sur mobile */
@media (max-width: 768px) {
  .nav-center {
    display: none; /* cache le message animé au milieu */
  }
}

