/* ============================================================
   Sign in / Create account
   ------------------------------------------------------------
   Re-skins the auth pages onto the app's identity: navy #16235c with the
   gold #f7a839 accent, matching the shell and the binary plan screens. The
   pages previously used a near-black #1e1e2f that belonged to nothing else.

   HOW THIS BEATS THE PAGE'S OWN CSS, without !important:

   auth/login.html, auth/register.html and auth/new_user_register.html each
   ship a <style> block in the BODY, so it comes after this file in document
   order and wins any tie at equal specificity. Two things get around that:

     1. Custom properties are redefined on `body` rather than `:root`. A
        variable resolves at the NEAREST ancestor that defines it, and body
        is nearer to the content than html - so this wins regardless of
        source order. Re-pointing the variables re-skins every rule that
        uses them in one move.
     2. Everything else is prefixed with `body `, which adds an element to
        the selector and so outranks the bare class in the page block.

   Remember: manage.py collectstatic, or the server keeps serving the old file.
   ============================================================ */

body {
  /* Consumed by the page's own rules - see note 1 above. */
  --primary-dark: #16235c;
  --border-color: #e3e8f2;
  --soft-white: #f7f9fc;

  --jn-navy: #16235c;
  --jn-navy-2: #1c2b6b;
  --jn-gold: #f7a839;
  --jn-muted: #6b7280;
}

/* ------------------------------------------------------------------ page - */

body {
  background: #eef1f8;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(28, 43, 107, .10) 0%, transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(247, 168, 57, .12) 0%, transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* --------------------------------------------------------------- the card - */

body .form-wrapper {
  background: #fff;
  border: 1px solid rgba(22, 35, 92, .06);
  border-radius: 22px;
  padding: 32px 30px;
  box-shadow: 0 18px 50px rgba(22, 35, 92, .10), 0 2px 8px rgba(22, 35, 92, .04);
}

/* ---------------------------------------------------------- tab switcher - */

body .tab-toggle {
  background: #eef1fa;
  border: 1px solid #e3e8f2;
  border-radius: 999px;
  padding: 4px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 22px;
}

body .tab-toggle button {
  border-radius: 999px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--jn-muted);
}

body .tab-toggle button.active {
  background: linear-gradient(135deg, var(--jn-navy-2), var(--jn-navy));
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 35, 92, .22);
}

/* --------------------------------------------------------------- fields - */

body .form-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--jn-muted);
  margin-bottom: 6px;
}

body .input-group { margin-bottom: 14px; }

body .form-icon {
  background: #eef1fa;
  border: 1px solid var(--border-color);
  border-right: none;
  color: var(--jn-navy) !important;
  width: 46px;
}

body .form-control {
  height: 48px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  color: #1f2937;
}

body .form-control:focus {
  border-color: #b8c4e8;
  box-shadow: 0 0 0 4px rgba(22, 35, 92, .09);
}

