/* ============================================================
   Mirantes 360 — Login premium (spec: login_condominio_interface_spec)
   Painel escuro à esquerda + imagem à direita, 50/50 no desktop
   ============================================================ */

.lg-page {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #0b1830;
  color: #f2f2f2;
  overflow: hidden;
}

/* ---------- Painel esquerdo (autenticação) ---------- */
.lg-panel {
  min-height: 100vh;
  background: #0b1830;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 11%;
  animation: lgFadeUp .5s ease-out both;
}

.lg-content {
  width: min(100%, 380px);
  margin-right: auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Marca */
.lg-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 72px;
}
.lg-brand .brand-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: transparent;
  border-radius: 50%;
  flex-shrink: 0;
  max-width: 100%;
  box-shadow: none;
  overflow: hidden;
}
.lg-brand .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #36a0bd, #17617a);
  font-weight: 900;
  color: #fff;
  box-shadow: 0 8px 22px rgba(20, 130, 155, .32);
  font-size: 20px;
  letter-spacing: -1px;
}
.lg-brand .brand-mark span {
  font-size: 9px;
  color: #f3cf77;
}
.lg-brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: -.3px;
}
.lg-brand small {
  display: block;
  color: #707070;
  font-size: 11px;
  letter-spacing: .02em;
}

/* Título */
.lg-title {
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: #f2f2f2;
  margin: 0 0 42px;
}
.lg-title .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 10px;
  background: linear-gradient(135deg, #36a0bd, #d7a94a);
}

/* Formulário */
.lg-form {
  display: grid;
  gap: 24px;
}
.lg-field {
  display: grid;
  gap: 10px;
}
.lg-label {
  font-size: 13px;
  font-weight: 400;
  color: #d0d0d0;
}
.lg-input-wrap {
  position: relative;
}
.lg-input {
  width: 100%;
  height: 54px;
  background: #142542;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  color: #f5f5f5;
  font-size: 14px;
  padding: 0 16px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.lg-input::placeholder { color: #8aa1bd; }
.lg-input:hover { background: #1a2c4e; }
.lg-input:focus {
  outline: none;
  background:
    linear-gradient(#162842, #162842) padding-box,
    linear-gradient(135deg, #36a0bd, #176b87) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 0 4px rgba(54, 160, 189, .15);
}

/* Mostrar/ocultar senha */
.lg-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #707070;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: .2s;
}
.lg-pw-toggle:hover { color: #f2f2f2; background: rgba(255, 255, 255, .06); }
.lg-pw-toggle .eye-closed { display: none; }
.lg-pw-toggle.show .eye-open { display: none; }
.lg-pw-toggle.show .eye-closed { display: block; }

/* Links */
.lg-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -10px;
}
.lg-forgot {
  font-size: 14px;
  color: #e0e0e0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.lg-forgot:hover { color: #fff; }

/* Botão Entrar */
.lg-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(100deg, #176b87 0%, #0f536c 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 8px 24px rgba(23, 107, 135, .35);
}
.lg-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px rgba(23, 107, 135, .5);
}
.lg-btn:active {
  transform: translateY(0) scale(.99);
}
.lg-btn:disabled {
  opacity: .8;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.lg-btn .spinner {
  display: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: lgSpin .7s linear infinite;
}
.lg-btn.loading .spinner { display: inline-block; }
.lg-btn.loading { gap: 8px; }
@keyframes lgSpin { to { transform: rotate(360deg); } }

/* Link de registo */
.lg-register {
  margin: 36px 0 0;
  text-align: center;
  font-size: 14px;
  color: #b5b5b5;
}
.lg-register a {
  color: #f2f2f2;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.lg-register a:hover { color: #fff; }

/* Footer */
.lg-foot {
  margin-top: auto;
  padding-top: 48px;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}

/* Erro */
.lg-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 82, 82, .10);
  border: 1px solid rgba(255, 82, 82, .35);
  color: #ff9b9b;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  animation: lgErrIn .4s ease both;
}
.lg-error svg { flex: none; }
.lg-error.success {
  background: rgba(19, 128, 91, .12);
  border-color: rgba(19, 128, 91, .4);
  color: #6fd6ae;
}
@keyframes lgErrIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes lgFadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Painel direito (imagem) ---------- */
.lg-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  animation: lgFadeIn .7s ease both;
}
.lg-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.lg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.lg-slide:first-child {
  opacity: 1;
}
.lg-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lg-slide:nth-child(1) { animation: lgSlide1 12s ease-in-out infinite; }
.lg-slide:nth-child(2) { animation: lgSlide2 12s ease-in-out infinite; }

.lg-visual-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 24, 48, .35), rgba(11, 24, 48, .05)),
    linear-gradient(180deg, rgba(11, 24, 48, .15), rgba(11, 24, 48, .40));
  z-index: 1;
}
.lg-visual::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 120px;
  background: linear-gradient(90deg, #0b1830, transparent);
  z-index: 2;
  pointer-events: none;
}
@keyframes lgSlide1 {
  0%, 42%   { opacity: 1; transform: scale(1.03); }
  50%, 92%  { opacity: 0; transform: scale(1); }
  100%      { opacity: 1; transform: scale(1.03); }
}
@keyframes lgSlide2 {
  0%, 42%   { opacity: 0; transform: scale(1); }
  50%, 92%  { opacity: 1; transform: scale(1.03); }
  100%      { opacity: 0; transform: scale(1); }
}
@keyframes lgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Responsividade ---------- */

