/* Ramah Group login, visual only. Activated by ramah-login.js when a real
 * GLPI login form exists. Authentication remains entirely native.
 */
:root {
  --glpi-logo-light-login: url("../images/ramah-horizontal.png") !important;
  --glpi-logo-dark-login: url("../images/ramah-horizontal.png") !important;
}

body.ramah-login-active {
  color: #263645;
  background: #f7fafc !important;
}

body.ramah-login-active .ramah-brand-panel {
  position: fixed;
  inset: 0 auto 0 0;
  width: 46%;
  z-index: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(36px, 5.2vw, 88px);
  color: #fff;
  background: linear-gradient(149deg, #07375d 0%, #0d497f 48%, #1269a4 78%, #218abb 100%);
  isolation: isolate;
}

body.ramah-login-active .ramah-brand-panel::before,
body.ramah-login-active .ramah-brand-panel::after {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  top: -280px;
  right: -390px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

body.ramah-login-active .ramah-brand-panel::after {
  width: 460px;
  height: 460px;
  top: auto;
  right: auto;
  left: -170px;
  bottom: -290px;
}

body.ramah-login-active .ramah-brand-logo {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 12px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(3, 37, 66, .16);
}
body.ramah-login-active .ramah-brand-logo img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  object-fit: contain;
}
body.ramah-login-active .ramah-brand-kicker {
  display: inline-flex;
  margin-bottom: 20px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .10);
  border-radius: 30px;
  color: #e8f5ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
body.ramah-login-active .ramah-brand-panel h1 {
  margin: 0 0 22px;
  max-width: 550px;
  color: #fff;
  font-size: clamp(38px, 4.1vw, 66px);
  line-height: 1.09;
  font-weight: 730;
  letter-spacing: -.045em;
}
body.ramah-login-active .ramah-brand-panel p {
  max-width: 460px;
  margin: 0;
  color: #e5f2fc;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.65;
}
body.ramah-login-active .ramah-brand-foot {
  color: #d1e8f8;
  font-size: 13px;
}

body.ramah-login-active .page-anonymous {
  position: relative;
  z-index: 1;
  width: 54% !important;
  box-sizing: border-box;
  min-height: 100vh;
  margin-left: 46% !important;
  padding: clamp(26px, 4vw, 76px) !important;
  background: radial-gradient(circle at 100% 0%, #e8f3fa, transparent 42%), #f7fafc !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* GLPI 11: o wrapper .flex-fill é filho direto da página. Quando a página
 * vira um flex container para abrir espaço ao painel institucional, o wrapper
 * precisa ocupar toda a coluna direita (caso contrário encolhe pelo conteúdo).
 */
body.ramah-login-active .page-anonymous > .flex-fill {
  width: 100%;
  min-width: 0;
}
body.ramah-login-active .page-anonymous .container,
body.ramah-login-active .page-anonymous .container-tight {
  max-width: 580px !important;
  width: 100%;
}
body.ramah-login-active .page-anonymous .main-content-card {
  width: 100%;
}
/* Estrutura confirmada no inspetor do GLPI Ramah:
 * form[action="/front/login.php"] > .row.justify-content-center > .col-md-5
 * A coluna 5/12 faz todo o formulário parecer minúsculo no layout dividido.
 * O ajuste não afeta formulários de outras páginas anônimas ou SSO.
 */
body.ramah-login-active .page-anonymous form[action$="/front/login.php"] > .row.justify-content-center > .col-md-5 {
  flex: 0 1 420px !important;
  width: 100% !important;
  max-width: 100% !important;
}
body.ramah-login-active .page-anonymous .glpi-logo {
  width: min(270px, 90%) !important;
  height: 110px !important;
  max-width: 100%;
  margin-inline: auto;
  background: url("../images/ramah-horizontal.png") center / contain no-repeat !important;
}
body.ramah-login-active .page-anonymous .card {
  border: 1px solid #dae8f2 !important;
  background: #fff !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 65px rgba(13, 73, 127, .09) !important;
}
body.ramah-login-active .page-anonymous .card-title,
body.ramah-login-active .page-anonymous h2,
body.ramah-login-active .page-anonymous label,
body.ramah-login-active .page-anonymous .form-label {
  color: #263645 !important;
}
body.ramah-login-active .page-anonymous .form-control,
body.ramah-login-active .page-anonymous .form-select {
  color: #263645 !important;
  background: #f9fbfd !important;
  border-color: #cfdee9 !important;
  border-radius: 10px !important;
}
body.ramah-login-active .page-anonymous .form-control:focus,
body.ramah-login-active .page-anonymous .form-select:focus {
  border-color: #1269a4 !important;
  box-shadow: 0 0 0 3px rgba(18,105,164,.17) !important;
}
body.ramah-login-active .page-anonymous .btn-primary {
  background: linear-gradient(100deg, #1269a4, #0d497f) !important;
  border-color: #0d497f !important;
  color: #fff !important;
  border-radius: 10px !important;
  font-weight: 700;
  min-height: 42px;
}
body.ramah-login-active .page-anonymous .btn-primary:hover {
  background: #083f70 !important;
}
body.ramah-login-active .page-anonymous a { color: #1269a4; }
body.ramah-login-active .page-anonymous :focus-visible {
  outline: 3px solid rgba(18,105,164,.42);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  body.ramah-login-active .ramah-brand-panel {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 240px;
    padding: 28px clamp(20px, 6vw, 48px);
    gap: 18px;
  }
  body.ramah-login-active .ramah-brand-logo {
    padding: 8px 13px;
    border-radius: 12px;
  }
  body.ramah-login-active .ramah-brand-logo img { width: 180px; }
  body.ramah-login-active .ramah-brand-panel h1 {
    font-size: clamp(26px, 5vw, 36px);
    margin: 0 0 8px;
  }
  body.ramah-login-active .ramah-brand-panel p,
  body.ramah-login-active .ramah-brand-foot { display: none; }
  body.ramah-login-active .ramah-brand-kicker {
    margin-bottom: 10px;
    font-size: 10px;
  }
  body.ramah-login-active .page-anonymous {
    width: 100% !important;
    margin-left: 0 !important;
    min-height: calc(100vh - 240px);
    padding: 24px 18px 42px !important;
  }
}
@media (max-width: 560px) {
  body.ramah-login-active .ramah-brand-panel {
    min-height: 185px;
    padding: 20px 22px;
    gap: 12px;
  }
  body.ramah-login-active .ramah-brand-logo img { width: 145px; }
  body.ramah-login-active .ramah-brand-panel h1 {
    font-size: 25px;
    letter-spacing: -.025em;
  }
  body.ramah-login-active .ramah-brand-kicker { display: none; }
  body.ramah-login-active .page-anonymous {
    min-height: calc(100vh - 185px);
    padding: 20px 14px 32px !important;
  }
  body.ramah-login-active .page-anonymous .card { border-radius: 15px !important; }
  body.ramah-login-active .page-anonymous .glpi-logo {
    height: 78px !important;
    width: 190px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.ramah-login-active *, body.ramah-login-active *::before, body.ramah-login-active *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
