/**
 * Auth pages — split hero + glass card (login, signup)
 */

.na-auth-page {
  --auth-hero-bg: linear-gradient(145deg, #0f766e 0%, #0d9488 42%, #115e59 100%);
  --auth-glass: #ffffff;
  --auth-glass-border: rgba(15, 23, 42, 0.08);
  --auth-glass-edge: rgba(15, 23, 42, 0.1);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  font-family: var(--na-font);
  color: var(--na-ink);
  background: #f0fdfa;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.na-auth-page::before,
.na-auth-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.na-auth-page::before {
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  top: -18%;
  right: -12%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.14) 0%, transparent 68%);
}

.na-auth-page::after {
  width: min(380px, 70vw);
  height: min(380px, 70vw);
  bottom: -10%;
  left: -8%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.1) 0%, transparent 70%);
}

/* ─── Shell: hero + form ─── */
.na-auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.na-auth-hero {
  position: relative;
  padding:
    max(20px, env(safe-area-inset-top, 0px))
    max(20px, env(safe-area-inset-right, 0px))
    28px
    max(20px, env(safe-area-inset-left, 0px));
  background: var(--auth-hero-bg);
  color: #fff;
  overflow: hidden;
}

.na-auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(0, 0, 0, 0.12), transparent 45%);
  pointer-events: none;
}

.na-auth-hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -40px;
  bottom: -60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.na-auth-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.na-auth-brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  margin-bottom: 22px;
  text-decoration: none;
}

.na-auth-brand-logo {
  display: block;
  height: 38px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
}

.na-auth-brand:hover {
  color: #ecfdf5;
}