/* Tablet 768–1023: coluna única, imagem como fundo */
@media (max-width: 1023px) and (min-width: 768px) {
  .lg-page { grid-template-columns: 1fr; }
  .lg-visual {
    position: fixed;
    inset: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    border-radius: 0;
    z-index: 0;
  }
  .lg-visual .lg-slide img { border-radius: 0; }
  .lg-visual-overlay {
    border-radius: 0;
    background:
      radial-gradient(120% 90% at 88% 8%, rgba(54, 160, 189, .26), transparent 55%),
      linear-gradient(115deg, rgba(11, 24, 48, .72), rgba(11, 24, 48, .45) 60%, rgba(11, 24, 48, .72));
  }
  .lg-visual::before { display: none; }
  .lg-panel {
    position: relative;
    z-index: 1;
    padding: 48px 8%;
    background: rgba(11, 24, 48, .42);
  }
  .lg-title { font-size: clamp(34px, 6vw, 44px); }
}

/* Mobile < 768: coluna única, imagem como fundo */
@media (max-width: 767px) {
  .lg-page {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .lg-visual {
    position: fixed;
    inset: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    border-radius: 0;
    z-index: 0;
  }
  .lg-visual .lg-slide img { border-radius: 0; }
  .lg-visual-overlay {
    border-radius: 0;
    background:
      radial-gradient(120% 90% at 88% 8%, rgba(54, 160, 189, .26), transparent 55%),
      linear-gradient(115deg, rgba(11, 24, 48, .72), rgba(11, 24, 48, .45) 60%, rgba(11, 24, 48, .72));
  }
  .lg-visual::before { display: none; }
  .lg-panel {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 40px 24px 48px;
    background: rgba(11, 24, 48, .42);
  }
  .lg-content { margin: 0 auto; }
  .lg-brand { margin-bottom: 48px; }
  .lg-title { font-size: clamp(34px, 10vw, 44px); }
}

/* Ecrãs baixos (paisagem telemóvel) */
@media (max-height: 620px) and (orientation: landscape) {
  .lg-panel { padding: 28px 9%; align-items: flex-start; }
  .lg-brand { margin-bottom: 32px; }
  .lg-title { margin-bottom: 28px; }
  .lg-form { gap: 18px; }
  .lg-foot { padding-top: 28px; }
}

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .lg-panel, .lg-visual, .lg-slide, .lg-slide img, .lg-error {
    animation: none !important;
  }
  .lg-slide:first-child {
    opacity: 1 !important;
  }
  .lg-slide:not(:first-child) {
    display: none !important;
  }
}

.lg-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: #091428; padding: 4px; border-radius: 10px; }
.lg-tab { flex: 1; border: 0; background: none; padding: 10px; font-size: 14px; font-weight: 600; color: #8aa1bd !important; cursor: pointer; border-radius: 8px; transition: all .2s; }
.lg-tab.active { background: #1a2c4e; color: #fff !important; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
