*,
*::before,
*::after {
  box-sizing: border-box;
}

html:has(.login-page .login-visual) {
  height: 100%;
  overflow: hidden;
}

.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #F2F0F7;
  -webkit-font-smoothing: antialiased;
}

/* Login com banner: trava viewport, sem scroll */
.login-page:has(.login-visual) {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.login-split {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-page:has(.login-visual) .login-split {
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

/* —— Painel do formulário —— */

.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(16px, 3.2vh, 40px) clamp(20px, 4vw, 56px);
  background: #FFFFFF;
}

.login-page:has(.login-visual) .login-panel {
  height: 100%;
  overflow: hidden;
}

.login-panel__glow {
  display: none;
}

.login-panel__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(8px, 1.4vh, 14px);
  margin-bottom: clamp(12px, 2.4vh, 24px);
  flex-shrink: 0;
}

.login-brand {
  display: inline-block;
  line-height: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-brand:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.login-brand img {
  width: auto;
  max-width: min(100%, 260px);
  height: clamp(56px, 10vh, 96px);
  object-fit: contain;
  filter: none;
  background: transparent;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--berry);
  background: rgba(138, 13, 255, 0.07);
  border: 1px solid rgba(138, 13, 255, 0.14);
}

.login-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--berry);
  box-shadow: 0 0 0 3px rgba(138, 13, 255, 0.18);
}

.login-intro {
  margin-bottom: clamp(10px, 2vh, 20px);
  flex-shrink: 0;
}

.login-title {
  margin: 0 0 clamp(4px, 0.8vh, 10px);
  font-family: var(--font-title);
  font-size: clamp(1.45rem, 2.8vh + 0.4vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--brown);
}

.login-lead {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: clamp(0.86rem, 1.5vh + 0.2vw, 0.98rem);
  line-height: 1.45;
}

.login-form-wrap {
  padding: clamp(14px, 2.2vh, 22px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(229, 198, 255, 0.85);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 48px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.login-form {
  display: grid;
  gap: clamp(10px, 1.6vh, 16px);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.01em;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap input {
  width: 100%;
  border: 1px solid #e4e0d8;
  border-radius: 12px;
  padding: clamp(10px, 1.5vh, 13px) 14px clamp(10px, 1.5vh, 13px) 44px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.login-input-wrap input::placeholder {
  color: #a39a8f;
}

.login-input-wrap input:hover {
  border-color: #d5cfc3;
}

.login-input-wrap input:focus {
  outline: none;
  border-color: var(--green-2);
  background: #fff;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.02),
    0 0 0 4px rgba(108, 0, 214, 0.1);
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9a8f82;
  pointer-events: none;
}

.login-field--password .login-input-wrap input {
  padding-right: 48px;
}

.login-toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8a7f74;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.login-toggle-pw:hover {
  background: rgba(108, 0, 214, 0.06);
  color: var(--green-2);
}

.login-toggle-pw svg {
  width: 18px;
  height: 18px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.84rem;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green-2);
  cursor: pointer;
}

.login-link {
  color: var(--green-2);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-link:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-submit {
  margin-top: 2px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: clamp(11px, 1.6vh, 14px) 18px;
  font: inherit;
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: var(--cream);
  background: linear-gradient(135deg, #6C00D6 0%, var(--green-2) 48%, #120024 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 10px 24px rgba(108, 0, 214, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 14px 32px rgba(108, 0, 214, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.login-submit:active {
  transform: translateY(0);
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: clamp(8px, 1.4vh, 14px);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.login-alert__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.login-alert--error {
  background: rgba(138, 13, 255, 0.07);
  border: 1px solid rgba(138, 13, 255, 0.18);
  color: #8f2f44;
}

.login-alert--warn {
  background: rgba(196, 124, 255, 0.12);
  border: 1px solid rgba(196, 124, 255, 0.28);
  color: #6b4f1a;
}

.login-footer {
  margin-top: clamp(10px, 1.8vh, 18px);
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
  flex-shrink: 0;
}

.login-footer p {
  margin: 0;
}

.login-footer a {
  color: var(--green-2);
  font-weight: 700;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-copy {
  margin: clamp(10px, 1.8vh, 18px) 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #a39a8f;
  line-height: 1.4;
  flex-shrink: 0;
}

.login-copy__credit {
  display: inline;
  color: #a39a8f;
}

.login-copy__credit strong,
.login-copy__credit a {
  color: #7d7469;
  font-weight: 700;
}

/* —— Painel visual —— */

.login-visual {
  position: relative;
  overflow: hidden;
  background: #120024;
  min-height: 0;
  height: 100%;
}

.login-visual__media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border: 0;
}

/* —— Responsivo —— */

@media (max-width: 1080px) {
  .login-page:has(.login-visual) .login-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(110px, 26dvh) minmax(0, 1fr);
  }

  .login-split {
    grid-template-columns: 1fr;
  }

  .login-visual {
    order: -1;
    min-height: 0;
    height: 100%;
  }

  .login-brand img {
    height: clamp(64px, 12vh, 96px);
  }

  /* Portal do inscrito: sem logo no painel em mobile/tablet */
  .login-page--inscrito .login-brand,
  .login-page--inscrito .login-brand img {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .login-page--inscrito .login-header {
    margin-bottom: clamp(8px, 1.5vh, 14px);
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .login-panel {
    padding: 14px 16px 18px;
    align-items: flex-start;
  }

  .login-panel__inner {
    justify-content: flex-start;
    padding-top: 4px;
  }

  .login-header {
    margin-bottom: 10px;
  }

  .login-form-wrap {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .login-intro {
    margin-bottom: 10px;
  }

  .login-lead {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-height: 720px) {
  .login-lead {
    display: none;
  }

  .login-copy {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand,
  .login-submit,
  .login-input-wrap input,
  .login-toggle-pw {
    transition: none;
  }
}
