/* The standalone auth pages: login, signup, forgot, reset, waiting (templates/auth_*.html).

   2026-10-02 (owner's call): these pages are the landing page's, not the app's. A visitor reaches
   them from /home, so they wear its palette - white, blue-tinted greys, the product blue
   (--accent-solid) for anything clickable, Plus Jakarta Sans for the heading and the same mark and
   wordmark (templates/_auth_brand.html) - and they are LIGHT whatever the app's theme is
   (<html data-theme="light"> in each page; static/js/auth.js no longer copies the stored theme).
   The shape follows the plain AI sign-in pages they were compared with: no card, one centred
   column, a soft glow of the brand colour at the top, one full-width button, and no help line
   under a field that explains itself.

   Phone-first: one column, 16px gutters, no horizontal scroll. Inputs are 16px so iOS Safari does
   not zoom the page when one takes focus. */

/* The heading face, self-hosted - the same files and the same reason as landing.css: nothing on
   these pages contacts a third party while it loads. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans/plus-jakarta-sans-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans/plus-jakarta-sans-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* The landing page's tokens (static/css/landing.css --lp-*), under auth names. */
  --auth-ink: #0E1A2B;
  --auth-muted: #51637C;
  --auth-line: #DCE7F5;
  --auth-line-strong: #C3D3E8;
  --auth-soft: #F2F7FD;
  --auth-tint: #E7F0FC;
  --auth-accent: var(--accent-solid, #0A74DA);
  --auth-accent-hover: var(--accent-solid-hover, #0866C2);
  --auth-focus: rgba(10, 116, 218, 0.16);
  --auth-danger-bg: #FEF2F2;
  --auth-danger-line: #FECACA;
  --auth-danger-text: #B91C1C;
  --auth-ok-bg: #F0FDF4;
  --auth-ok-line: #BBF7D0;
  --auth-ok-text: #166534;
  --auth-radius: 10px;
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  /* The glow: two faint radial washes of the brand blue behind the brand mark, fading to white. */
  background:
    radial-gradient(1000px 440px at 50% -160px, rgba(10, 116, 218, 0.22), rgba(10, 116, 218, 0) 72%),
    radial-gradient(560px 300px at 84% -90px, rgba(62, 155, 238, 0.16), rgba(62, 155, 238, 0) 70%),
    radial-gradient(520px 280px at 14% -100px, rgba(62, 155, 238, 0.10), rgba(62, 155, 238, 0) 70%),
    #fff;
  background-repeat: no-repeat;
  color: var(--auth-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  max-width: 400px;
  margin: 0 auto;
  padding: clamp(36px, 9vh, 88px) 20px 32px;
  box-sizing: border-box;
}

.auth-shell-wide { max-width: 440px; }

/* No card: the column itself is the form. The class stays because every page wraps in it. */
.auth-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* ---- the brand lockup (templates/_auth_brand.html), as in the landing nav ---- */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 28px;
  text-decoration: none;
  color: inherit;
}

.auth-brand-mark { display: block; }

.auth-brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--auth-accent);
  white-space: nowrap;
}

.auth-brand-name strong { font-weight: 700; color: var(--auth-ink); }

.auth-title {
  margin: 0 0 8px;
  text-align: center;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--auth-ink);
}

.auth-sub {
  margin: 0 0 28px;
  text-align: center;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.55;
  /* Centred lines of even length: no single word left alone on the last line. */
  text-wrap: balance;
}

/* One sentence per line (the waiting page): each balanced on its own. */
.auth-sub > span { display: block; text-wrap: balance; }

/* Two .auth-sub paragraphs in a row sit closer together. */
.auth-sub + .auth-sub { margin-top: -16px; }

/* "Signed in as ..." under the waiting page's one line. */
.auth-meta {
  margin: -14px 0 26px;
  text-align: center;
  font-size: 13.5px;
  color: var(--auth-muted);
  overflow-wrap: anywhere;
}

.auth-meta strong { color: var(--auth-ink); font-weight: 600; }

/* ---- the two-step progress on signup: two bars that fill in blue ---- */
.auth-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.auth-step-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--auth-muted);
}

.auth-step-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--auth-line);
}

.auth-step-item.is-active,
.auth-step-item.is-complete { color: var(--auth-ink); }

.auth-step-item.is-active::before,
.auth-step-item.is-complete::before { background: var(--auth-accent); }

.auth-step-num {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--auth-tint);
  color: var(--auth-muted);
  font-size: 11.5px;
  font-weight: 700;
}

.auth-step-item.is-active .auth-step-num,
.auth-step-item.is-complete .auth-step-num {
  background: var(--auth-accent);
  color: #fff;
}

.auth-step { display: none; }
.auth-step.is-active { display: block; }

/* ---- fields ---- */
.auth-field { margin-bottom: 18px; }

.auth-label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-ink);
}

/* A label with a link at its right end (Password ... Forgot password?). */
.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.auth-label-row .auth-label { margin-bottom: 0; }

.auth-label-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--auth-accent);
  text-decoration: none;
  white-space: nowrap;
}

.auth-label-link:hover { text-decoration: underline; }

.auth-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--auth-line-strong);
  border-radius: var(--auth-radius);
  background: #fff;
  color: var(--auth-ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:hover { border-color: #A9BEDA; }

.auth-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px var(--auth-focus);
}

.auth-input::placeholder { color: var(--auth-muted); opacity: 0.8; }

.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 72px; }

