@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Roboto:wght@400;500;700&family=Source+Sans+3:wght@400;500;600;700&family=Titillium+Web:wght@400;600;700&display=swap');

:root {
  /* CORES MEDIDAS DO CLIENTE */
  --tjpa-navy: #1B2F62;
  --tjpa-navy-deep: #1B2F62; /* RGB 27, 47, 98 */
  --tjpa-blue: #3A5693;
  --tjpa-panel-deep: #1B2F62;
  --tjpa-panel-hover: #142448;
  --page-bg: #E8EEF4; /* RGB 232, 238, 244 */
  --surface: #FFFFFF; /* RGB 255, 255, 255 */
  --text: #1A2B3C;
  --text-muted: #5A6B7D;
  --border: #D0DBE6; /* RGB 208, 219, 230 */
  --input-bg: #F7F9FC;
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-brand: "Titillium Web", "Source Sans 3", sans-serif;
  --font-button: "Roboto", "Source Sans 3", sans-serif;

  /* DIMENSÕES EXATAS DO CARD */
  --card-width: 860px;
  --card-height: 780px;
}

/* OCULTA ESTRUTURAS NATIVAS DO GLPI 11 */
body.login-page {
  background: var(--page-bg) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

body.login-page #page,
body.login-page .page,
body.login-page .card-login,
body.login-page #login-box,
body.login-page .container-tight,
#external-registration-btn-container {
  display: none !important;
}

/* OVERLAY FIXO DA NOVA TELA TJPA */
#tjpa-login-shell-container {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: var(--page-bg) !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

/* MODAL BOOTSTRAP NO TOPO */
#registrationModal,
body.login-page .modal-backdrop {
  z-index: 1000000 !important;
}

.auth-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CARD COM MEDIDAS EXACTAS DO CLIENTE (860px x 780px) */
.auth-card {
  width: 100%;
  max-width: var(--card-width);
  height: var(--card-height);
  display: grid;
  grid-template-columns: 365.5px 494.5px; /* Colunas 365,5 / 494,5 */
  background: var(--surface);
  border-radius: var(--radius); /* radius 14 */
  box-shadow: 0 18px 48px rgba(27, 47, 98, 0.14);
  overflow: hidden;
  box-sizing: border-box;
}

/* PAINEL ESQUERDO (365,5px - #1B2F62) */
.auth-panel {
  position: relative;
  overflow: hidden;
  background: var(--tjpa-panel-deep);
  color: #FFFFFF;
  padding: 5.6px 28px 13.6px 28px; /* pad E/D 28 | top 5,6 | bottom 13,6 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px; /* gap flex 20 */
  isolation: isolate;
  box-sizing: border-box;
}

/* MARCA D'ÁGUA DO PRÉDIO (top 34% · scale 0,68 · opacity 0.22 · invert + mix-blend-mode screen) */
.auth-panel__watermark-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-panel__watermark {
    position: absolute;
    top: 32%;
    left: 0px;
    width: 100%;
    height: 68%;
    object-fit: cover;
    object-position: 50% 15%;
    opacity: 0.22;
    filter: invert(1);
    mix-blend-mode: screen;
    pointer-events: none;
    transform: none !important;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 1) 18%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 1) 18%);
}

.auth-panel__brand, .auth-panel__info {
  position: relative;
  z-index: 1;
}

.auth-panel__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-panel__logo-white-img {
  display: block;
  width: auto;
  max-width: 168px; /* 168x210 */
  height: 210px; /* brasão 210 */
  object-fit: contain;
}

.auth-panel__titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  margin-top: -17.6px; /* títulos margin-top -17,6px */
  font-family: var(--font-brand);
}

.auth-panel__poder {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  text-transform: uppercase;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
}

.auth-panel__tribunal {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.auth-panel__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.auth-panel__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  text-align: center;
}

.auth-panel__central {
  margin: 0 0 0.15rem;
  font-family: var(--font-button);
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF;
}

.auth-panel__contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-family: var(--font-button);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.95);
}

