/* ============================================================
   THREDLY — Auth styles (shared)
   Drives Login / Register / Forgot / Reset / 2FA. The split card
   is: a dark brand "scene" on the left, the form on the right —
   the same shape as Accept Invitation, dark-theme aware.
   ============================================================ */
function AuStyles() {
  return (
    <style>{`
    .au-shell { min-height: 100vh; display: block; padding: 0; background:
      radial-gradient(1100px 520px at 12% -10%, #f0ebf2 0%, rgba(240,235,242,0) 60%),
      radial-gradient(900px 480px at 100% 110%, #eef0ea 0%, rgba(238,240,234,0) 55%), var(--surface); }
    html[data-theme="dark"] .au-shell { background:
      radial-gradient(1100px 520px at 12% -10%, #221b29 0%, rgba(34,27,41,0) 60%),
      radial-gradient(900px 480px at 100% 110%, #1a2119 0%, rgba(26,33,25,0) 55%), var(--surface); }

    .au-card { width: 100%; max-width: none; display: grid; grid-template-columns: 1.05fr 1fr;
      background: var(--paper); border: none; border-radius: 0;
      box-shadow: none; overflow: hidden; min-height: 100vh; }
    .au-card.narrow { max-width: none; }
    @media (max-width: 820px){ .au-card { grid-template-columns: 1fr; min-height: 100vh; } }

    /* ---------------- left brand scene ---------------- */
    .au-side { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 56px 60px;
      color: #efeaf1; background: linear-gradient(165deg, var(--hero-from), var(--hero-to)); overflow: hidden; }
    .au-side > * { max-width: 520px; }
    @media (max-width: 1120px){ .au-side { padding: 44px 44px; }
      .au-brand { top: 44px; left: 44px; } .au-side-foot { left: 44px; right: 44px; bottom: 44px; } }
    @media (max-width: 820px){ .au-side { display: none; } }
    .au-side::before { content: ''; position: absolute; top: -140px; right: -90px; width: 360px; height: 360px;
      background: radial-gradient(circle, var(--hero-glow), transparent 68%); opacity: .65; pointer-events: none; }
    .au-side::after { content: ''; position: absolute; bottom: -160px; left: -120px; width: 340px; height: 340px;
      background: radial-gradient(circle, rgba(110,140,102,.4), transparent 70%); opacity: .5; pointer-events: none; }
    .au-brand { position: absolute; top: 56px; left: 60px; z-index: 2; width: auto; max-width: none; display: flex; align-items: center; gap: 9px; color: #fff; }
    .au-side-copy { position: relative; margin-top: 10px; }
    .au-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #c2aecb; }
    .au-side-title { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.025em;
      line-height: 1.08; margin: 13px 0 0; color: #fff; max-width: 15ch; }
    .au-side-sub { font-size: 14px; line-height: 1.55; color: #c7bbcd; margin: 13px 0 0; max-width: 32ch; }
    .au-side-foot { position: absolute; left: 60px; right: 60px; bottom: 56px; width: auto; max-width: none; font-size: 12px; color: #8f8395; font-style: italic; }

    /* "what happens next" steps preview */
    .au-steps { position: relative; list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
    .au-step { display: flex; align-items: flex-start; gap: 14px; padding: 11px 0; position: relative; }
    .au-step:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 38px; bottom: -7px; width: 1.5px;
      background: linear-gradient(rgba(205,188,214,.4), rgba(205,188,214,.08)); }
    .au-step-num { width: 31px; height: 31px; border-radius: 99px; flex: none; display: grid; place-items: center;
      font-size: 13px; font-weight: 800; color: #efe7f1; background: rgba(205,188,214,.16);
      border: 1px solid rgba(205,188,214,.28); position: relative; z-index: 1; }
    .au-step-text { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
    .au-step-lbl { font-size: 14.5px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
    .au-step-sub { font-size: 12.5px; color: #b7abbd; line-height: 1.45; }

    /* floating product cards */
    .au-scene { position: relative; margin: 0 0 8px; height: clamp(200px, 33vh, 300px); max-width: 340px; width: clamp(250px, 50%, 340px); align-self: center; }
    .au-fcard { position: absolute; border-radius: 14px; background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(6px); box-shadow: 0 12px 30px rgba(0,0,0,.28);
      animation: aufloat 7s ease-in-out infinite; }
    @keyframes aufloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
    @media (prefers-reduced-motion: reduce){ .au-fcard { animation: none; } }
    .au-fcard.c1 { top: 0; left: 0; width: 230px; padding: 0; overflow: hidden; animation-delay: 0s; }
    .au-fcard.c2 { top: 40%; right: -4%; width: 196px; padding: 13px 15px; animation-delay: 1.4s; }
    .au-fcard.c3 { bottom: 0; left: 8%; width: 176px; padding: 11px 14px; animation-delay: .7s; }

    .au-fc-head { background: linear-gradient(150deg, var(--plum), var(--plum-deep)); padding: 14px 15px 16px; }
    .au-fc-code { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.7); }
    .au-fc-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: #fff; margin-top: 4px; }
    .au-fc-body { padding: 12px 15px 14px; }
    .au-fc-line { height: 7px; border-radius: 99px; background: rgba(255,255,255,.13); }
    .au-fc-line.s { width: 62%; margin-top: 7px; }
    .au-fc-week { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 11px; white-space: nowrap;
      font-weight: 700; color: #d9c8e1; background: rgba(205,188,214,.16); border-radius: 99px; padding: 4px 10px; }

    .au-fc-row { display: flex; align-items: center; gap: 9px; }
    .au-fc-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
    .au-fc-ico.sage { background: rgba(150,180,140,.22); color: #bcd3ad; }
    .au-fc-ico.amber { background: rgba(210,185,120,.2); color: #e0c388; }
    .au-fc-lbl { font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap; }
    .au-fc-meta { font-size: 11px; color: #b7abbd; margin-top: 1px; }
    .au-fc-avatars { display: flex; }
    .au-fc-avatars span { width: 26px; height: 26px; border-radius: 99px; border: 2px solid rgba(34,29,40,.5);
      margin-left: -8px; background: linear-gradient(135deg,#9b86a4,#6c5a76); }
    .au-fc-avatars span:first-child { margin-left: 0; }

    /* ---------------- right form ---------------- */
    .au-main { padding: 48px; display: flex; flex-direction: column; align-items: center; }
    @media (max-width: 540px){ .au-main { padding: 36px 22px; } }
    .au-main-inner { width: 100%; max-width: 416px; margin: auto 0; display: flex; flex-direction: column; }
    .au-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
    .au-top-brand { display: none; align-items: center; gap: 8px; }
    @media (max-width: 820px){ .au-top-brand { display: flex; } }
    .au-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
      color: var(--muted); text-decoration: none; padding: 5px 4px; border-radius: 7px; }
    .au-back:hover { color: var(--ink); }

    .au-head { margin-bottom: 24px; }
    .au-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--plum); }
    .au-title { font-family: var(--display); font-size: 27px; font-weight: 800; letter-spacing: -.02em;
      color: var(--ink); margin: 9px 0 0; }
    .au-sub { font-size: 14.5px; color: var(--muted); line-height: 1.55; margin: 9px 0 0; }
    .au-sub a, .au-fine a, .au-altrow a { color: var(--plum); font-weight: 600; text-decoration: none; }
    .au-sub a:hover, .au-fine a:hover, .au-altrow a:hover { text-decoration: underline; }

    .au-form { display: flex; flex-direction: column; }
    .au-field { margin-bottom: 16px; }
    .au-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .au-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; white-space: nowrap;
      font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
    .au-label .au-link-sm { font-size: 12.5px; font-weight: 600; color: var(--plum); text-decoration: none; }
    .au-label .au-link-sm:hover { text-decoration: underline; }
    .au-input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
      padding: 12px 14px; font-size: 15px; font-family: inherit; color: var(--text);
      transition: border-color .15s, box-shadow .15s, background .15s; }
    .au-input::placeholder { color: var(--faint); }
    .au-input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); background: var(--paper); }
    .au-input.has-ico { padding-left: 42px; }
    .au-inwrap { position: relative; }
    .au-inwrap > .au-in-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
    .au-pw .au-input { padding-right: 46px; }
    .au-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px;
      border: none; background: none; color: var(--faint); display: grid; place-items: center; border-radius: var(--r-sm); }
    .au-eye:hover { color: var(--text); background: var(--surface-2); }
    .au-readonly { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border);
      border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; color: var(--muted); font-weight: 500; }
    .au-readonly svg { color: var(--faint); flex: none; }
    .au-readonly .au-edit { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--plum); text-decoration: none; }

    /* strength */
    .au-strength { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
    .au-strength-bars { display: flex; gap: 4px; flex: 1; }
    .au-bar { height: 4px; flex: 1; border-radius: 99px; background: var(--border-2); transition: background .2s; }
    .au-bar.on.s1 { background: #c9534e; } .au-bar.on.s2 { background: var(--amber); }
    .au-bar.on.s3 { background: #8a9a52; } .au-bar.on.s4 { background: var(--sage); }
    .au-strength-lbl { font-size: 12px; font-weight: 700; color: var(--faint); flex: none; }
    .au-strength-lbl.s1 { color: #c9534e; } .au-strength-lbl.s2 { color: var(--amber-text); }
    .au-strength-lbl.s3 { color: #5d7042; } .au-strength-lbl.s4 { color: var(--sage-text); }
    html[data-theme="dark"] .au-strength-lbl.s3 { color: #9fbb8f; }
    .au-mismatch { font-size: 12.5px; color: #b5403c; font-weight: 600; margin-top: 8px; }
    html[data-theme="dark"] .au-mismatch { color: #e08a86; }

    /* checkbox + meta row */
    .au-metarow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 6px; }
    .au-check { display: inline-flex; align-items: center; gap: 9px; background: none; border: none; font-family: inherit;
      padding: 4px 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; text-align: left; }
    .au-check.block { align-items: flex-start; width: 100%; }
    .au-check-box { width: 19px; height: 19px; border-radius: 6px; border: 2px solid var(--border-2); display: grid; place-items: center;
      flex: none; color: #fff; transition: background .14s, border-color .14s; }
    .au-check.block .au-check-box { margin-top: 1px; }
    .au-check.on .au-check-box { background: var(--plum); border-color: var(--plum); }
    .au-check a { color: var(--plum); font-weight: 600; text-decoration: none; }
    .au-check a:hover { text-decoration: underline; }

    /* primary button */
    .au-submit { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px;
      white-space: nowrap; background: var(--plum); color: #fff; border: none; border-radius: var(--r-md); padding: 14px 18px;
      font-size: 15px; font-weight: 700; font-family: inherit; transition: background .15s, transform .05s; text-decoration: none; }
    .au-submit:hover { background: var(--plum-deep); }
    .au-submit:active { transform: translateY(1px); }
    .au-submit:disabled { background: var(--border-2); color: var(--faint); cursor: not-allowed; }
    .au-submit .au-spin { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
      border-radius: 99px; animation: auspin .7s linear infinite; }
    @keyframes auspin { to { transform: rotate(360deg); } }

    .au-secondary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px;
      white-space: nowrap; background: var(--paper); color: var(--ink); border: 1px solid var(--border-2); border-radius: var(--r-md);
      padding: 13px 18px; font-size: 14.5px; font-weight: 700; font-family: inherit; transition: background .15s; text-decoration: none; }
    .au-secondary:hover { background: var(--surface-2); }

    .au-formerr { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #9e2a2b; font-weight: 600;
      background: #fbecec; border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px; }
    html[data-theme="dark"] .au-formerr { background: #3a1f20; color: #e7a3a0; }
    .au-formerr svg { flex: none; }

    .au-fine { text-align: center; font-size: 13.5px; color: var(--muted); margin: 18px 0 0; }
    .au-altrow { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 22px;
      padding-top: 20px; border-top: 1px solid var(--border); }

    /* divider */
    .au-or { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--faint); font-size: 12px; font-weight: 600; }
    .au-or::before, .au-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

    /* ---------- 2FA code boxes ---------- */
    .au-code { display: flex; gap: 10px; justify-content: space-between; margin: 6px 0 4px; }
    .au-code input { width: 100%; aspect-ratio: 1 / 1.12; min-width: 0; text-align: center; font-family: var(--display);
      font-size: 26px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1.5px solid var(--border);
      border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s, background .15s; }
    .au-code input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px var(--plum-soft); background: var(--paper); }
    .au-code input.filled { border-color: var(--border-2); }
    .au-code.err input { border-color: #d08a86; }
    .au-code-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--muted); }
    .au-resend { background: none; border: none; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--plum); padding: 0; }
    .au-resend:hover:not(:disabled) { text-decoration: underline; }
    .au-resend:disabled { color: var(--faint); }
    .au-method { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 99px;
      background: var(--plum-soft); color: var(--plum-deep); font-size: 12.5px; font-weight: 700; }
    html[data-theme="dark"] .au-method { color: #d9c8e1; }

    /* ---------- success / sent states ---------- */
    .au-center { display: flex; flex-direction: column; align-items: flex-start; margin: auto 0; }
    .au-ring { width: 64px; height: 64px; border-radius: 99px; display: grid; place-items: center; }
    .au-ring.sage { background: var(--sage-bg); color: var(--sage-text); }
    .au-ring.plum { background: var(--plum-soft); color: var(--plum-deep); }
    html[data-theme="dark"] .au-ring.plum { color: #d9c8e1; }
    .au-sent-mail { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
      padding: 12px 14px; font-size: 14px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 9px;
      margin: 18px 0 6px; }
    .au-sent-mail svg { color: var(--plum); flex: none; }
    .au-tip { display: flex; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 14px;
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px 14px; }
    .au-tip svg { color: var(--faint); flex: none; margin-top: 1px; }
    `}</style>
  );
}

Object.assign(window, { AuStyles });
