/* Login Engage Solar — card split institucional + formulário */

.es-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #0f172a;
  background:
    radial-gradient(ellipse 80% 50% at 12% 0%, rgba(255, 152, 37, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 100%, rgba(37, 99, 235, 0.06), transparent 50%),
    #f4f8fc;
  overflow-x: hidden;
}

.es-login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px) clamp(12px, 2.5vw, 24px);
  box-sizing: border-box;
  gap: 18px;
}

.es-login-stage {
  width: 100%;
  max-width: 1120px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.es-login-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  width: min(100%, 1120px);
  min-height: min(720px, calc(100dvh - 88px));
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.03),
    0 24px 64px rgba(15, 23, 42, 0.1);
}

.es-login-hero {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #0b1f3a;
  overflow: hidden;
}

.es-login-hero-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  user-select: none;
}

.es-login-form-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: clamp(24px, 3.2vw, 40px) clamp(22px, 3vw, 36px);
  background: #ffffff;
  box-sizing: border-box;
}

.es-login-mobile-brand {
  display: none;
  margin: 0 auto 18px;
  text-decoration: none;
}

.es-login-mobile-brand img {
  display: block;
  margin: 0 auto;
  max-height: 44px;
}

.es-login-head {
  text-align: center;
  margin-bottom: 0.15rem;
}

.es-login-head-sun {
  display: block;
  margin: 0 auto 10px;
  width: 48px;
  height: 48px;
}

.es-login-welcome {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
}

.es-login-logo {
  margin: 0.15rem 0 0.4rem;
  font-size: clamp(1.85rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.es-logo-engage {
  color: #0b2a5b;
}

.es-logo-solar {
  color: #f97316;
}

.es-login-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.es-login-tenant {
  margin-top: 0.65rem;
}

.es-login-tenant[hidden] {
  display: none !important;
}

.es-login-tenant-field > span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.es-login-tenant-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font: inherit;
  font-size: 0.92rem;
  color: #0f172a;
  background: #fff;
}

.es-login-tenant-hint {
  margin: 0.45rem 0 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #64748b;
}

.es-login-form {
  margin-top: 1.1rem;
}

.es-login-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.es-field > span:first-child {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.es-input-affix {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.es-input-affix:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.es-input-affix-lead,
.es-input-affix-trail {
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  background: #fff;
}

.es-input-affix-lead {
  border-right: 1px solid #f1f5f9;
}

.es-input-affix-trail {
  border-left: 1px solid #f1f5f9;
}

.es-input-icon {
  width: 20px;
  height: 20px;
  color: #94a3b8;
}

.es-input-affix-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  background: #fff;
  font: inherit;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
}

.es-input-affix-input::placeholder {
  color: #94a3b8;
}

.es-password-toggle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.es-password-toggle:hover {
  color: #2563eb;
}

.es-password-icon-show,
.es-password-icon-hide {
  width: 20px;
  height: 20px;
}

.es-password-icon-hide[hidden] {
  display: none !important;
}

.es-login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.es-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
}

.es-remember input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.es-forgot {
  font-size: 0.88rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.es-forgot:hover {
  text-decoration: underline;
}

.es-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0.65rem;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #ff9825 0%, #f97316 48%, #ff8500 100%);
  box-shadow:
    0 4px 14px rgba(249, 115, 22, 0.35),
    0 0 0 1px rgba(249, 115, 22, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.es-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 24px rgba(249, 115, 22, 0.4),
    0 0 0 1px rgba(249, 115, 22, 0.1);
}

.es-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.es-submit-arrow {
  width: 20px;
  height: 20px;
}

.es-divider {
  margin: 1rem 0 0.7rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.es-divider span {
  position: relative;
  padding: 0 12px;
}

.es-divider span::before,
.es-divider span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 56px;
  height: 1px;
  background: #e2e8f0;
}

.es-divider span::before {
  right: 100%;
}

.es-divider span::after {
  left: 100%;
}

.es-social {
  display: grid;
  gap: 0.55rem;
}

.es-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.es-social-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.es-social-btn[hidden] {
  display: none !important;
}

.es-trust {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #f1f6fc;
  border: 1px solid #e8eef7;
}

.es-trust svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #2563eb;
  margin-top: 1px;
}

.es-trust p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #64748b;
}

.es-feedback {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  text-align: center;
}

.es-feedback[data-type='error'] {
  background: #fef2f2;
  color: #b91c1c;
}

.es-feedback[data-type='success'] {
  background: #ecfdf5;
  color: #047857;
}

.es-feedback[data-type='info'] {
  background: #eff6ff;
  color: #1d4ed8;
}

.es-login-footer {
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
  max-width: 1120px;
}

.es-login-footer p {
  margin: 0;
}

.es-login-footer a {
  color: #2563eb;
  text-decoration: none;
}

.es-login-footer a:hover {
  text-decoration: underline;
}

/* Tablet — reduz paddings, mantém dois painéis */
@media (max-width: 980px) {
  .es-login-card {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
    min-height: min(640px, calc(100dvh - 72px));
    border-radius: 22px;
  }

  .es-login-form-col {
    padding: 22px 20px;
  }

  .es-login-logo {
    font-size: 1.75rem;
  }
}

/* Mobile — prioriza formulário; oculta painel institucional */
@media (max-width: 720px) {
  .es-login-wrap {
    justify-content: flex-start;
    padding: 20px 14px 24px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .es-login-stage {
    flex: 0 1 auto;
    align-items: stretch;
  }

  .es-login-card {
    display: block;
    width: 100%;
    min-height: 0;
    border-radius: 20px;
  }

  .es-login-hero {
    display: none;
  }

  .es-login-form-col {
    padding: 28px 22px 32px;
    overflow: visible;
  }

  .es-login-mobile-brand {
    display: block;
  }

  .es-login-head-sun {
    display: none;
  }
}

@media (max-width: 480px) {
  .es-login-form-col {
    padding: 24px 18px 28px;
  }

  .es-divider span::before,
  .es-divider span::after {
    width: 36px;
  }
}
