/**
 * Layout da tela de login (painel): hero roxo à esquerda / topo no mobile, formulário à direita / abaixo.
 * Uma dobra de viewport: sem rolagem no documento; painel pode rolar só se o conteúdo exceder (zoom/texto longo).
 */

/* Este CSS só é incluído nas telas de login (entrar / login). */
html {
  height: 100vh;
  max-height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --login-primary: #6366f1;
  --login-primary-hover: #4f46e5;
  --login-text-muted: #6b7280;
  --login-border: #e5e7eb;
}

.login-page {
  margin: 0;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #111827;
  background: #fff;
}

.login-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .login-shell {
    flex-direction: row;
    align-items: stretch;
  }
}

/* Painel roxo: primeiro no fluxo = esquerda no desktop, topo no mobile */
.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--login-primary);
  color: #fff;
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(48vh, 400px);
}

@media (min-width: 768px) {
  .login-hero {
    flex: 1 1 45%;
    max-width: 50%;
    max-height: none;
    height: 100%;
    align-self: stretch;
    padding: 2rem 1.5rem;
  }
}

.login-hero__svg {
  width: min(100%, 280px);
  max-height: min(30vh, 200px);
  height: auto;
  opacity: 0.95;
  flex-shrink: 1;
}

@media (min-width: 768px) {
  .login-hero__svg {
    width: min(100%, 320px);
    max-height: none;
  }
}

/* Imagem em tela cheia na coluna esquerda; blur mascara upscale/pixelização nas bordas */
.login-hero__bg {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 115%;
  height: 115%;
  margin: 0;
  padding: 0;
  border: 0;
  background-position: var(--login-hero-bg-position, center);
  background-size: var(--login-hero-bg-size, cover);
  background-repeat: var(--login-hero-bg-repeat, no-repeat);
  transform: translate(-50%, -50%) scale(1.02);
  filter: blur(var(--login-hero-bg-blur, 18px));
  -webkit-filter: blur(var(--login-hero-bg-blur, 18px));
  pointer-events: none;
}

/* Mobile: mostrar a arte inteira (cover corta); mais altura para não ficar minúscula */
@media (max-width: 767.98px) {
  .login-hero--has-image {
    max-height: min(58vh, 520px);
  }

  .login-hero--has-image .login-hero__bg {
    width: 100%;
    height: 100%;
    background-size: var(--login-hero-bg-size, cover);
    transform: translate(-50%, -50%);
  }
}

.login-hero--has-image .login-hero__svg {
  display: none;
}

/* Sem imagem de fundo: logo da empresa centralizada, sem desfoque */
.login-hero--no-bg-image .login-hero__brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
}

.login-hero__brand-logo {
  display: block;
  width: auto;
  max-width: min(88vw, 280px);
  max-height: min(32vh, 180px);
  height: auto;
  object-fit: contain;
  filter: none;
  -webkit-filter: none;
}

@media (min-width: 768px) {
  .login-hero__brand-logo {
    max-height: min(48vh, 220px);
  }
}

.login-hero__brand-placeholder {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #fff;
  max-width: min(88vw, 280px);
}

.login-hero__tagline {
  margin: 0.75rem 0 0;
  max-width: 22rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .login-hero__tagline {
    margin: 1.75rem 0 0;
    font-size: 1.35rem;
    max-width: 26rem;
  }
}

/* Formulário */
.login-panel {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-width: 768px) {
  .login-panel {
    flex: 1 1 55%;
    height: 100%;
    max-height: 100%;
    padding: 1.5rem 1.5rem;
  }
}

.login-panel__inner {
  width: 100%;
  max-width: 400px;
}

.login-logo-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1.15rem;
  text-decoration: none;
  color: inherit;
}

.login-logo-link:focus-visible {
  outline: 2px solid var(--login-primary);
  outline-offset: 4px;
  border-radius: 8px;
}

.login-logo {
  display: block;
  margin: 0;
  max-height: 56px;
  width: auto;
  object-fit: contain;
}

.login-logo--placeholder {
  margin: 0;
  width: 120px;
  height: 48px;
  border-radius: 10px;
  border: 2px dashed var(--login-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--login-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-heading-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.login-heading-row__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--login-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-heading-row__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.login-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

.login-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--login-text-muted);
  font-weight: 500;
}

.login-alert {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.login-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap__icon {
  position: absolute;
  left: 0.875rem;
  width: 1.125rem;
  height: 1.125rem;
  color: #9ca3af;
  pointer-events: none;
}

.login-input-wrap input {
  width: 100%;
  padding: 0.7rem 0.875rem 0.7rem 2.65rem;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.login-input-wrap input:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-input-wrap--password input {
  padding-right: 2.75rem;
}

.login-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.35rem;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-password-toggle:hover {
  color: #6b7280;
  background: #f3f4f6;
}

.login-password-toggle:focus-visible {
  outline: 2px solid var(--login-primary);
  outline-offset: 2px;
}

.login-password-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: -0.25rem;
}

.login-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--login-primary);
  cursor: pointer;
}

.login-remember label {
  font-size: 0.875rem;
  color: var(--login-text-muted);
  cursor: pointer;
  user-select: none;
}

.login-submit {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--login-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-submit:hover {
  background: var(--login-primary-hover);
}

.login-submit:focus-visible {
  outline: 2px solid var(--login-primary-hover);
  outline-offset: 2px;
}

.login-footer {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--login-text-muted);
}

.login-footer a {
  color: var(--login-primary);
  font-weight: 500;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-copy {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.6875rem;
  color: #9ca3af;
}
