/* ==========================================================================
   Surcharge tenant du CSS de /signin (views/login.view.php tenant) et /logout
   (vue par défaut views/logout.view.php, section « Logout » en fin de fichier).
   Design « orbes génératives » : fond animé PixiJS + carte translucide.
   Démo et doc : https://georgefrancis.dev/writing/create-a-generative-landing-page-and-webgl-powered-background/
   ========================================================================== */

:root {
  /* Teintes par défaut : le script de /signin les remplace au chargement puis à
     chaque clic ; elles restent telles quelles sans JS et sur /logout */
  --hue: 320;
  --hue-complimentary1: 350;
  --hue-complimentary2: 20;

  --dark-color: hsl(var(--hue), 100%, 9%);
  --light-color: hsl(var(--hue), 95%, 98%);
  --base: hsl(var(--hue), 95%, 50%);
  --complimentary1: hsl(var(--hue-complimentary1), 95%, 50%);
  --complimentary2: hsl(var(--hue-complimentary2), 95%, 50%);

  /* Couleur de marque du tenant (injectée par app.ini.php via $HtmlHeadBase) */
  --brand: var(--app-primary, #fb3900);

  --font-family: "Montserrat", system-ui;

  --bg-gradient: linear-gradient(
    to bottom,
    hsl(var(--hue), 95%, 99%),
    hsl(var(--hue), 95%, 84%)
  );
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  max-width: 1920px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  font-family: var(--font-family);
  color: var(--dark-color);
  background: var(--bg-gradient);
}

.orb-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

strong {
  font-weight: 600;
}

.overlay {
  width: 100%;
  max-width: 1140px;
  max-height: 640px;
  padding: 8rem 6rem;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.375);
  box-shadow: 0 0.75rem 2rem 0 rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  border: 1px solid #e5e5e55d;
}

.overlay__inner {
  max-width: 36rem;
}

.overlay__title {
  font-size: 1.875rem;
  line-height: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
}

.text-gradient {
  font-size: 1.3em;
  background-image: linear-gradient(
    45deg,
    var(--base) 25%,
    var(--complimentary2)
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-background-clip: text;
  -moz-text-fill-color: transparent;
}

.overlay__description {
  font-size: 1rem;
  line-height: 1.75rem;
  margin-bottom: 3rem;
}

.overlay__btns {
  width: 100%;
  max-width: 40rem;
  display: flex;
}

.overlay__btn {
  width: 50%;
  height: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--light-color);
  background: var(--dark-color);
  border: none;
  border-radius: 0.5rem;
  transition: transform 150ms ease;
  outline-color: hsl(var(--hue), 95%, 50%);
}

.overlay__btn:hover {
  transform: scale(1.05);
  cursor: pointer;
}

.overlay__btn--transparent {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
  padding: 30px;
  margin: auto;
}

.overlay__btn-emoji {
  margin-right: 0.375rem;
}

/* Formulaire login / mot de passe ($connectWithPassword) */
.overlay__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.overlay__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.overlay__input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 0.95rem;
  color: var(--dark-color);
}

.overlay__input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.overlay__input:focus {
  outline: none;
  border-color: var(--brand);
}

.overlay__form .overlay__btn {
  width: 100%;
  padding: 1rem;
  font-family: var(--font-family);
}

/* Erreur de connexion ($connectError) */
.message {
  background-color: #f5f5f5;
  border-radius: .375em;
  font-size: 1rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.message.is-danger {
  background-color: #feecf0;
}

.message-body {
  border-color: #dbdbdb;
  border-radius: .375em;
  border-style: solid;
  border-width: 0 0 0 4px;
  color: #4a4a4a;
  padding: 1.25em 1.5em;
}

.message.is-danger .message-body {
  border-color: #f14668;
  color: #cc0f35;
}

a {
  text-decoration: none;
  color: var(--dark-color);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Not too many browser support this yet but it's good to add! */
@media (prefers-contrast: high) {
  .orb-canvas {
    display: none;
  }
}

@media only screen and (max-width: 1140px) {
  .overlay {
    padding: 8rem 4rem;
  }
}

@media only screen and (max-width: 840px) {
  body {
    padding: 1.5rem;
  }

  .overlay {
    padding: 4rem;
    height: auto;
  }

  .overlay__title {
    font-size: 1.25rem;
    line-height: 2rem;
    margin-bottom: 1.5rem;
  }

  .overlay__description {
    font-size: 0.875rem;
    line-height: 1.5rem;
    margin-bottom: 2.5rem;
  }
}

@media only screen and (max-width: 600px) {
  .overlay {
    padding: 1.5rem;
  }

  .overlay__btns {
    flex-wrap: wrap;
  }

  .overlay__btn {
    width: 100%;
    font-size: 0.75rem;
    margin-right: 0;
  }

  .overlay__btn:first-child {
    margin-bottom: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Logout (/logout) — habille la vue par défaut views/logout.view.php dans la
   même esthétique : dégradé statique (pas d'orbes ni de JS), carte translucide.
   -------------------------------------------------------------------------- */
.login--single {
  width: 100%;
  max-width: 1140px;
  display: flex;
  justify-content: center;
}

.login--single .login-panel {
  width: 100%;
  max-width: 32rem;
  padding: 4rem 3rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.375);
  box-shadow: 0 0.75rem 2rem 0 rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  border: 1px solid #e5e5e55d;
}

.logout-img {
  display: block;
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
}

.login--single .login-title {
  margin: 1.5rem 0 2rem;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.login--single .login-btn--primary {
  padding: 1rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  background: transparent;
  border: 2px solid var(--brand);
  border-radius: 0.5rem;
  transition: transform 150ms ease;
}

.login--single .login-btn--primary:hover {
  transform: scale(1.05);
}
