.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 48px);
  background: #f6fafc;
}

.login-shell {
  width: min(1080px, 100%);
  min-height: min(620px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  overflow: hidden;
  background: var(--branco);
  border: 1px solid #e7edf1;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(8, 31, 69, 0.12);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 54px;
  overflow: hidden;
  padding: clamp(34px, 5vw, 58px);
  background: var(--branco);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: var(--azul);
}

.brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-top span {
  color: var(--azul-marinho);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-logo {
  width: 178px;
  height: auto;
}

.brand-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  padding: 0;
}

.brand-copy h1 {
  margin: 0;
  color: var(--azul-marinho);
  font-size: clamp(2.3rem, 4.2vw, 3.75rem);
  line-height: 1.05;
  font-weight: 800;
}

.brand-copy p:last-child {
  max-width: 430px;
  margin: 18px 0 0;
  color: var(--cinza-escuro);
  font-size: 1rem;
}

.brand-capsules {
  position: absolute;
  right: clamp(8px, 4vw, 56px);
  bottom: clamp(36px, 8vw, 90px);
  width: 204px;
  height: 204px;
  opacity: 0.11;
  pointer-events: none;
}

.brand-capsules span {
  position: absolute;
  display: block;
  border-radius: var(--radius-pill);
  transform: rotate(-45deg);
}

.brand-capsules span:nth-child(1) {
  width: 164px;
  height: 48px;
  right: 12px;
  top: 28px;
  background: var(--azul);
}

.brand-capsules span:nth-child(2) {
  width: 118px;
  height: 48px;
  right: 66px;
  top: 94px;
  background: var(--preto);
}

.brand-capsules span:nth-child(3) {
  width: 98px;
  height: 48px;
  right: 18px;
  top: 146px;
  background: var(--cinza-escuro);
}

.login-panel {
  display: grid;
  align-items: center;
  padding: clamp(26px, 4vw, 44px);
  background: #f1f5f7;
  border-left: 1px solid #e7edf1;
}

.auth-card {
  width: 100%;
  padding: clamp(24px, 3.2vw, 34px);
  background: var(--branco);
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(8, 31, 69, 0.10);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-mark {
  width: 46px;
  height: 46px;
  padding: 8px;
  background: var(--azul-claro);
  border-radius: 8px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--preto);
  font-size: 2.05rem;
  line-height: 1.1;
}

.panel-intro {
  min-height: 0;
  margin: 16px 0 24px;
  color: var(--cinza-escuro);
  font-size: 0.98rem;
}

.login-form {
  display: grid;
  gap: 18px;
}

.form-step {
  display: grid;
  gap: 16px;
}

.form-step[hidden],
.is-hidden {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  color: var(--preto);
  font-size: 0.88rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  color: var(--preto);
  background: var(--branco);
  border: 1px solid #dce4ea;
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(0, 170, 224, 0.14);
}

input[readonly] {
  background: #f7fafb;
}

.form-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.form-actions .primary-button {
  grid-column: 1 / -1;
}

.form-actions .ghost-button:not([hidden]) + .primary-button {
  grid-column: auto;
}

.ghost-button[hidden] {
  display: none;
}

.form-message {
  min-height: 26px;
  margin: 18px 0 0;
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: no-preference) {
  .login-shell {
    animation: login-rise 420ms ease both;
  }
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .login-page {
    display: block;
    padding: 0;
    background: var(--branco);
  }

  .login-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand {
    min-height: 0;
    gap: 22px;
    padding: 24px 28px;
  }

  .brand-copy {
    max-width: 520px;
    padding: 0;
  }

  .brand-copy h1 {
    font-size: clamp(1.95rem, 8vw, 2.7rem);
  }

  .brand-copy p:last-child {
    max-width: 430px;
    margin-top: 14px;
    font-size: 1rem;
  }

  .brand-capsules {
    display: none;
  }

  .login-panel {
    padding: 28px;
    border-left: 0;
    border-top: 1px solid #e7edf1;
  }
}

@media (max-width: 520px) {
  .brand-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    width: 138px;
  }

  .login-panel {
    padding: 18px 16px 28px;
  }

  .panel-heading h2 {
    font-size: 1.58rem;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }
}