.auth-panel__contacts li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.auth-panel__label {
  font-weight: 700;
  color: #FFFFFF;
}

.auth-panel__contacts a {
  color: #FFFFFF;
  text-decoration: none;
}

.auth-panel__icon img, .auth-panel__icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.auth-panel__hours {
  margin-top: 12px; /* horários m-top 12px */
  font-family: var(--font-button);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.auth-panel__hours p {
  margin: 0;
}

.auth-panel__hours-title {
  font-weight: 700;
  color: #FFFFFF;
}

/* PAINEL DIREITO (494,5px - pad form E/D 40) */
.auth-form-wrap {
  padding: 5.6px 40px 40px 40px; /* pad form E/D 40 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  box-sizing: border-box;
}

.auth-form-wrap__header {
  text-align: center;
  margin-top: 45.6px; /* header m-top 45,6px */
  margin-bottom: 1.35rem;
}

.auth-form-wrap__glpi {
  display: block;
  width: 101.4px; /* logo GLPI 101.4x56 */
  height: 56px;
  object-fit: contain;
  margin: 0 auto;
}

.auth-views {
  opacity: 1;
  transition: opacity 0.15s ease-in-out;
}

.auth-views:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.auth-views[hidden] {
  display: none !important;
  opacity: 0;
}

.internal-stack, .provider-stack {
  display: grid;
  gap: 12px; /* gap interno 12px / providers gap 12px */
}

.auth-divider--muted {
  margin-top: 45.6px; /* m-top 45,6px */
  margin-bottom: 2.4px; /* m-bottom 2,4px */
  font-family: var(--font-button);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tjpa-panel-deep);
  text-align: center;
}

.provider-stack{
  margin-top: 12px;
}

.auth-divider--line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 45px; 
}

.auth-divider--line::before, .auth-divider--line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(27, 47, 98, 0.28);
}

.auth-divider--or {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.1rem 0;
  font-family: var(--font-button);
  font-size: 0.82rem;
  color: var(--tjpa-panel-deep);
  text-align: center;
}

.auth-divider--or::before, .auth-divider--or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* BOTÕES DE ACESSO (botão 414.5 x 52.8 | pad 14.4 / 20 | radius 8) */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 414.5px; /* 414,5px */
  height: 52.8px; /* altura 52,8px */
  padding: 0 14.4px; /* pad 14.4 */
  border: 1px solid var(--border); /* #D0DBE6 */
  border-radius: 8px; /* radius 8 */
  font-family: var(--font-button);
  font-weight: 600; /* weight 600 */
  font-size: 15.2px; /* fonte 15.2px */
  color: #1B2F62; /* texto #1B2F62 */
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  box-sizing: border-box;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--interno, .btn--microsoft, .btn--provider {
  background: #FFFFFF;
  color: #1B2F62;
}

.btn--interno:hover, .btn--microsoft:hover, .btn--provider:hover {
  background: #f4f7fb;
}

.btn--panel-dark {
  background: #1B2F62;
  color: #FFFFFF;
  border: none;
}

.btn--panel-dark:hover {
  background: var(--tjpa-panel-hover);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border: none;
  background: transparent;
  font-family: var(--font-button);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tjpa-panel-deep);
  cursor: pointer;
}

/* FORMULÁRIO NATIVO */
.glpi-form-placeholder {
  width: 100% !important;
}

.glpi-form-placeholder h2,
.glpi-form-placeholder .card-title,
.glpi-form-placeholder .card-header,
.glpi-form-placeholder .text-muted,
.glpi-form-placeholder p.text-center {
  display: none !important;
}

.glpi-form-placeholder form {
  width: 100% !important;
  max-width: 100% !important;
}

.glpi-form-placeholder form .row,
.glpi-form-placeholder form .row.justify-content-center {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  display: block !important;
}

