/* ── Auth (legacy-inspired, aligned with app light palette) ── */
.auth-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 50% -160px, rgba(0, 0, 0, 0.035), transparent 55%),
    radial-gradient(700px 380px at 10% 100%, rgba(0, 0, 0, 0.02), transparent 60%);
  pointer-events: none;
}

.auth-step {
  width: 100%;
  max-width: 420px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px 28px;
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.09);
}

.auth-step h2 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.auth-step p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 18px;
}

.auth-step strong {
  color: var(--text);
  font-weight: 500;
}

.auth-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  background-color: transparent;
  border: none;
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
  padding: 12px 0;
  outline: none;
  text-align: left;
  transition: border-color 0.18s ease;
}

.auth-input + .auth-input {
  margin-top: 12px;
}

.auth-input:focus,
.auth-input:focus-visible {
  border-bottom-color: rgba(17, 17, 17, 0.24);
}

.auth-input::placeholder {
  color: rgba(17, 17, 17, 0.38);
}

.auth-btn {
  width: 100%;
  margin-top: 18px;
  padding: 11px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.auth-btn:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.auth-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.auth-links {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-link {
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  padding: 0;
}

.auth-link:hover {
  color: var(--text-secondary);
}

.auth-link:disabled {
  color: rgba(17, 17, 17, 0.34);
  cursor: default;
}

.auth-helper {
  margin-top: 8px;
  min-height: 18px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.auth-error {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--error);
  min-height: 18px;
  line-height: 1.45;
}

.auth-firm {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}

.auth-firm-status {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.auth-step-firm {
  padding-bottom: 32px;
}

.auth-step-firm .auth-secondary-action {
  margin-top: 14px;
}

.auth-step-firm .auth-secondary-action .auth-link {
  display: inline-flex;
}

#auth-signup-verify .auth-link {
  display: inline-flex;
  margin-top: 12px;
}

.auth-step-password {
  overflow: visible;
}

.auth-password-shell {
  position: relative;
}

.auth-input + .auth-password-shell {
  margin-top: 12px;
}

.auth-password-guidance {
  position: absolute;
  right: calc(100% + 18px);
  top: 4px;
  width: 252px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 12px 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.auth-password-guidance.visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-password-guidance-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.auth-password-rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-password-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(17, 17, 17, 0.45);
  transition: color 0.16s ease;
}

.auth-rule-check {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  color: transparent;
  background: rgba(17, 17, 17, 0.03);
  transition: all 0.16s ease;
  flex: 0 0 15px;
}

.auth-password-rule.met {
  color: var(--yes);
}

.auth-password-rule.met .auth-rule-check {
  border-color: rgba(26, 122, 58, 0.45);
  background: rgba(26, 122, 58, 0.08);
  color: var(--yes);
}

.auth-password-meter {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  overflow: hidden;
}

.auth-password-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.18s ease, background-color 0.18s ease;
}

.auth-password-meter-fill.incomplete {
  background: var(--error);
}

.auth-password-meter-fill.complete {
  background: var(--yes);
}

.auth-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 12px;
}

.auth-name-row .auth-input {
  margin-top: 0;
}

.auth-email-lock {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
  transition: border-color 0.18s ease;
}

.auth-email-lock:focus-within {
  border-bottom-color: rgba(17, 17, 17, 0.24);
}

.auth-input-plain {
  background-image: none;
  background-size: 0 0;
  transition: none;
  border-bottom: none;
  margin-top: 0;
  flex: 1;
  min-width: 0;
  padding: 11px 0;
}

.auth-input-plain:focus,
.auth-input-plain:focus-visible {
  background-size: 0 0;
}

.auth-email-suffix {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(17, 17, 17, 0.58);
  white-space: nowrap;
  margin-left: 2px;
  padding: 6px 8px;
  border-left: 1px solid rgba(17, 17, 17, 0.18);
  background: rgba(17, 17, 17, 0.045);
  border-radius: 5px;
  line-height: 1.15;
}

.auth-email-helper {
  margin-top: 8px;
  min-height: 18px;
  font-size: 12px;
  color: rgba(17, 17, 17, 0.48);
}

#signup-email-preview {
  color: rgba(17, 17, 17, 0.26);
}

.auth-email-mode-action {
  margin-top: 4px;
}

.auth-email-mode-action .auth-link {
  display: inline-flex;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.auth-terms a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.auth-terms a:hover {
  color: var(--text);
}

.auth-terms-check {
  margin: 0;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.auth-back {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s ease;
}

.auth-back:hover {
  color: var(--text-secondary);
}

.auth-back ~ h2 {
  margin-top: 14px;
}

.auth-page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 60px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
  z-index: 1;
}

.auth-page-footer-copy {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.auth-page-footer-links {
  display: flex;
  gap: 20px;
}

.auth-page-footer-links a {
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-page-footer-links a:hover {
  color: var(--text-secondary);
}

@media (max-width: 920px) {
  .auth-password-guidance {
    position: static;
    width: 100%;
    margin: 10px 0 12px;
    right: auto;
    top: auto;
    transform: translateY(0);
  }

  .auth-password-guidance:not(.visible) {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-container {
    padding: 18px;
  }

  .auth-step {
    padding: 32px 24px 24px;
    border-radius: 10px;
  }

  .auth-step h2 {
    font-size: 18px;
  }

  .auth-name-row {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .auth-email-lock {
    gap: 8px;
  }

  .auth-email-suffix {
    font-size: 11.5px;
    margin-left: 6px;
    padding: 5px 7px;
  }

  .auth-page-footer {
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    text-align: center;
  }
}
