/* =============================================================================
   openglobe.css — Thème de login OpenGlobe (basé sur le thème legacy "keycloak")
   Layout : formulaire à GAUCHE, image à DROITE (desktop)
            empilé verticalement sur mobile (formulaire d'abord, image au-dessus)
   Structure réelle du template legacy (template.ftl) :
     .login-pf-page > #kc-container > #kc-content > #kc-content-wrapper
   ============================================================================= */

:root {
  --og-primary: #1d6f5e;
  --og-primary-dark: #134a3e;
  --og-bg: #f4f6f5;
  --og-card-bg: #ffffff;
  --og-text: #1a1a1a;
  --og-text-muted: #6b7280;
  --og-radius: 14px;
}

html, body {
  background: var(--og-bg) !important;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Conteneur principal centré */
.login-pf-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  box-sizing: border-box;
}

#kc-container {
  width: 100%;
  max-width: 920px;
}

/* Carte = grille 2 colonnes : [formulaire | image] */
#kc-content {
  background: var(--og-card-bg);
  border-radius: var(--og-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
  padding: 0;
  min-height: 480px;
}

/* Colonne formulaire (1er enfant réel de #kc-content) */
#kc-content-wrapper {
  padding: 2.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Colonne image (générée en pure CSS, 2e "colonne" de la grille) */
#kc-content::after {
  content: "";
  display: block;
  background-image: url("../img/login-hero.jpg");
  background-size: cover;
  background-position: center;
}

/* Mobile : empile formulaire puis image, 1 seule colonne */
@media (max-width: 768px) {
  #kc-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 200px;
    min-height: 0;
  }
  #kc-content-wrapper {
    order: 1;
    padding: 1.75rem;
  }
  #kc-content::after {
    order: 2;
  }
}

/* Titre du realm masqué (displayName vide dans le realm) */
#kc-header-wrapper,
#kc-header,
.login-pf-header h1 {
  display: none !important;
}

/* Champs de formulaire */
.form-control,
input[type="text"],
input[type="password"],
input[type="email"] {
  border-radius: 8px !important;
  border: 1px solid #d1d5db !important;
  padding: 0.65rem 0.9rem !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
  width: 100%;
  box-sizing: border-box;
}

.form-control:focus,
input:focus {
  border-color: var(--og-primary) !important;
  box-shadow: 0 0 0 3px rgba(29, 111, 94, 0.15) !important;
  outline: none;
}

/* Bouton de connexion */
#kc-login,
.btn-primary,
input[type="submit"] {
  background: var(--og-primary) !important;
  border-color: var(--og-primary) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 0.65rem 1.2rem !important;
  transition: background 0.15s ease;
  width: 100%;
}

#kc-login:hover,
.btn-primary:hover {
  background: var(--og-primary-dark) !important;
}

/* Liens */
#kc-form-options a,
.form-group a,
a {
  color: var(--og-primary);
}

/* Libellés */
label,
.control-label {
  color: var(--og-text);
  font-weight: 500;
  display: block;
  margin-bottom: 0.35rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

/* Texte secondaire / messages d'info */
#kc-info,
.help-block {
  color: var(--og-text-muted);
  font-size: 0.85rem;
}