.glpi-form-placeholder form [class*="col"] {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.label-row-custom {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 0.4rem !important;
}

.glpi-form-placeholder label {
  font-family: var(--font-button) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: var(--tjpa-panel-deep) !important;
  margin-bottom: 0.4rem !important;
}

.link-forgot-password,
.glpi-form-placeholder a[href*="lostpassword"] {
  font-family: var(--font-button) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--tjpa-panel-deep) !important;
  text-decoration: none !important;
  float: right !important;
}

.link-forgot-password:hover,
.glpi-form-placeholder a[href*="lostpassword"]:hover {
  text-decoration: underline !important;
}

.glpi-form-placeholder input[type="text"],
.glpi-form-placeholder input[type="password"],
.glpi-form-placeholder select {
  width: 100% !important;
  padding: 0.85rem 1rem !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--input-bg) !important;
  font-family: var(--font-button) !important;
  font-size: 1rem !important;
  box-sizing: border-box !important;
  height: auto !important;
}

.glpi-form-placeholder input[type="text"]:focus,
.glpi-form-placeholder input[type="password"]:focus,
.glpi-form-placeholder select:focus {
  outline: none !important;
  border-color: var(--tjpa-panel-deep) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(27, 47, 98, 0.15) !important;
}

/* Oculta os botões nativos do Google OAuthSSO e SAML */
.glpi-form-placeholder .list-group,
.glpi-form-placeholder .list-group-horizontal,
.glpi-form-placeholder a[href*="oauthsso"],
.glpi-form-placeholder a[title="Google"],
.plugin_glpisaml_login,
#saml_header,
#saml_buttons,
#external-registration-btn-container {
  display: none !important;
}

.plugin_glpisaml_login,
#saml_header,
#saml_buttons,
#external-registration-btn-container {
  display: none !important;
}

.glpi-form-placeholder button[type="submit"],
.glpi-form-placeholder input[type="submit"],
.glpi-form-placeholder .form-footer button {
  width: 100% !important;
  padding: 0.95rem 1.25rem !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  background: var(--tjpa-panel-deep) !important;
  color: #fff !important;
  font-family: var(--font-button) !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  margin-top: 1rem !important;
  box-shadow: 0 4px 14px rgba(27, 47, 98, 0.25) !important;
}

.glpi-form-placeholder button[type="submit"]:hover,
.glpi-form-placeholder input[type="submit"]:hover {
  background: var(--tjpa-panel-hover) !important;
}

/* FAQ BOTÃO (FAQ 84.8 x 37.6 | fonte 14.4px | footer m-top 65.6px) */
.auth-form-wrap__footer {
  margin-top: 65.6px; /* FAQ m-top 65,6px / footer m-top 65,6px */
  display: flex;
  justify-content: center;
}

.auth-form-wrap__faq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 84.8px; /* FAQ 84.8x37.6 */
  height: 37.6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
  color: #1B2F62;
  font-family: var(--font-button);
  font-size: 14.4px; /* fonte 14.4px */
  font-weight: 600;
  text-decoration: none;
}

.auth-form-wrap__faq:hover {
  background: #f4f7fb;
}

.page-footer {
  padding: 1rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* RESPONSIVIDADE PARA DISPOSITIVOS MÓVEIS (< 860px) */
@media (max-width: 860px) {
  #tjpa-login-shell-container {
    padding: 0.5rem !important;
    justify-content: flex-start !important;
  }

  .auth-card {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 480px;
    height: auto;
    min-height: 0;
    border-radius: 14px;
    margin: 0 auto;
  }

  .auth-panel {
    padding: 1.5rem 1.25rem;
    gap: 1.25rem;
  }

  .auth-panel__watermark {
    top: 20%;
    scale: 0.8;
  }

  .auth-panel__logo-white-img {
    height: 160px;
    max-width: 140px;
  }

  .auth-form-wrap {
    padding: 1.5rem 1.25rem;
  }

  .auth-form-wrap__header {
    margin-top: 1rem;
  }

  .btn {
    height: 48px;
    font-size: 14px;
    padding: 0 10px;
  }

  .auth-form-wrap__footer {
    margin-top: 2rem;
  }
}