body:has(.auth) {
  overflow-y: auto;
}

.auth {
    min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: calc(var(--sp-8) + env(safe-area-inset-top, 0px)) var(--sp-4) calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
}

.auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.auth__logo-image {
  height: 42px;
  width: auto;
}

.auth__tagline {
  font-size: var(--g-text-callout);
  color: var(--g-secondary);
}

.auth__card {
  width: 100%;
  max-width: 500px;
  padding: var(--sp-8);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}

.auth__card--split {
  max-width: 960px;
  display: grid;
    grid-template-columns: minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

@media (min-width: 860px) {
  .auth__card--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.auth__title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--g-ink);
}

.auth__subtitle {
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: var(--g-text-callout);
  line-height: 1.45;
  color: var(--g-secondary);
}

.auth__visual {
  position: relative;
  display: none;
  overflow: hidden;
  background: linear-gradient(155deg, var(--navy-700) 0%, var(--navy-900) 100%);
}

.auth__visual-photo {
  position: absolute;
  inset: 0;
  background-image: url("../../img/Quarto_Registo.png");
  background-size: cover;
  background-position: center;
}

.auth__visual-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--navy-700) 0%, var(--navy-900) 100%);
  opacity: 0.72;
}

.auth__visual-icon {
  position: absolute;
  color: rgba(255, 255, 255, 0.16);
}

.auth__visual-icon .icon { width: 100%; height: 100%; stroke-width: 1.1; }

.auth__visual-icon--1 { top: 8%; left: 12%; width: 64px; height: 64px; }
.auth__visual-icon--2 { top: 14%; right: 14%; width: 78px; height: 78px; }
.auth__visual-icon--3 { top: 42%; left: 6%; width: 56px; height: 56px; }
.auth__visual-icon--4 { top: 46%; left: 42%; width: 92px; height: 92px; color: rgba(255, 255, 255, 0.22); }
.auth__visual-icon--5 { bottom: 12%; left: 16%; width: 60px; height: 60px; }
.auth__visual-icon--6 { bottom: 16%; right: 16%; width: 70px; height: 70px; }

.auth__visual-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 10%, rgba(233, 185, 73, 0.16), transparent 55%);
}

.auth__form {
  padding: var(--sp-6);
}

.auth__fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.password-strength {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.password-strength__bar {
  flex: 1;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--g-fill);
  overflow: hidden;
}

.password-strength__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: var(--r-full);
  background: var(--g-danger);
  transition: width var(--t-fast), background var(--t-fast);
}

.password-strength__fill[data-level="medium"] { background: #ff9f0a; }
.password-strength__fill[data-level="strong"] { background: #34c759; }

.password-strength__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--g-secondary);
  white-space: nowrap;
}

.password-requirements {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--g-secondary);
}

.password-requirements li .icon {
  color: var(--g-faint);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.password-requirements li.is-met {
  color: var(--g-success);
}

.password-requirements li.is-met .icon {
  color: var(--g-success);
}

.auth__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.auth__link {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--g-accent);
}

.auth__link:hover { color: var(--g-accent-deep); }

.auth__error {
  padding: var(--sp-3);
  border-radius: 12px;
  background: var(--g-danger-soft);
  color: var(--g-danger);
  font-size: var(--fs-md);
  font-weight: 600;
}

.auth__success {
  padding: var(--sp-3);
  border-radius: 12px;
  background: var(--g-success-soft);
  color: var(--g-success);
  font-size: var(--fs-md);
  font-weight: 600;
}

.auth__remember {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-1) 0 var(--sp-3);
  font-size: var(--fs-md);
  color: var(--g-secondary);
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--g-hairline);
}

.auth__divider span {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g-tertiary);
  white-space: nowrap;
}

.auth__switch {
  margin-top: var(--sp-5);
  text-align: center;
  font-size: var(--fs-md);
  color: var(--g-secondary);
}

.auth__switch a {
  font-weight: 700;
  color: var(--g-accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.auth__switch a:hover { color: var(--g-accent-deep); }

.auth__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--g-secondary);
}

.auth__footer a:hover { color: var(--g-ink); }

.lang-switcher--floating {
  position: fixed;
  top: calc(var(--sp-5) + env(safe-area-inset-top, 0px));
  right: var(--sp-5);
  z-index: 10;
}

@media (min-width: 860px) {
  .auth__visual { display: block; }
}

@media (max-width: 560px) {
  .auth__card,
  .auth__form { padding: var(--sp-6); }

    .auth__brand { margin-top: 48px; }
}

/* ============================================================
   Liquid glass: as cores, os materiais e o fundo com manchas de cor
   vêm de glass.css; aqui só o cartão e o seletor de idioma, em todos
   os tamanhos de ecrã, incluindo a app iOS/Android.
   ============================================================ */
.auth {
  position: relative;
  background: transparent;
}

.auth__brand,
.auth__card,
.auth__footer {
  position: relative;
  z-index: 1;
}

.auth__card {
  background: var(--g-surface);
  border: 1px solid var(--g-edge);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  box-shadow: 0 30px 70px -30px rgba(20, 30, 60, 0.35);
}

/* Seletor de idioma flutuante em vidro, como a barra do topo das outras páginas. */
.lang-switcher--floating {
  border: 1px solid var(--g-edge);
  background: var(--g-surface-strong);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  box-shadow: var(--g-shadow-bar);
}

.lang-switcher--floating .lang-switcher__option { color: var(--g-secondary); }
.lang-switcher--floating .lang-switcher__option:hover { color: var(--g-ink); }

.lang-switcher--floating .lang-switcher__option.is-active {
  background: var(--g-accent-soft);
  color: var(--g-accent-deep);
}

@media (max-width: 560px) {
  .auth__card {
    border-radius: var(--g-r-sheet);
    box-shadow: var(--g-shadow-float);
  }

  /* No registo o espaçamento é do formulário (.auth__form); o cartão
     dividido não soma o seu, senão os campos ficam estreitos. */
  .auth__card--split { padding: 0; }
}
