/* login.css
   Simple, accessible, responsive — inspiré d'une UI claire et fonctionnelle.
*/

/* Background and logo styles */
.bg-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-image: url('/static/img/osb-logo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.osb-logo {
  display: block;
}

/* --- Variables de thème --- */
:root{
  --bg: #f6f8fa;              /* arrière-plan général */
  --card: #ffffff;            /* surface des cartes */
  --muted: #6b7280;           /* texte secondaire */
  --text: #0f172a;            /* texte principal */
  --accent: #2563eb;          /* couleur principale (bleu) */
  --accent-600: #1e40af;      /* hover/active */
  --danger: #ef4444;          /* erreurs */
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --gap: 1rem;
  --max-width: 420px;
  --focus-ring: 0 0 0 4px rgba(37,99,235,0.12);
  font-size: 16px;
}

/* --- Reset simple --- */
*{box-sizing: border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  font-size:var(--font-size);
}

/* --- Conteneur centré --- */
.page-wrapper{
  /* min-height:100vh; */
  display:flex;
  align-items:center;
  justify-content:center;
  gap:2rem;
  padding:2rem;
}

/* --- Card connexion --- */
.login-card{
  width:100%;
  max-width:var(--max-width);
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:2rem;
  border: 1px solid rgba(15,23,42,0.04);
}

/* Logo / entête */
.login-header{
  display:flex;
  align-items:center;
  gap:0.75rem;
  margin-bottom:1.25rem;
}
.logo{
  width:44px;
  height:44px;
  display:inline-grid;
  place-items:center;
  border-radius:8px;
  background:linear-gradient(135deg,var(--accent),var(--accent-600));
  color:white;
  font-weight:700;
  font-size:1.05rem;
  box-shadow: 0 4px 12px rgba(37,99,235,0.14);
}
.login-title{
  font-size:1.125rem;
  font-weight:600;
  color:var(--text);
}
.login-sub{
  font-size:0.9rem;
  color:var(--muted);
}

/* --- Formulaire --- */
form.login-form{
  display:flex;
  flex-direction:column;
  gap:var(--gap);
  margin-top:0.5rem;
}

.field{
  display:flex;
  flex-direction:column;
  gap:0.35rem;
}
label{
  font-size:0.875rem;
  color:var(--muted);
}

/* Inputs */
.input, .select, .password-toggle{
  width:100%;
  padding:0.75rem 0.9rem;
  border-radius:8px;
  border:1px solid rgba(15,23,42,0.08);
  background:transparent;
  font-size:0.95rem;
  color:var(--text);
  outline:none;
  transition:box-shadow .12s ease, border-color .12s ease, transform .06s ease;
}
.input:focus, .select:focus{
  box-shadow:var(--focus-ring);
  border-color:var(--accent-600);
}

/* group pour mot de passe + toggle */
.password-row{
  position:relative;
  display:flex;
  align-items:center;
}
.password-toggle{
  padding-right:3.2rem;
}
.pw-toggle-btn{
  position:absolute;
  right:0.45rem;
  background:none;
  border:0;
  height:100%;
  padding:0.45rem;
  cursor:pointer;
  color:var(--muted);
  font-size:0.9rem;
}
.pw-toggle-btn:focus{outline:2px solid rgba(0,0,0,0.04); border-radius:6px}

/* Actions */
.actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.5rem;
  margin-top:0.25rem;
}
.actions .btn{
  width:100%;
}
.remember{
  display:flex;
  align-items:center;
  gap:0.5rem;
  font-size:0.9rem;
  color:var(--muted);
}
.btn{
  display:inline-block;
  padding:0.8rem 1rem;
  border-radius:8px;
  border:0;
  background:var(--accent);
  color:white;
  font-weight:600;
  cursor:pointer;
  font-size:0.95rem;
  box-shadow: 0 6px 14px rgba(37,99,235,0.12);
  transition:transform .08s ease, background .12s ease;
}
.btn:hover{ transform: translateY(-1px); background:var(--accent-600) }
.btn.ghost{
  background:transparent;
  color:var(--accent-600);
  border:1px solid rgba(37,99,235,0.12);
  box-shadow:none;
}

/* Lien secondaire */
.help-link{
  font-size:0.9rem;
  color:var(--accent-600);
  text-decoration:none;
}
.help-link:hover{ text-decoration:underline }

/* Message d'erreur / réussite */
.msg{
  padding:0.65rem 0.75rem;
  border-radius:8px;
  font-size:0.95rem;
}
.msg.error{
  background: rgba(239,68,68,0.08);
  color:var(--danger);
  border:1px solid rgba(239,68,68,0.12);
}
.msg.success{
  background: rgba(34,197,94,0.08);
  color:#065f46;
  border:1px solid rgba(34,197,94,0.12);
}

/* Demande d'accès (échec de connexion) */
.request-access{
  margin-top:1rem;
  padding:1rem;
  border-radius:8px;
  background: rgba(37,99,235,0.05);
  border:1px solid rgba(37,99,235,0.12);
  text-align:center;
}
.request-access-title{
  margin:0 0 0.35rem;
  font-size:0.95rem;
  font-weight:600;
  color:var(--text);
}
.request-access-text{
  margin:0 0 0.85rem;
  font-size:0.85rem;
  color:var(--muted);
}
.request-access-btn{
  display:inline-block;
  text-decoration:none;
}

/* Pied de page */
.login-footer{
  margin-top:1rem;
  font-size:0.9rem;
  color:var(--muted);
  text-align:center;
}

/* --- Responsive --- */
@media (max-width:520px){
  .login-card{ padding:1.25rem; border-radius:8px }
  .logo{ width:40px; height:40px; font-size:0.95rem }
  :root{ --max-width: 100% }
}