.na-auth-hero-title {
  margin: 0 0 10px;
  font-family: var(--na-serif, "Cormorant Garamond", Georgia, serif);
  font-size: clamp(1.75rem, 5.5vw, 2.35rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.na-auth-hero-lead {
  margin: 0 0 22px;
  font-size: clamp(14px, 3.5vw, 15px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  max-width: 34ch;
}

.na-auth-trust {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.na-auth-trust li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.na-auth-trust li::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2l2.8 2.8 6.2-6.4' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ─── Form column ─── */
.na-auth-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding:
    0
    max(14px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
}

.na-auth-wrap {
  width: 100%;
  max-width: 440px;
  margin: -28px auto 0;
  position: relative;
  z-index: 2;
}

.na-auth-card {
  background: var(--auth-glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 22px;
  border: 1px solid var(--auth-glass-border);
  border-bottom-color: var(--auth-glass-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 40px rgba(15, 23, 42, 0.08);
  padding: clamp(22px, 4.5vw, 30px);
  min-width: 0;
}

.na-auth-card-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.na-auth-card h1 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 4.2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--na-ink);
}

.na-auth-lead {
  margin: 0;
  font-size: clamp(13px, 3.4vw, 14px);
  line-height: 1.55;
  color: var(--na-muted);
}

.na-auth-field {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.na-auth-input {
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  color: var(--na-ink);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.na-auth-input:focus {
  outline: none;
  border-color: rgba(13, 148, 136, 0.45);
  background: #fff;
  box-shadow: var(--na-focus-ring), inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.na-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
  padding: 14px 18px;
  min-height: 50px;
  border: 0;
  border-radius: var(--na-radius-pill);
  background: var(--na-gradient-brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.28);
  transition: filter 0.18s, transform 0.18s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.na-auth-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 22px rgba(13, 148, 136, 0.32);
}

.na-auth-btn:active {
  transform: translateY(1px);
}

.na-auth-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.na-auth-msg {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.na-auth-msg--err {
  background: rgba(254, 242, 242, 0.95);
  color: #991b1b;
  border: 1px solid rgba(225, 29, 72, 0.12);
}

.na-auth-msg--ok {
  background: rgba(236, 253, 245, 0.95);
  color: #065f46;
  border: 1px solid rgba(13, 148, 136, 0.15);
}

.na-auth-link {
  color: var(--na-teal-dark);
  font-weight: 600;
  text-decoration: none;
}

.na-auth-link:hover {
  color: var(--na-teal);
  text-decoration: underline;
}

.na-auth-hint {
  font-size: 12px;
  color: var(--na-muted);
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.na-auth-hint code {
  font-size: 11px;
  word-break: break-all;
}

.na-auth-signin-hint {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--na-muted);
  line-height: 1.5;
}

.na-auth-signin-hint a {
  color: var(--na-teal-dark);
  font-weight: 700;
  text-decoration: none;
}

.na-auth-signin-hint a:hover {
  color: var(--na-teal);
  text-decoration: underline;
}

.na-auth-divider {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  margin: 24px 0 16px;
  color: var(--na-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.na-auth-divider::before,
.na-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.1), transparent);
}

.na-auth-oauth {
  display: grid;
  gap: 10px;
}

.na-auth-oauth a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  text-decoration: none;
  font-size: clamp(13px, 3.5vw, 14px);
  font-weight: 600;
  color: var(--na-ink);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  text-align: center;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}

.na-auth-oauth-label {
  min-width: 0;
}

.na-auth-oauth a:hover {
  background: #fff;
  border-color: rgba(13, 148, 136, 0.22);
  transform: translateY(-1px);
}

.na-auth-oauth a.na-auth-oauth--apple {
  border-color: #111827;
  background: #0c0c0c;
  color: #fff;
  box-shadow: none;
}

.na-auth-oauth a.na-auth-oauth--apple:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.oauth-svg {
  display: block;
  flex-shrink: 0;
}

/* Footer intent switcher */
.na-auth-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.na-auth-footer-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--na-muted);
  text-align: center;
}

.na-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.na-auth-pill {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--na-radius-pill);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: clamp(13px, 3.5vw, 14px);
  font-weight: 600;
  color: var(--na-ink);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
  box-sizing: border-box;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.na-auth-pill:hover {
  background: #f0fdfa;
  border-color: rgba(13, 148, 136, 0.28);
  color: var(--na-teal-dark);
  transform: translateY(-1px);
}

.na-auth-pill--ghost {
  color: var(--na-muted);
  font-weight: 500;
}

.na-auth-pill--accent {
  border-color: rgba(13, 148, 136, 0.2);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.95), rgba(255, 255, 255, 0.9));
  color: var(--na-teal-dark);
}

.na-auth-pill--primary {
  flex: 1 1 100%;
  border: 0;
  background: var(--na-gradient-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}

.na-auth-pill--primary:hover {
  filter: brightness(1.05);
  color: #fff;
  background: var(--na-gradient-brand);
}

.na-auth-pill--full {
  display: block;
  width: 100%;
}

.na-auth-footer-seller[hidden],
.na-auth-footer-buyer[hidden] {
  display: none;
}

/* Intent + action switchers */
.na-auth-intent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: var(--na-radius-pill);
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.na-auth-intent-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--na-radius-pill);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--na-muted);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.na-auth-intent-btn:hover {
  color: var(--na-teal-dark);
}

.na-auth-intent-btn.is-active {
  background: #fff;
  color: var(--na-teal-dark);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.na-auth-action {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.na-auth-action-tab {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--na-muted);
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.na-auth-action-tab:hover {
  color: var(--na-teal-dark);
  background: rgba(240, 253, 250, 0.7);
}

.na-auth-action-tab.is-active {
  color: var(--na-teal-dark);
  background: #f0fdfa;
  border-color: rgba(13, 148, 136, 0.2);
  font-weight: 700;
}

/* Seller type selection (signup-seller) */
.na-auth-seg {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.na-auth-seg label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.75);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.na-auth-seg input {
  accent-color: var(--na-teal);
  margin-top: 3px;
  flex-shrink: 0;
}

.na-auth-seg label:has(input:checked) {
  border-color: rgba(13, 148, 136, 0.35);
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.12);
}

.na-auth-seg strong {
  display: block;
  color: var(--na-ink);
  margin-bottom: 2px;
  font-weight: 700;
}

.na-auth-seg span span,
.na-auth-seg .na-auth-seg-desc {
  display: block;
  color: var(--na-muted);
  font-size: 13px;
  font-weight: 400;
}

/* Compact seller-type pills — shorter vertical stack */
.na-auth-seg--pills {
  gap: 8px;
  margin-bottom: 14px;
}

.na-auth-seg-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--na-muted);
}

