/* Registration / login / merchant invite — auth.html */

.site-main--auth {
  padding-bottom: 64px;
}

.auth-layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 460px);
  gap: clamp(28px, 4.5vw, 56px);
  align-items: start;
}

.auth-aside {
  position: relative;
  padding-top: 8px;
}

.auth-aside::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -60px;
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 109, 100, 0.07), transparent 70%);
  filter: blur(36px);
  pointer-events: none;
  z-index: -1;
}

.auth-promo {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 28px);
}

.auth-promo-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-promo-head .eyebrow {
  margin: 0;
}

.auth-promo-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.auth-promo-subtitle {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0.9;
}

.auth-promo-ledes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-promo-ledes .lede {
  margin: 0;
  max-width: 46ch;
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--muted);
}

.auth-promo-trial {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(216, 240, 234, 0.42));
  border: 1px solid rgba(15, 109, 100, 0.14);
}

.auth-promo-trial-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: rgba(15, 109, 100, 0.1);
  border: 1px solid rgba(15, 109, 100, 0.18);
}

.auth-promo-trial-copy {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--muted);
}

.auth-promo-trial-copy strong {
  color: var(--ink);
  font-weight: 700;
}

.auth-promo-features {
  margin: 0;
}

.auth-promo-features .hero-feature {
  flex: 1 1 calc(50% - 12px);
}

.auth-promo-tip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(216, 240, 234, 0.72), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(15, 109, 100, 0.16);
  box-shadow: var(--shadow-soft);
}

.auth-promo-tip-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(15, 109, 100, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-promo-tip p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

.auth-promo-llm {
  margin-top: 0;
  padding-top: 4px;
}

.auth-promo-llm .llm-provider-chip {
  min-height: 46px;
  padding: 8px 14px;
}

.auth-promo-llm .llm-provider-logo {
  height: 28px;
}

.auth-card {
  position: relative;
}

.auth-global-banner:not(.hidden) {
  margin-bottom: 14px;
}

.auth-screen.hidden {
  display: none !important;
}

.auth-screen:not(.hidden) {
  animation: authFade 0.28s ease;
}

.auth-screen-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-screen-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.auth-screen-lede {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--muted);
}

.auth-screen-primary {
  width: 100%;
}

.auth-screen-actions {
  flex-direction: column;
  align-items: stretch;
}

.auth-screen-actions .auth-text-btn {
  align-self: flex-start;
  margin-top: 4px;
}

.auth-field-label-muted {
  display: block;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-resend-email-block .auth-email-wrap {
  margin-bottom: 14px;
}

.auth-email-wrap {
  display: grid;
  gap: 8px;
}

.auth-resend-status-line {
  margin-top: 4px;
}

.auth-screen-foot {
  margin: 18px 0 0;
  padding-top: 4px;
}

/* 覆盖 common.css 中 `.field input { width:100% }`，否则复选框占满一行、文字被挤到下一行 */
.field.auth-remember-row,
.field.auth-register-terms-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.field.auth-remember-row {
  align-items: center;
}

.field.auth-remember-row input[type="checkbox"],
.field.auth-register-terms-row input[type="checkbox"] {
  width: 1.08rem;
  height: 1.08rem;
  min-width: 1.08rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 0.12em;
}

.field.auth-remember-row input[type="checkbox"] {
  align-self: center;
  margin-top: 0;
}

.field.auth-remember-row input[type="checkbox"]:focus,
.field.auth-register-terms-row input[type="checkbox"]:focus {
  outline: 2px solid rgba(15, 109, 100, 0.4);
  outline-offset: 2px;
  box-shadow: none;
}

.auth-checkbox-input {
  flex-shrink: 0;
}

.auth-remember-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-register-terms-row .auth-register-terms-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.5;
}

#auth-register-fields.hidden {
  display: none !important;
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.auth-tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(56, 36, 20, 0.08);
}

.auth-tab--invite[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(15, 109, 100, 0.14), rgba(223, 125, 72, 0.1));
  color: var(--accent-strong);
}

.auth-panel {
  display: none;
}

.auth-panel--active {
  display: block;
  animation: authFade 0.25s ease;
}

@keyframes authFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-panel .form-grid {
  gap: 14px;
}

.auth-invite-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(15, 109, 100, 0.2);
  margin-bottom: 14px;
}

.auth-invite-lede {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.auth-footer-note {
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

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

.auth-forgot-line {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 4px;
}

.auth-flow-panel {
  margin-bottom: 20px;
  padding: 14px 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  animation: authFade 0.28s ease;
}

.auth-flow-panel.hidden {
  display: none !important;
}

.auth-flow-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
}

.auth-flow-lede {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}

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

.auth-flow-status {
  margin-top: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

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

.auth-text-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-text-btn:hover {
  opacity: 0.92;
}

.auth-status {
  margin-top: 16px;
}

.field-hint code {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
  background: rgba(15, 109, 100, 0.08);
  color: var(--accent-strong);
}

.auth-email-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-email-header label,
.auth-email-header .auth-field-label-muted {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-email-wrap .auth-email-panel {
  margin-top: 0;
}

.auth-email-inline {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(24, 22, 27, 0.12);
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.auth-email-inline:focus-within {
  border-color: rgba(15, 109, 100, 0.32);
  box-shadow: 0 0 0 4px rgba(216, 240, 234, 0.72);
}

.auth-email-inline input {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  border: none !important;
  border-radius: 0 !important;
  padding: 14px 16px !important;
  font-size: inherit;
  background: transparent !important;
  box-shadow: none !important;
}

.auth-email-inline input:focus {
  outline: none;
  box-shadow: none !important;
}

.auth-email-panel--full input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(24, 22, 27, 0.12);
  background: rgba(255, 255, 255, 0.7);
  font-size: inherit;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.auth-email-panel--full input:focus {
  outline: none;
  border-color: rgba(15, 109, 100, 0.32);
  box-shadow: 0 0 0 4px rgba(216, 240, 234, 0.72);
}

.auth-email-suffix {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 16px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  border-left: 1px solid rgba(24, 22, 27, 0.1);
  background: rgba(255, 255, 255, 0.45);
  user-select: none;
}

.auth-email-switch {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.auth-email-switch:hover {
  opacity: 0.9;
}

.auth-register-hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
}

.auth-register-hint strong {
  color: var(--ink);
  font-weight: 700;
}

.register-verify-followup:not(.hidden) {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  animation: authFade 0.35s ease;
}

.auth-verify-alt-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.auth-verify-alt-lede {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.auth-register-success-lead {
  display: inline;
  font-weight: 700;
  color: var(--accent-strong);
}

.auth-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-submit-btn .auth-submit-spinner {
  display: none;
  width: 1.05em;
  height: 1.05em;
  box-sizing: border-box;
  border: 2px solid rgba(255, 247, 241, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  vertical-align: middle;
  animation: authSubmitSpin 0.7s linear infinite;
}

.button-secondary.auth-submit-btn .auth-submit-spinner {
  border-color: rgba(24, 22, 27, 0.18);
  border-top-color: var(--accent-strong);
}

.auth-submit-btn--busy {
  pointer-events: none;
  opacity: 0.92;
}

.auth-submit-btn--busy .auth-submit-spinner {
  display: inline-block;
}

@keyframes authSubmitSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-email-verify {
  scroll-margin-top: 88px;
}

.auth-verify-title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}

.auth-verify-lede {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    padding-top: 0;
    padding-bottom: 8px;
  }

  .auth-promo-features .hero-feature {
    flex: 1 1 100%;
  }

  .auth-promo-llm .llm-provider-logos {
    gap: 10px;
  }
}
