/* DOORS Theme - Inspired by Django login page */

:root {
  --primary-color: #ff4e02;
  --secondary-color: #162a42;
  --danger-color: #f14668;
  --info-color: #3e8ed0;
  --warning-color: #f1c039;
}

body {
  font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
}

/* Navbar bleue DOORS */
.kc-navbar {
  background-color: var(--secondary-color);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 0;
}

.kc-navbar-brand {
  display: flex;
  align-items: center;
}

.kc-navbar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.kc-navbar-item:hover {
  opacity: 0.85;
}

.kc-navbar-logo {
  display: flex;
  align-items: center;
}

.kc-navbar-logo img {
  width: 28px;
  height: 28px;
  display: block;
}

.kc-navbar-title {
  display: flex;
  align-items: center;
}

.kc-navbar-title-text {
  color: white;
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0;
}

#kc-header {
  display: none; /* Masquer le header par défaut de Keycloak */
}

#kc-header-wrapper {
  display: none;
}

.login-pf body {
  background: #f5f5f5;
}

/* Container principal - structure en colonnes comme Django */
#kc-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 64px);
  padding: 2rem 1.5rem;
}

#kc-container-wrapper {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
}

/* Box de login centrée - comme les colonnes Bulma */
.card-pf {
  background: white;
  border-radius: 6px;
  box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0px 0 1px rgba(10, 10, 10, 0.02);
  padding: 2.5rem;
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
}

/* Titre de la page dans la box */
#kc-page-title {
  color: var(--secondary-color);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
}

#kc-form {
  margin-top: 0;
}

#kc-form-login {
  width: 100%;
}

/* Form styling */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  color: #363636;
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control {
  background-color: white;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  color: #363636;
  padding: 0.625rem 0.75rem;
  width: 100%;
  font-size: 1rem;
  box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
  max-width: 100%;
}

.form-control:hover {
  border-color: #b5b5b5;
}

.form-control:focus,
.form-control:active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.125em rgba(255, 78, 2, 0.25);
  outline: none;
}

/* Button styling */
.btn-primary,
#kc-login {
  background-color: var(--primary-color);
  border: 1px solid transparent;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  text-align: center;
  width: 100%;
  transition: background-color 0.15s ease-in-out;
  margin-top: 1rem;
}

.btn-primary:hover,
#kc-login:hover {
  background-color: #e64502;
  border-color: transparent;
}

.btn-primary:focus,
#kc-login:focus {
  box-shadow: 0 0 0 0.125em rgba(255, 78, 2, 0.25);
  outline: none;
}

/* Social login / IDP buttons */
#kc-social-providers {
  margin-top: 2rem;
  border-top: 1px solid #dbdbdb;
  padding-top: 2rem;
}

#kc-social-providers ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#kc-social-providers li {
  margin-bottom: 1rem;
}

.zocial,
.social-link-style {
  width: 100%;
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  border: 1px solid #dbdbdb;
  background-color: white;
  color: #363636;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-weight: 600;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.zocial:hover,
.social-link-style:hover {
  background-color: #f5f5f5;
  border-color: #b5b5b5;
}

/* Alert messages */
.alert {
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.alert-error,
.kc-feedback-text {
  background-color: #feecf0;
  border: 1px solid #f14668;
  color: #cc0f35;
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #f1c039;
  color: #8a6116;
}

.alert-success {
  background-color: #effaf5;
  border: 1px solid #48c78e;
  color: #257953;
}

.alert-info {
  background-color: #eff5fb;
  border: 1px solid #3e8ed0;
  color: #296fa8;
}

/* Links */
#kc-form-options {
  margin-top: 1.5rem;
  text-align: center;
}

#kc-form-options a,
#kc-form-options span a,
#kc-form-options .kc-form-options-wrapper a,
.kc-form-options-wrapper a,
#kc-info a {
  color: var(--primary-color) !important;
  text-decoration: none;
}

#kc-form-options a:hover,
#kc-form-options span a:hover,
#kc-form-options .kc-form-options-wrapper a:hover,
.kc-form-options-wrapper a:hover,
#kc-info a:hover {
  color: #e64502 !important;
  text-decoration: underline;
}

/* Override PatternFly link color in login form */
.login-pf #kc-form-options a,
.login-pf #kc-form-options span a,
.login-pf .kc-form-options-wrapper a {
  color: var(--primary-color) !important;
}

.login-pf #kc-form-options a:hover,
.login-pf #kc-form-options span a:hover,
.login-pf .kc-form-options-wrapper a:hover {
  color: #e64502 !important;
}

#kc-form-options span > a {
  color: var(--primary-color) !important;
}

#kc-form-options span > a:hover {
  color: #e64502 !important;
}

/* Checkbox */
.checkbox input[type="checkbox"] {
  accent-color: var(--primary-color);
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
}

.checkbox label {
  display: flex;
  align-items: center;
  font-weight: normal;
}

/* Info section - Legal notices */
#kc-info {
  margin-top: 1.5rem;
  text-align: center;
  color: #4a4a4a;
  font-size: 0.875rem;
  padding: 1rem 0;
}

#kc-info-wrapper {
  margin-top: 1.5rem;
  padding-top: 0;
}

#kc-info a {
  color: var(--primary-color);
  text-decoration: none;
  transition: text-decoration 0.2s ease;
}

#kc-info a:hover {
  text-decoration: underline;
}

.kc-info-separator {
  margin: 0 0.5rem;
  color: #7a7a7a;
}

/* Registration link */
#kc-registration {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dbdbdb;
}

#kc-registration a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

#kc-registration a:hover {
  text-decoration: underline;
}


/* Locale selector - hidden */
#kc-locale,
#kc-locale-dropdown,
.kc-locale-dropdown {
  display: none !important;
}

/* Footer */
#kc-content-wrapper {
  padding-bottom: 2rem;
}
.login-pf-page-footer {
  text-align: center;
  padding: 1rem;
  color: #4a4a4a;
  font-size: 0.875rem;
}

.login-pf-page-footer a {
  color: var(--primary-color);
  text-decoration: none;
  margin: 0 0.5rem;
}

.login-pf-page-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .card-pf {
    margin: 1rem;
    padding: 1.5rem;
  }

  #kc-page-title {
    font-size: 1.25rem;
  }
}

/* Loading animation */
.kc-loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 78, 2, 0.3);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Remove remember me on mobile */
@media (max-width: 480px) {
  #kc-form-options .checkbox {
    font-size: 0.875rem;
  }
}

/* Identity provider divider - removed */
.kc-social-section {
  display: none;
}