.auth-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-accent);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.auth-pw-toggle:hover { background: var(--auth-soft); }

.auth-help {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--auth-muted);
}

.auth-help a, .auth-footer a, .auth-notice a, .auth-error a, .auth-status a, .auth-sub a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-help a:hover, .auth-footer a:hover, .auth-notice a:hover, .auth-error a:hover,
.auth-status a:hover, .auth-sub a:hover { text-decoration: underline; }

/* ---- buttons ---- */
.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.auth-actions .auth-btn-primary { flex: 1 1 auto; }

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--auth-radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled { opacity: 0.6; cursor: wait; }
.auth-btn:focus-visible, .auth-pw-toggle:focus-visible, .auth-brand:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
}

.auth-btn-primary {
  background: var(--auth-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(13, 42, 80, 0.08), 0 8px 18px -10px rgba(10, 116, 218, 0.55);
}

.auth-btn-primary:hover { background: var(--auth-accent-hover); }

.auth-btn-ghost {
  background: #fff;
  color: var(--auth-ink);
  border-color: var(--auth-line-strong);
}

.auth-btn-ghost:hover { background: var(--auth-soft); border-color: #A9BEDA; }

.auth-btn-block { display: flex; width: 100%; margin-top: 8px; }

/* ---- messages ---- */
.auth-error,
.auth-notice,
.auth-status {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--auth-radius);
  font-size: 14px;
  line-height: 1.5;
}

.auth-error { background: var(--auth-danger-bg); border: 1px solid var(--auth-danger-line); color: var(--auth-danger-text); }
.auth-notice, .auth-status.is-ok { background: var(--auth-ok-bg); border: 1px solid var(--auth-ok-line); color: var(--auth-ok-text); }
.auth-status.is-error { background: var(--auth-danger-bg); border: 1px solid var(--auth-danger-line); color: var(--auth-danger-text); }
.auth-status.is-busy { background: var(--auth-soft); border: 1px solid var(--auth-line); color: var(--auth-ink); }

/* "New to Cusentra? Create an account" / "Already have an account? Sign in". */
.auth-switch {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: var(--auth-muted);
}

.auth-switch a { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.auth-footer {
  margin: 22px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-legal { font-size: 12.5px; }

/* The acceptance statement beside "Verify and create account". */
.auth-help.auth-legal { margin-top: 16px; line-height: 1.55; }

/* Terms · Privacy · Refunds · Withdraw or cancel, under the column. */
.auth-legal-links {
  margin: 40px 0 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--auth-muted);
}

.auth-legal-links a,
.auth-footer.auth-legal a { color: var(--auth-muted); font-weight: 400; text-decoration: none; }
.auth-legal-links a:hover,
.auth-footer.auth-legal a:hover { color: var(--auth-ink); text-decoration: underline; }

/* ---- the app-password guide (shared partial; the settings shell styles it with --set-* tokens) ---- */
.auth-body .gmail-guide {
  margin: 2px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: var(--auth-soft);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--auth-ink);
}

.auth-body .gmail-guide summary { padding: 0; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--auth-ink); }
/* style.css's arrow is a 10px glyph that wrapped onto a line of its own at phone width and read as
   a stray dash; a no-break space keeps it on the last word. */
.auth-body .gmail-guide summary::after { content: "\00a0\25BE"; font-size: 12px; color: var(--auth-muted); }
.auth-body .gmail-guide[open] summary::after { content: "\00a0\25B4"; }
.auth-body .gmail-guide ol { margin: 10px 0 0; padding-left: 20px; }
.auth-body .gmail-guide li { margin: 5px 0; }
.auth-body .gmail-guide a { color: var(--auth-accent); font-weight: 600; }

/* "Not on Gmail?" on signup and "Delete this account" on the waiting page: a quiet centred link
   that opens into a soft panel. Folded away by default - it is the exit, not the path, and it must
   not compete with the form the visitor is meant to fill in. */
.auth-alt {
  margin: 14px 0 0;
  border: 1px solid transparent;
  border-radius: 12px;
}

.auth-alt[open] {
  padding: 0 16px 16px;
  border-color: var(--auth-line);
  background: var(--auth-soft);
}

.auth-alt-summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-muted);
}

.auth-alt-summary::-webkit-details-marker { display: none; }
.auth-alt-summary::after { content: " \203A"; opacity: 0.7; }
.auth-alt[open] .auth-alt-summary::after { content: " \2304"; }
.auth-alt-summary:hover { color: var(--auth-ink); }
.auth-alt-summary:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 2px; border-radius: 8px; }
.auth-alt > .auth-help { margin: 0 0 14px; text-align: center; }
.auth-alt > .auth-alt-form { margin-top: 4px; }
.auth-alt .auth-actions { margin-top: 4px; }

@media (max-width: 480px) {
  .auth-shell { padding: 32px 16px 24px; }
  .auth-brand { margin-bottom: 22px; }
  .auth-title { font-size: 26px; }
  .auth-sub { margin-bottom: 22px; }
  .auth-actions { flex-direction: column-reverse; align-items: stretch; }
  .auth-actions .auth-btn, .auth-actions form, .auth-actions form .auth-btn { width: 100%; }
}
