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

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

.login-page {
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: #f7f6f2;
  -webkit-font-smoothing: antialiased;
}

.login-split {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(0, 1.08fr);
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

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

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

.login-panel__glow {
  display: none;
}

.login-panel__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: 100%;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 1.4vh, 16px);
  margin-bottom: clamp(14px, 2.2vh, 28px);
}

.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;
  height: clamp(40px, 6vh, 60px);
  filter: none;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--berry);
  background: rgba(227, 30, 36, 0.07);
  border: 1px solid rgba(227, 30, 36, 0.14);
}

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

.login-intro {
  margin-bottom: clamp(14px, 2vh, 24px);
}

.login-title {
  margin: 0 0 clamp(6px, 1vh, 10px);
  font-family: var(--font-title);
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}

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

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

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

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

.login-field > span {
  font-size: 0.86rem;
  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: 11px 14px 11px 44px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(50, 43, 33, 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(50, 43, 33, 0.02),
    0 0 0 4px rgba(0, 45, 114, 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(0, 45, 114, 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.88rem;
}

.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: 4px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: var(--white);
  background: var(--red);
  box-shadow: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  background: #c4181e;
  box-shadow: none;
}

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

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}

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

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

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

.login-footer {
  margin-top: clamp(12px, 1.8vh, 18px);
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.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.6vh, 16px) 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #a39a8f;
  line-height: 1.4;
}

.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: #111111;
  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-split {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-brand img {
    height: clamp(40px, 10vw, 56px);
  }

  /* 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: 20px;
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .login-panel {
    padding: 20px 18px;
  }

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

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

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

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