/* The eye sits over the input, so it must clear the text. */
body .toggle-password { right: 14px; color: #9aa3b5; }
body .toggle-password:hover { color: var(--jn-navy); }

/* -------------------------------------------------------------- buttons - */

body .signin-btn {
  height: 52px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  background: linear-gradient(135deg, var(--jn-navy-2), var(--jn-navy));
  box-shadow: 0 8px 20px rgba(22, 35, 92, .22);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

body .signin-btn:hover {
  background: linear-gradient(135deg, var(--jn-navy-2), var(--jn-navy));
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(22, 35, 92, .28);
}

body .signin-btn:active { transform: translateY(0); }

body .secondary-btn {
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--jn-navy);
  font-weight: 700;
}

/* Links pick up the accent rather than Bootstrap blue. */
body .form-check a,
body a.text-primary {
  color: var(--jn-navy) !important;
  font-weight: 600;
}

body .form-check a:hover,
body a.text-primary:hover { color: var(--jn-gold) !important; }

body .form-check-input:checked {
  background-color: var(--jn-navy);
  border-color: var(--jn-navy);
}

/* --------------------------------------------------------------- alerts - */

body .alert-custom {
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
}

/* ---------------------------------------------------------------- popup - */

body .popup-header {
  background: linear-gradient(135deg, var(--jn-navy-2), var(--jn-navy));
}

body .popup-box { border-radius: 22px; }

body .popup-field {
  background: #f7f9fc;
  border: 1px solid #eef1f6;
  border-radius: 12px;
}

/* ------------------------------------------------- binary leg choice ----- */
/* Two big targets rather than a select: the choice is permanent, so it should
   be deliberate and visible, not a dropdown default nobody notices. */

body .jn-leg-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

body .jn-leg { margin: 0; cursor: pointer; }
body .jn-leg input { position: absolute; opacity: 0; pointer-events: none; }

body .jn-leg-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  background: #f7f9fc;
  color: var(--jn-muted);
  font-size: 14px;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

body .jn-leg-box i { font-size: 18px; }
body .jn-leg:hover .jn-leg-box { border-color: #c4cef0; }

body .jn-leg input:checked + .jn-leg-box {
  border-color: var(--jn-navy);
  background: #eef1fa;
  color: var(--jn-navy);
  box-shadow: 0 4px 14px rgba(22, 35, 92, .12);
}

body .jn-leg input:focus-visible + .jn-leg-box {
  outline: 2px solid var(--jn-gold);
  outline-offset: 2px;
}


/* ==========================================================================
   Two-page shell  (auth/_auth_shell.html)

   Sign-in and create-account are separate pages now. The brand side is a fixed
   rail on desktop and the form side scrolls independently, so the long
   registration form no longer drags the whole page - and the artwork stays put
   instead of floating halfway down beside a tall form.
   ========================================================================== */

body.jn-auth-body { margin: 0; }

.jn-auth-page { min-height: 100vh; }

/* --- brand ---------------------------------------------------------------- */

.jn-auth-brand {
  background: linear-gradient(135deg, var(--jn-navy-2), var(--jn-navy));
  color: #fff;
  padding: 26px 20px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.jn-auth-brand::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  top: -150px;
  right: -110px;
}

.jn-auth-brand-inner { position: relative; z-index: 1; }

.jn-auth-logo {
  height: 52px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.jn-auth-brand h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin: 0 0 6px;
  color: #fff;
}

.jn-auth-tagline {
  margin: 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .75);
  line-height: 1.5;
}

/* The selling points are for the desktop rail; on a phone the header stays
   compact so the form is the first thing in reach. */
.jn-auth-points { display: none; }

/* --- form side ------------------------------------------------------------ */

.jn-auth-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px 16px 40px;
}

.jn-auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid rgba(22, 35, 92, .06);
  border-radius: 22px;
  padding: 26px 22px;
  box-shadow: 0 18px 50px rgba(22, 35, 92, .10), 0 2px 8px rgba(22, 35, 92, .04);
}

.jn-auth-card-head { margin-bottom: 20px; }

.jn-auth-card-head h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--jn-navy);
  letter-spacing: -.3px;
  margin: 0 0 4px;
}

.jn-auth-card-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--jn-muted);
}

.jn-auth-switch {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 13.5px;
  color: var(--jn-muted);
}

.jn-auth-switch a {
  color: var(--jn-navy);
  font-weight: 700;
  text-decoration: none;
}

.jn-auth-switch a:hover { color: var(--jn-gold); text-decoration: underline; }

/* --- desktop: fixed rail + scrolling form --------------------------------- */

@media (min-width: 992px) {
  .jn-auth-page {
    display: grid;
    grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  }

  .jn-auth-brand {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: left;
    padding: 48px 44px;
  }

  .jn-auth-logo { height: 64px; margin-bottom: 22px; }

  .jn-auth-brand h1 { font-size: 32px; line-height: 1.2; margin-bottom: 10px; }
  .jn-auth-tagline { font-size: 15px; }

  .jn-auth-points {
    display: block;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
  }

  .jn-auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .78);
    margin-bottom: 12px;
    line-height: 1.45;
  }

  .jn-auth-points i { color: var(--jn-gold); font-size: 15px; margin-top: 1px; }

  .jn-auth-main {
    align-items: center;
    min-height: 100vh;
    padding: 48px 32px;
  }

  .jn-auth-card { max-width: 520px; padding: 34px 32px; }
}

/* --- registration is a long form: pair the short fields up ---------------- */

@media (min-width: 576px) {
  #createForm .jn-field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
  }
}
