/* QuantyGPT sign-in pages: light theme for PR 302's look, plus the parts sign-in adds.
   Phone first (390 px), then laptop. Every box: 2px corners, nothing rounder. */

/* Light: the phone's setting, or the reader's choice (html[data-theme]). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f5f0; --surface: #ffffff; --surface-raised: #eef1ee; --text: #142430; --muted: #4c5c66;
    --mint: #0f6b52; --line: #c9d2d4;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5f0; --surface: #ffffff; --surface-raised: #eef1ee; --text: #142430; --muted: #4c5c66;
  --mint: #0f6b52; --line: #c9d2d4;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* PR 302 wrote some colours by hand; in light they follow the tokens. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-header, :root:not([data-theme="dark"]) .site-footer { border-color: var(--line); }
  :root:not([data-theme="dark"]) .home-main { background: none; }
  :root:not([data-theme="dark"]) .ask-box { background: var(--surface); border-color: var(--line); box-shadow: none; }
  :root:not([data-theme="dark"]) .ask-box textarea::placeholder { color: var(--muted); }
  :root:not([data-theme="dark"]) .ask-button { color: #ffffff; }
  :root:not([data-theme="dark"]) .feature { background: var(--surface); border-color: var(--line); }
  :root:not([data-theme="dark"]) .feature-icon { background: var(--surface-raised); color: var(--text); }
  :root:not([data-theme="dark"]) .beta { color: var(--mint); background: var(--surface-raised); border-color: var(--line); }
  :root:not([data-theme="dark"]) .release, :root:not([data-theme="dark"]) .home-position { color: var(--muted); }
  :root:not([data-theme="dark"]) .nav-signin { border-color: var(--line); }
  :root:not([data-theme="dark"]) .auth-primary { background: var(--mint); color: #ffffff; }
}
:root[data-theme="light"] .site-header, :root[data-theme="light"] .site-footer { border-color: var(--line); }
:root[data-theme="light"] .home-main { background: none; }
:root[data-theme="light"] .ask-box { background: var(--surface); border-color: var(--line); box-shadow: none; }
:root[data-theme="light"] .ask-box textarea::placeholder { color: var(--muted); }
:root[data-theme="light"] .ask-button { color: #ffffff; }
:root[data-theme="light"] .feature { background: var(--surface); border-color: var(--line); }
:root[data-theme="light"] .feature-icon { background: var(--surface-raised); color: var(--text); }
:root[data-theme="light"] .beta { color: var(--mint); background: var(--surface-raised); border-color: var(--line); }
:root[data-theme="light"] .release, :root[data-theme="light"] .home-position { color: var(--muted); }
:root[data-theme="light"] .nav-signin { border-color: var(--line); }
:root[data-theme="light"] .auth-primary { background: var(--mint); color: #ffffff; }

[hidden] { display: none !important; }

/* Header: theme button */
.theme-button {
  min-height: 44px; min-width: 44px; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: 2px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: .85rem;
}
.theme-button:hover { color: var(--text); border-color: var(--mint); }

/* Lines under the ask box (S0) and the "opens soon" line */
.free-line { margin: .75rem auto 0; color: var(--muted); font-size: .875rem; text-align: center; }
.soon-line {
  margin: .9rem auto 0; padding: .55rem .8rem; max-width: 45.75rem;
  border: 1px solid var(--line); border-left: 2px solid var(--mint); border-radius: 2px;
  color: var(--text); font-size: .9rem; text-align: left;
}

/* S1: daily limit sheet, over the page, at the bottom on the phone */
.sheet {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  padding: 1.25rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
  border-top: 2px solid var(--mint); border-radius: 2px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 30px #0000003d;
}
.sheet h2 { margin: 0 0 .5rem; font-size: 1.2rem; line-height: 1.3; }
.sheet p { margin: 0 0 1rem; color: var(--muted); }
.sheet-actions { display: grid; gap: .55rem; }
@media (min-width: 40rem) {
  .sheet { inset: auto auto 2rem 50%; transform: translateX(-50%); width: 28rem; border: 1px solid var(--line); border-top: 2px solid var(--mint); }
}

