body:has(.auth-shell) {
  zoom: 1;
  overflow-y: scroll;
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  background: #ffffff;
}

.auth-shell .tool-header-main {
  width: min(1500px, calc(100% - 44px));
  margin: 0 auto;
}

.auth-stage {
  display: flex;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  height: calc(100vh - 146px);
  height: calc(100svh - 146px);
  min-height: calc(100vh - 146px);
  min-height: calc(100svh - 146px);
  align-items: center;
  justify-content: flex-start;
  padding:
    clamp(18px, 3vh, 26px)
    max(34px, calc((100vw - 1500px) / 2 + 34px))
    0;
  background: #ffffff url("../../assets/fundo_capa_4.png?v=20260804-auth-stage-bg-4") left center / auto 100% no-repeat;
}

.auth-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.2));
}

.auth-stage::after {
  content: none;
}

.auth-panel {
  width: min(760px, 100%);
  position: relative;
  z-index: 1;
  margin-left: auto;
  border: 1px solid var(--line);
  border-top: 5px solid var(--aqua);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  padding: 30px;
  box-shadow: 0 18px 44px rgba(31, 32, 72, 0.08);
  backdrop-filter: blur(1px);
}

.auth-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.auth-choice {
  display: grid;
  gap: 8px;
  min-height: 136px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 20px;
  color: var(--primary);
  text-decoration: none;
  box-shadow: inset 4px 0 0 var(--aqua);
}

.auth-choice:hover {
  border-color: var(--aqua);
  background: var(--soft);
}

.auth-choice strong {
  font-size: 1.1rem;
}

.auth-choice span,
.auth-back {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.auth-panel--first-access {
  width: min(620px, 100%);
  padding: 18px 22px 16px;
}

.auth-form--first-access {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 8px;
  margin-top: 10px;
}

.auth-form--first-access label {
  gap: 3px;
  font-size: 0.88rem;
}

.auth-form--first-access label:nth-child(1),
.auth-form--first-access label:nth-child(2),
.auth-form--first-access label:nth-child(3) {
  grid-column: 1 / -1;
}

.auth-form--first-access input {
  min-height: 34px;
  padding-block: 6px;
}

.auth-form--first-access button {
  grid-column: 2;
  min-height: 38px;
  margin-top: 0;
  padding-inline: 18px;
}

.auth-panel--first-access .privacy-note {
  margin-top: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.auth-panel--first-access .auth-back {
  margin-top: 8px;
  font-size: 0.9rem;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 700;
}

.auth-form button {
  justify-self: end;
  min-width: 230px;
  padding: 0 24px;
}

.auth-error {
  border-left: 4px solid var(--danger);
  background: #fff1f2;
  padding: 10px 12px;
  color: var(--danger);
  font-weight: 700;
}

.auth-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-device-card {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--aqua);
  background: #ffffff;
  padding: 14px 16px;
}

.auth-device-card span,
.auth-device-card small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-device-card span {
  text-transform: uppercase;
}

.auth-device-card strong {
  color: var(--primary);
  font-size: 1.04rem;
}

.auth-back {
  display: inline-block;
  margin-top: 18px;
  font-weight: 700;
  text-decoration: none;
}

.privacy-note {
  margin-top: 18px;
  color: rgba(64, 82, 112, 0.86);
  font-size: 0.9rem;
  line-height: 1.5;
}

.privacy-note p {
  margin: 0;
}

.privacy-link {
  display: inline;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.privacy-link:hover {
  color: var(--aqua-strong);
}

.privacy-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-top: 5px solid var(--aqua);
  border-radius: 4px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(18, 26, 64, 0.18);
}

.privacy-dialog::backdrop {
  background: rgba(18, 26, 64, 0.3);
}

.privacy-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.privacy-dialog-header .eyebrow {
  margin: 0;
}

.privacy-dialog-close {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 10px 14px;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.privacy-dialog-body {
  display: grid;
  gap: 12px;
  padding: 8px 24px 24px;
  color: var(--text);
}

.privacy-dialog-body h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
}

.privacy-dialog-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.dev-email-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.dev-email {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 14px;
}

.dev-email p {
  margin-bottom: 8px;
}

.dev-email pre {
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  color: var(--primary);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .auth-stage {
    display: grid;
    place-items: center;
    justify-content: stretch;
    padding:
      clamp(18px, 3vh, 26px)
      22px
      0;
  }

  .auth-panel {
    width: min(680px, 100%);
    margin-left: 0;
  }

  .auth-panel--first-access {
    width: min(680px, 100%);
    padding: 22px 20px 20px;
  }

  .auth-choice-grid {
    grid-template-columns: 1fr;
  }

  .auth-form button {
    justify-self: stretch;
    min-width: 0;
  }

  .auth-form--first-access {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .auth-form--first-access label:nth-child(1),
  .auth-form--first-access label:nth-child(2),
  .auth-form--first-access label:nth-child(3) {
    grid-column: auto;
  }

  .auth-form--first-access button {
    grid-column: auto;
  }
}
