/* Auth screens — dark gallery tone */

.auth-page {
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) var(--page-pad-x);
  animation: rise 0.7s var(--ease-out) both;
}

.auth-shell {
  width: min(100%, 440px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  padding: 1.85rem 1.55rem 1.65rem;
}

.auth-shell h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.15rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.auth-shell .auth-sub {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-google-hint {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.28rem;
  margin-bottom: 1.3rem;
  background: var(--surface-hover);
  border-radius: var(--radius);
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.auth-tab.is-active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form .input {
  min-height: 2.85rem;
}

.terms {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.terms label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--ink);
  line-height: 1.4;
  cursor: pointer;
}

.terms input {
  margin-top: 0.15rem;
}

.auth-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-google:hover {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
}

.auth-msg {
  min-height: 1.35em;
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}

.auth-msg.is-error {
  color: var(--danger);
}

.auth-msg.is-ok {
  color: var(--accent-strong);
}

.auth-links {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-links a {
  color: var(--accent-strong);
  font-weight: 600;
}

.terms label a.term-doc-link {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms label a.term-doc-link:hover {
  color: var(--ink);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-user .nav-name {
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.nav-user a.nav-name:hover {
  color: var(--accent-strong);
}

.nav-user a.nav-name.is-alert {
  color: var(--accent-strong);
}

.btn-text {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  color: var(--ink);
}

@media (max-width: 767px) {
  .auth-page {
    min-height: calc(100dvh - var(--header-h) - var(--tabbar-h));
    padding-bottom: calc(1.25rem + var(--tabbar-h));
    align-content: start;
    place-items: start center;
  }

  .auth-shell {
    padding: 1.45rem 1.15rem 1.35rem;
    border-radius: var(--radius-panel);
    width: 100%;
  }

  .auth-shell h1 {
    font-size: 1.65rem;
  }

  .auth-actions .btn,
  .auth-shell .btn {
    width: 100%;
    text-align: center;
    min-height: var(--touch);
  }
}