/* Buttons that are links, for the sign-in screens */
.qg-button {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.9rem; padding: .7rem 1rem; width: 100%;
  border: 1px solid var(--line); border-radius: 2px;
  background: transparent; color: var(--text);
  font: 600 .95rem/1.35 var(--sans); text-decoration: none; cursor: pointer;
}
.qg-button:hover { border-color: var(--mint); }
.qg-button.primary { background: var(--mint); border-color: var(--mint); color: var(--bg); }
.qg-button.danger { color: #e0796b; border-color: #e0796b; }
:root[data-theme="light"] .qg-button.danger { color: #a3271a; border-color: #a3271a; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .qg-button.danger { color: #a3271a; border-color: #a3271a; } }
.qg-button:disabled { opacity: .55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: .6rem 0; min-height: 44px; color: var(--mint); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; font: inherit; }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Sign-in card parts */
.auth-kicker { margin: 0 0 .15rem; color: var(--mint); font-weight: 650; letter-spacing: .02em; }
.auth-kicker a { color: inherit; }
.auth-tagline { margin: 0 0 1rem; color: var(--text); line-height: 1.55; }
.auth-logo { display: block; margin-bottom: .75rem; }
.small-line { margin-top: .75rem !important; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.error-line { margin: .75rem 0 0 !important; padding: .55rem .75rem; border: 1px solid #e0796b; border-radius: 2px; color: var(--text); font-size: .9rem; }
.turnstile-box:not(:empty) { min-height: 65px; }
.code-input { letter-spacing: .4em; font-size: 1.3rem !important; text-align: center; }
.auth-links { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin-top: .5rem; }
.auth-links a { color: var(--mint); }
.consent-list { margin: 1rem 0; padding-left: 1.1rem; display: grid; gap: .55rem; color: var(--text); line-height: 1.5; }
.tick { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 2px; cursor: pointer; line-height: 1.45; }
.tick input { width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; flex: none; accent-color: var(--mint); border-radius: 2px; }
.tick a { color: var(--mint); }
.lang-block { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.lang-block summary { min-height: 44px; display: flex; align-items: center; color: var(--mint); cursor: pointer; }
.account-list { display: grid; gap: .55rem; margin-top: 1rem; }
.account-facts p { margin-top: .35rem !important; }

/* Privacy promise and Terms */
.legal-main { width: min(100%, 46rem); align-self: center; padding: 2rem 1.1rem 3rem; }
.legal-main h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.03em; }
.legal-main h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.legal-main p, .legal-main li { color: var(--muted); line-height: 1.65; }
.legal-main strong { color: var(--text); }
.legal-main ul { padding-left: 1.2rem; }
.legal-main a { color: var(--mint); }
.legal-meta { font-size: .85rem; }

@media (max-width: 22rem) { .auth-main { padding-inline: .6rem; } }

/* Header fits 390 px: one-symbol theme button, no wrapping */
.theme-button { font-size: 1.1rem; line-height: 1; }
.site-header nav a, .theme-button { white-space: nowrap; }
@media (max-width: 26rem) { .site-header nav { gap: .6rem; } .nav-signin { padding-inline: .6rem; } }
/* The logo is a light square: in light it is shown dark so it does not vanish */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .brand img, :root:not([data-theme="dark"]) .chat-brand img, :root:not([data-theme="dark"]) .auth-logo { filter: invert(1); } }
:root[data-theme="light"] .brand img, :root[data-theme="light"] .chat-brand img, :root[data-theme="light"] .auth-logo { filter: invert(1); }
.free-count { color: var(--muted); font-size: .8rem; line-height: 1.35; }
/* Signed-in pages at phone width: "Your account" needs the room, About stays in the footer's reach */
@media (max-width: 25rem) { [data-qg-signed-in-only] .nav-about { display: none; } }
.auth-intro { margin-bottom: 1rem; }

/* A page shown inside the one signed-in screen (QG_ONE_SCREEN): the workspace around it has the header and tabs. */
.qg-framed .site-header, .qg-framed .site-footer, .qg-framed .secondary-skip, .qg-framed .call-modes,
.qg-framed .app-kicker { display: none; }
.qg-framed .app-main { padding-top: .75rem; }

/* "Your account" (workspace, Voice Khata headers) shows only once GET /me says signed in: never while it loads, for a
   guest (the header's Sign in shows instead) or when sign-in is resting or the API is away (state off). */
:root:not([data-qg-state="signed_in"]) [data-qg-member] { display: none; }
/* The GPT note's mark (the * or ¹ after "India's own GPT"): no underline that reads as "_", a bigger tap area. */
sup > a[href="#gpt-note"] { display: inline-block; padding: 0 .2em; text-decoration: none; }
