/* ============================================================
 * APEX SALES OS · AUTH PAGES (login / magic-sent / welcome)
 * Owner: r6-001-auth-css
 * Page-local styles only · every selector prefixed .page-auth-
 *
 * Renders three unauthenticated screens that bookend the app:
 *   - #/login              (login.js)
 *   - #/login/magic-sent   (magic-sent.js)
 *   - #/welcome            (welcome.js)
 *
 * Token-driven. Light + dark themes work via html[data-theme] swap.
 * Strength meter progression on welcome: muted-grey -> primary.
 * Never red anywhere.
 * ============================================================ */

/* ----------------------------------------------------------------
 * Frame · centered grid with twin radial primary washes
 * ---------------------------------------------------------------- */
.page-auth-frame {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(99,91,255,0.10), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(99,91,255,0.06), transparent 50%),
    var(--bg-warm);
}

/* ----------------------------------------------------------------
 * Card · 420px white surface, lg shadow, xl radius
 * ---------------------------------------------------------------- */
.page-auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-lg);
}

/* ----------------------------------------------------------------
 * Brand · gradient mark + wordmark
 * ---------------------------------------------------------------- */
.page-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.page-auth-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.page-auth-brand .name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ----------------------------------------------------------------
 * Titles
 * ---------------------------------------------------------------- */
.page-auth-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.page-auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.55;
}

/* ----------------------------------------------------------------
 * Form field · label + input
 * ---------------------------------------------------------------- */
.page-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.page-auth-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}
.page-auth-field input {
  height: 40px;
  padding: 0 12px;
  font-size: 13.5px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}
.page-auth-field input::placeholder {
  color: var(--text-faint);
}
.page-auth-field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99,91,255,0.12);
}

/* ----------------------------------------------------------------
 * Row · remember-me + forgot link
 * ---------------------------------------------------------------- */
.page-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-auth-row a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t);
}
.page-auth-row a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------------
 * Submit · full-width primary button (composes with .btn .btn-primary)
 * ---------------------------------------------------------------- */
.page-auth-submit {
  width: 100%;
  justify-content: center;
}

/* ----------------------------------------------------------------
 * Divider · "or" with horizontal lines
 * ---------------------------------------------------------------- */
.page-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-auth-divider::before,
.page-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ----------------------------------------------------------------
 * Magic-link alternative button · full width, neutral surface
 * ---------------------------------------------------------------- */
.page-auth-magic {
  width: 100%;
  justify-content: center;
}

/* ----------------------------------------------------------------
 * Footer link
 * ---------------------------------------------------------------- */
.page-auth-foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 24px;
}
.page-auth-foot a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t);
}
.page-auth-foot a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ================================================================
 * MAGIC-SENT screen
 * ================================================================ */

/* 64px primary-soft hero glyph (envelope renders inside) */
.page-auth-magic-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: var(--primary);
}
.page-auth-magic-icon svg {
  width: 28px;
  height: 28px;
}

/* Mono chip showing the recipient address */
.page-auth-magic-email {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text);
  word-break: break-all;
}

/* Numbered "what happens next" list */
.page-auth-magic-steps {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.page-auth-magic-steps .step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.page-auth-magic-steps .num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

/* ================================================================
 * WELCOME wizard (step 1 of 4 — set password)
 * ================================================================ */

/* Wider card to host the 4-bar meter + checklist */
.page-auth-welcome-card {
  width: 520px;
  padding: 36px 36px 30px;
}

/* Hero greeting with gradient-clipped first name */
.page-auth-welcome-hero {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--text);
}
.page-auth-welcome-hero .name {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.page-auth-welcome-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.55;
}

/* 4-bar progress meter · inactive = bg-tint, active = primary gradient */
.page-auth-welcome-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 8px 0 14px;
}
.page-auth-welcome-meter .bar {
  height: 4px;
  background: var(--bg-tint);
  border-radius: 99px;
  transition: background var(--t);
}
.page-auth-welcome-meter .bar.on {
  background: var(--grad);
}
.page-auth-welcome-meter-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Preview checklist of remaining onboarding steps */
.page-auth-welcome-checklist {
  margin: 18px 0 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.page-auth-welcome-checklist .row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-auth-welcome-checklist .row .ico {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.page-auth-welcome-checklist .row.on .ico {
  color: var(--primary);
}
.page-auth-welcome-checklist .row.on {
  color: var(--text);
}
