/* QuotesNova Phase 329 (Phase 343: real logo, back button, terms under the buttons, tighter spacing, clear sign-up and forgot-password links) — sign in / sign up / forgot / reset as a full-screen welcome page (ChatGPT-app style):
   big logo mark, big title, short line, then legal text and pill buttons pinned to the bottom. Scoped to body.qn-auth.
   Colours come from the site's own variables, so dark mode works. Same ids and form as before; auth.js is untouched. */
body.qn-auth .qs-top, body.qn-auth footer.ft, body.qn-auth .qs-mobile, body.qn-auth .bn { display: none !important; }
body.qn-auth { background: var(--bg); }
body.qn-auth main { min-height: 100dvh; display: flex; justify-content: center; padding: 0; box-sizing: border-box; }
body.qn-auth .qn-card { width: 100%; max-width: 30rem; min-height: 100dvh; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; display: flex; flex-direction: column; box-sizing: border-box; }
body.qn-auth .qn-body { flex: 1; display: flex; flex-direction: column; padding: 20px 24px 8px; }

/* top: back button, real logo, title, line. Free space is split above and below the group, so the page is never stretched. */
body.qn-auth .qn-back { align-self: flex-start; display: grid; place-items: center; width: 44px; height: 44px; margin: 0 0 0 -8px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); text-decoration: none; flex: none; }
body.qn-auth .qn-back:hover { border-color: var(--ink); }
body.qn-auth .qn-brand { display: flex; justify-content: center; margin: auto 0 22px; text-decoration: none; }
body.qn-auth .qn-logo { width: 76px; height: 76px; border-radius: 19px; display: block; box-shadow: 0 6px 18px rgba(25, 20, 12, .16); }
/* same heading weight and tracking as the rest of the site (600, tight), inherits the site font */
body.qn-auth .qn-card h1 { text-align: center; font-family: inherit; letter-spacing: -.03em; font-size: clamp(1.8rem, 7.6vw, 2.3rem); line-height: 1.15; font-weight: 600; margin: 0 0 12px; color: var(--ink); text-wrap: balance; }
body.qn-auth .qn-sub { text-align: center; color: var(--mut); font-size: 1.02rem; line-height: 1.5; margin: 0 4px; }
body.qn-auth #auth-message { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; font-size: .92rem; }

/* terms line sits under the buttons; it is the last item, so the space left over goes below it */
body.qn-auth .qn-body > :last-child { margin-bottom: auto; }
body.qn-auth .qn-legal { margin: 18px 6px 0; text-align: center; color: var(--mut); font-size: .88rem; line-height: 1.55; }
body.qn-auth .qn-legal a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
body.qn-auth .qn-legal a:hover { color: var(--acc); }

/* Google = the big black pill */
body.qn-auth #google-block { margin: 28px 0 0; }
body.qn-auth #google-fallback { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 1.1rem; font-weight: 600; cursor: pointer; }
body.qn-auth #google-fallback:hover { opacity: .92; }
body.qn-auth #google-fallback svg { width: 22px; height: 22px; flex: none; }
body.qn-auth #google-btn[hidden], body.qn-auth #google-fallback[hidden], body.qn-auth #auth-message[hidden], body.qn-auth #google-block[hidden] { display: none !important; }
body.qn-auth #google-btn:empty { display: none; }
body.qn-auth .qn-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--mut); font-size: .85rem; }
body.qn-auth .qn-or::before, body.qn-auth .qn-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* form: pill inputs, pill button */
body.qn-auth #auth-form { margin: 0; }
body.qn-auth #google-block[hidden] + #auth-form[data-kind=login], body.qn-auth #google-block[hidden] + #auth-form[data-kind=signup] { margin-top: 28px; }
body.qn-auth #auth-form[data-kind=forgot], body.qn-auth #auth-form[data-kind=reset] { margin-top: 28px; }
body.qn-auth .field { margin: 0 0 12px; }
body.qn-auth .field label, body.qn-auth .qn-labelrow label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); margin: 0 0 6px 18px; }
body.qn-auth .qn-labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
body.qn-auth .qn-labelrow a { font-size: .85rem; color: var(--ink); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; margin-right: 18px; }
body.qn-auth .field input[type=text], body.qn-auth .field input[type=email], body.qn-auth .field input[type=password] { width: 100%; box-sizing: border-box; height: 54px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 1rem; outline: none; }
body.qn-auth .field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accs); }
body.qn-auth .field input[aria-invalid=true] { border-color: #b3261e; }
body.qn-auth .field .err { display: block; min-height: 0; margin: 6px 0 0 18px; font-size: .84rem; color: #b3261e; }
body.qn-auth .field .err:empty { display: none; }
body.qn-auth .qn-pw { position: relative; }
body.qn-auth .qn-pw input { padding-right: 70px; }
body.qn-auth .qn-eye { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); height: 34px; padding: 0 12px; border: 0; background: none; color: var(--mut); font-size: .85rem; font-weight: 600; cursor: pointer; border-radius: 999px; }
body.qn-auth .qn-eye:hover { color: var(--ink); background: var(--bg); }
body.qn-auth .qn-terms { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--mut); margin: 4px 6px 8px; }
body.qn-auth .qn-terms input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
body.qn-auth .qn-terms a { color: var(--ink); }
body.qn-auth #auth-submit { width: 100%; justify-content: center; min-height: 56px; margin-top: 4px; border-radius: 999px; font-size: 1.1rem; font-weight: 600; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
body.qn-auth #auth-submit .btn__label::after { content: ''; }
body.qn-auth #auth-submit[disabled] { opacity: .55; cursor: default; }
/* when the Google pill is showing, the form button is the outlined pill under it (like "Log in or sign up") */
body.qn-auth #google-block:not([hidden]) ~ #auth-form #auth-submit { background: transparent; color: var(--ink); border: 1px solid var(--line); }
body.qn-auth #google-block:not([hidden]) ~ #auth-form #auth-submit:hover { background: var(--card); }
body.qn-auth .qn-chip { display: none; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 999px; font-size: 1rem; color: var(--ink); background: var(--card); }
body.qn-auth .qn-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.qn-auth .qn-chip button { border: 0; background: none; color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0 2px; }
/* two-step sign in: email first, then password (both stay in the page so password managers can fill them) */
body.qn-auth form[data-kind=login][data-step=email] .qn-pass-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
body.qn-auth form[data-kind=login][data-step=password] .qn-email-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
body.qn-auth form[data-kind=login][data-step=password] .qn-chip { display: flex; }
body.qn-auth form[data-kind=signup] .qn-confirm-field { display: none; }

/* bottom: a clear sign-up / sign-in line and a forgot-password link */
body.qn-auth .qn-foot { padding: 16px 24px calc(22px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 1.02rem; color: var(--mut); background: transparent; border: 0; border-top: 1px solid var(--line); }
body.qn-auth .qn-foot a { color: var(--acc); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
body.qn-auth .qn-foot a:hover { opacity: .85; }
body.qn-auth .qn-foot-forgot { margin-top: 8px; font-size: .92rem; }
body.qn-auth .qn-foot-forgot a { color: var(--mut); font-weight: 600; }
body.qn-auth:has(form[data-step=password]) .qn-foot-forgot { display: none; }
body.qn-auth .qn-secure { display: none; }
@media (min-width: 640px) { body.qn-auth .qn-body { padding-top: 48px; } }