.na-auth-seg-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.na-auth-seg--pills label {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 64px;
  padding: 10px 8px;
  text-align: center;
  border-radius: 12px;
}

.na-auth-seg--pills input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.na-auth-seg--pills strong {
  margin: 0;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.na-auth-seg--pills .na-auth-seg-desc {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.na-auth-seg--pills label:has(input:checked) {
  border-color: rgba(13, 148, 136, 0.45);
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
  box-shadow:
    inset 0 0 0 1px rgba(13, 148, 136, 0.12),
    0 6px 16px rgba(13, 148, 136, 0.1);
}

.na-auth-seg--pills label:has(input:checked) strong {
  color: var(--na-teal-dark);
}

.na-auth-form--seller .na-auth-fields {
  display: grid;
  gap: 10px;
}

.na-auth-form--seller .na-auth-field-block {
  min-width: 0;
}

.na-auth-form--seller .na-auth-field {
  margin: 0 0 5px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.na-auth-form--seller .na-auth-input {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
}

.na-auth-form--seller .na-auth-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.na-auth-form--seller .na-auth-btn {
  margin-top: 14px;
}

.na-auth-page--signup.na-auth-intent--seller .na-auth-card-head {
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.na-auth-page--signup.na-auth-intent--seller .na-auth-divider {
  margin: 18px 0 12px;
}

@media (min-width: 420px) {
  .na-auth-form--seller .na-auth-field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.na-auth-card-head h1 {
  margin-top: 0;
}

.na-auth-switch {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--na-muted);
  line-height: 1.5;
}

.na-auth-switch button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--na-teal-dark);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Desktop split layout ─── */
@media (min-width: 900px) {
  .na-auth-shell {
    grid-template-columns: minmax(340px, 42%) 1fr;
  }

  .na-auth-hero {
    display: flex;
    align-items: center;
    padding: 48px clamp(32px, 5vw, 56px);
    min-height: 100vh;
    min-height: 100dvh;
  }

  .na-auth-hero-inner {
    max-width: 380px;
  }

  .na-auth-main {
    align-items: center;
    padding: 40px clamp(24px, 4vw, 48px);
  }

  .na-auth-wrap {
    margin: 0 auto;
    max-width: 460px;
  }

  .na-auth-oauth {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .na-auth-oauth a {
    flex-direction: column;
    gap: 6px;
    padding: 14px 8px;
    font-size: 12px;
  }

  .na-auth-oauth-extra {
    display: none;
  }

  .na-auth-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .na-auth-footer-buyer .na-auth-pill,
  .na-auth-footer-seller .na-auth-pill {
    flex: 1 1 calc(50% - 5px);
    width: auto;
  }
}

@media (min-width: 420px) and (max-width: 899px) {
  .na-auth-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .na-auth-footer-buyer .na-auth-pill,
  .na-auth-footer-seller .na-auth-pill {
    flex: 1 1 calc(50% - 5px);
    width: auto;
  }
}

@media (max-width: 360px) {
  .na-auth-oauth-extra {
    display: none;
  }

  .na-auth-card {
    border-radius: 18px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .na-auth-hero {
    padding-top: 12px;
    padding-bottom: 16px;
  }

  .na-auth-trust {
    display: none;
  }

  .na-auth-wrap {
    margin-top: -16px;
  }

  .na-auth-lead {
    margin-bottom: 0;
  }

  .na-auth-divider {
    margin: 16px 0 12px;
  }

  .na-auth-footer {
    margin-top: 16px;
    padding-top: 14px;
  }
}
