    :root {
      --font-display: 'Cormorant Garamond', serif;
      --font-body: 'DM Sans', sans-serif;
    }

    body {
      background: var(--bg-page, #FAF6F0);
      font-family: var(--font-body);
    }

    .login-page {
      min-height: 100vh;
      display: flex;
      align-items: stretch;
      justify-content: center;
      /* Space above/below the card so a tall form (Sign Up) never touches the screen edges */
      padding: 2rem 1rem;
    }

    /* ── Split layout: brand panel + form panel ── */
    .login-shell {
      display: flex;
      width: 100%;
      max-width: 1040px;
      margin: auto;
      min-height: 640px;
      box-shadow: 0 20px 60px rgba(44,36,24,.14);
      border-radius: 1.5rem;
      overflow: hidden;
      background: #fff;
    }

    /* ── Left brand panel ── */
    .login-brand-panel {
      flex: 0 0 38%;
      position: relative;
      background:
        linear-gradient(160deg, rgba(44,36,24,.88) 0%, rgba(74,55,40,.80) 55%, rgba(44,36,24,.90) 100%),
        url('/images/login-bg.jpg') center/cover;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 3rem 2.25rem;
      text-align: center;
      color: #F5EFE6;
    }

    .brand-mark {
      font-family: var(--font-display);
      font-size: 2.1rem;
      font-weight: 500;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: #fff;
      margin-bottom: .15rem;
    }
    .brand-mark span {
      color: var(--color-primary, #C8A882);
      margin: 0 .35rem;
    }

    .brand-tagline-sm {
      font-size: .68rem;
      letter-spacing: .28em;
      text-transform: uppercase;
      color: var(--color-primary, #C8A882);
      margin-bottom: 2.25rem;
      opacity: .9;
    }

    .brand-quote {
      font-family: var(--font-display);
      font-style: italic;
      font-size: 1.15rem;
      font-weight: 400;
      line-height: 1.55;
      color: #F0E8DA;
      max-width: 280px;
      position: relative;
      padding: 0 .5rem;
    }
    .brand-quote::before,
    .brand-quote::after {
      font-family: Georgia, serif;
      font-size: 1.6rem;
      color: var(--color-primary, #C8A882);
      opacity: .7;
      vertical-align: -.15em;
    }
    .brand-quote::before { content: '\201C'; margin-right: .1rem; }
    .brand-quote::after { content: '\201D'; margin-left: .1rem; }

    .brand-dots {
      margin-top: 1.75rem;
      letter-spacing: .5rem;
      color: var(--color-primary, #C8A882);
      font-size: .6rem;
    }

    /* ── Right form panel ── */
    .login-form-panel {
      flex: 1;
      padding: 3.25rem 3.25rem;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .login-logo-mobile {
      display: none;
    }

    /* ── Tabs ── */
    .login-tabs {
      display: flex;
      gap: 0;
      justify-content: center;
      margin-bottom: 2rem;
      background: var(--bg-page, #FAF6F0);
      border-radius: .75rem;
      padding: .3rem;
    }
    .login-tab {
      font-family: var(--font-body);
      font-size: .8125rem;
      font-weight: 600;
      letter-spacing: .04em;
      text-transform: uppercase;
      color: var(--color-brown-mid, #7A5C44);
      cursor: pointer;
      transition: color .25s, background .25s, box-shadow .25s;
      border: none;
      background: none;
      padding: .65rem 1.5rem;
      border-radius: .5rem;
      flex: 1;
    }
    .login-tab:hover { color: var(--color-charcoal, #2C2418); }
    .login-tab.active {
      color: var(--color-charcoal, #2C2418);
      background: #fff;
      box-shadow: 0 2px 10px rgba(44,36,24,.08);
    }

    .login-heading {
      font-family: var(--font-display);
      font-size: 1.9rem;
      font-weight: 600;
      color: var(--color-charcoal, #2C2418);
      text-align: center;
      margin-bottom: .3rem;
      letter-spacing: .01em;
    }

    .login-subtitle {
      text-align: center;
      color: var(--color-brown-light, #B08060);
      font-size: .84rem;
      margin-bottom: 1.85rem;
      font-style: italic;
      font-family: var(--font-display);
      font-weight: 500;
    }

    .login-label {
      font-size: .72rem;
      font-weight: 600;
      color: var(--color-brown-dark, #4A3728);
      letter-spacing: .07em;
      text-transform: uppercase;
      margin-bottom: .4rem;
      display: block;
    }

    .login-input-wrap {
      position: relative;
    }
    .login-input-wrap .bi {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--color-stone, #D4C4B0);
      font-size: .95rem;
      pointer-events: none;
      transition: color .2s;
    }
    .login-input-wrap:focus-within .bi {
      color: var(--color-primary, #C8A882);
    }

    .login-input {
      border: 1.5px solid var(--color-stone, #D4C4B0);
      border-radius: .625rem;
      padding: .7rem 1rem .7rem 2.6rem;
      font-size: .9rem;
      color: var(--color-charcoal, #2C2418);
      background: var(--bg-page, #FAF6F0);
      transition: border-color .2s, box-shadow .2s, background .2s;
      width: 100%;
      font-family: var(--font-body);
    }
    .login-input:focus {
      outline: none;
      border-color: var(--color-primary, #C8A882);
      box-shadow: 0 0 0 4px rgba(200,168,130,.15);
      background: #fff;
    }
    .login-input::placeholder { color: #C9BCAC; }

    .login-input-wrap.has-toggle .login-input {
      padding-right: 2.9rem;
    }
    .login-password-toggle {
      position: absolute;
      right: .75rem;
      top: 50%;
      transform: translateY(-50%);
      width: 30px;
      height: 30px;
      border-radius: .5rem;
      background: transparent;
      border: none;
      color: var(--color-stone, #D4C4B0);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: .9rem;
      transition: color .2s;
      z-index: 2;
    }
    .login-password-toggle:hover { color: var(--color-charcoal, #2C2418); }

    .login-checkbox {
      display: flex;
      align-items: flex-start;
      gap: .6rem;
      font-size: .74rem;
      color: var(--color-brown-mid, #7A5C44);
      margin-top: .25rem;
      line-height: 1.45;
    }
    .login-checkbox input[type="checkbox"] {
      /* centres the box on the FIRST line of text, so wrapped lines stay aligned to the text column */
      margin: calc((1.45em - 1rem) / 2) 0 0;
      width: 1rem;
      height: 1rem;
      flex-shrink: 0;
      accent-color: var(--color-primary, #C8A882);
    }
    .login-checkbox label {
      flex: 1;
      min-width: 0;
      margin: 0;
      cursor: pointer;
    }
    .login-checkbox a {
      color: var(--color-primary-dark, #A8845E);
      font-weight: 600;
      text-decoration: none;
    }
    .login-checkbox a:hover { text-decoration: underline; }

    .login-btn {
      background: var(--color-charcoal, #2C2418);
      color: #fff;
      border: none;
      border-radius: .625rem;
      padding: .8rem 1.5rem;
      font-size: .875rem;
      font-weight: 600;
      letter-spacing: .04em;
      text-transform: uppercase;
      width: 100%;
      cursor: pointer;
      transition: background .25s, transform .1s, box-shadow .25s;
      margin-top: .6rem;
      box-shadow: 0 4px 16px rgba(44,36,24,.18);
    }
    .login-btn:hover {
      background: var(--color-primary-dark, #A8845E);
      box-shadow: 0 6px 20px rgba(168,132,94,.3);
    }
    .login-btn:active { transform: scale(.98); }

    /* "Skip for now" under the email step (views/pages/social-email.ejs): the same button, quieter, so the confirm-by-email way stays the main one. */
    .login-btn--outline {
      background: transparent;
      color: var(--color-charcoal, #2C2418);
      border: 1.5px solid var(--color-stone, #D4C4B0);
      box-shadow: none;
      margin-top: 0;
    }
    .login-btn--outline:hover {
      background: var(--color-primary-xlight, #f5ede2);
      color: var(--color-charcoal, #2C2418);
      box-shadow: none;
    }
    .login-skip-note {
      font-size: .78rem;
      line-height: 1.5;
      color: var(--color-brown-mid, #7A5C44);
      text-align: center;
      margin: .75rem 0 0;
    }

    .login-google-btn,
    .login-facebook-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: .6rem;
      width: 100%;
      padding: .72rem 1.5rem;
      border: 1.5px solid var(--color-stone, #D4C4B0);
      border-radius: .625rem;
      background: #fff;
      color: var(--color-charcoal, #2C2418);
      font-size: .875rem;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      transition: background .2s, border-color .2s, box-shadow .2s;
    }
    .login-google-btn:hover,
    .login-facebook-btn:hover,
    .login-facebook-btn:focus-visible {
      background: var(--bg-page, #FAF6F0);
      border-color: var(--color-primary, #C8A882);
      box-shadow: 0 4px 14px rgba(44,36,24,.1);
      color: var(--color-charcoal, #2C2418);
    }
    .login-google-btn svg,
    .login-facebook-btn svg { flex-shrink: 0; width: 19px; height: 19px; }

    /* Session 10: Facebook sits under Google in one stack and wears the SAME button (white, brown outline, charcoal text, same size and
       hover); only its logo carries Facebook's blue, like the coloured G on the Google button. min-height keeps every button 44px+ to tap. */
    .login-social-stack {
      display: flex;
      flex-direction: column;
      gap: .65rem;
    }
    .login-social-stack .login-google-btn,
    .login-social-stack .login-facebook-btn { min-height: 44px; }

    /* Very narrow phones (320px): the card is ~230px wide, so "Continue with Facebook" would wrap to two lines. Tighter padding and
       a hair smaller type keep both buttons on one line and exactly the same height. */
    @media (max-width: 380px) {
      .login-social-stack .login-google-btn,
      .login-social-stack .login-facebook-btn {
        padding-left: .75rem;
        padding-right: .75rem;
        gap: .5rem;
        font-size: .82rem;
      }
    }

    /* "By continuing you agree to ..." line under the social buttons (the sign-up form's own checkbox is never shown to them). */
    .login-social-consent {
      margin: .85rem 0 0;
      font-size: .72rem;
      line-height: 1.5;
      color: var(--color-brown-light, #B08060);
      text-align: center;
    }
    .login-social-consent a {
      color: var(--color-primary-dark, #A8845E);
      font-weight: 600;
      text-decoration: underline;
    }

    .login-divider {
      display: flex;
      align-items: center;
      gap: .75rem;
      margin: 1.35rem 0;
      color: var(--color-stone, #D4C4B0);
      font-size: .75rem;
      letter-spacing: .03em;
    }
    .login-divider::before,
    .login-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--color-stone, #D4C4B0);
    }

    .login-footer-links {
      text-align: center;
      font-size: .82rem;
      color: var(--color-brown-mid, #7A5C44);
      margin-top: 1.4rem;
    }
    .login-footer-links a {
      color: var(--color-primary-dark, #A8845E);
      font-weight: 600;
      text-decoration: none;
      cursor: pointer;
    }
    .login-footer-links a:hover { text-decoration: underline; }

    /* "Staff or Admin? Sign in to the panel": shown by public/js/pwa.js only inside the installed app. */
    .login-app-only {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 0 .3rem;
      margin: .4rem 0 0;
      font-size: .82rem;
      color: var(--color-brown-mid, #7A5C44);
      text-align: center;
    }
    .login-app-only[hidden] { display: none; }
    .login-app-only a {
      display: inline-flex;
      align-items: center;
      min-height: 44px;                 /* tap target */
      color: var(--color-primary-dark, #A8845E);
      font-weight: 600;
      text-decoration: none;
    }
    .login-app-only a:hover { text-decoration: underline; }

    .login-back {
      display: flex;
      align-items: center;
      gap: .4rem;
      justify-content: center;
      margin-top: .9rem;
      color: var(--color-brown-light, #B08060);
      font-size: .78rem;
      text-decoration: none;
    }
    .login-back:hover { color: var(--color-primary-dark, #A8845E); }

    .login-error {
      background: #fdf0ee;
      border: 1px solid #e8a89b;
      border-radius: .625rem;
      color: var(--color-danger, #B85C4A);
      padding: .65rem 1rem;
      font-size: .84rem;
      margin-bottom: 1.25rem;
      display: flex;
      align-items: center;
      gap: .5rem;
    }

    .login-success {
      background: #eef7ee;
      border: 1px solid #a8d8a8;
      border-radius: .625rem;
      color: var(--color-success, #5A8F5E);
      padding: .65rem 1rem;
      font-size: .84rem;
      margin-bottom: 1.25rem;
      display: flex;
      align-items: center;
      gap: .5rem;
    }

    .login-form { display: none; }
    .login-form.active { display: block; }

    /* ── Password strength bar + requirement checklist ── */
    .pw-strength-wrap {
      display: flex;
      align-items: center;
      gap: .6rem;
      margin-top: .5rem;
    }

    .pw-strength-track {
      flex: 1;
      height: 4px;
      background: #e8e3db;
      border-radius: 99px;
      overflow: hidden;
    }

    .pw-strength-fill {
      height: 100%;
      width: 0;
      border-radius: 99px;
      transition: width .3s ease, background-color .3s ease;
    }

    .pw-strength-label {
      font-size: .72rem;
      font-weight: 600;
      white-space: nowrap;
      min-width: 44px;
    }

    .pw-hints {
      list-style: none;
      margin: .4rem 0 0;
      padding: 0;
      font-size: .76rem;
      line-height: 1.75;
      color: var(--color-stone, #8a8378);
    }

    .pw-hints li {
      display: flex;
      align-items: center;
      gap: .45rem;
    }

    .pw-hints li i {
      font-size: .8rem;
    }

    .pw-hints li.met {
      color: var(--color-success, #5A8F5E);
    }

    /* ── Sign Up layout: password + confirm side by side, strength/hints full width underneath ── */
    .reg-field { margin-bottom: .75rem; }
    .reg-pw-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: .75rem;
      margin-bottom: .75rem;
    }
    .reg-pw-grid > div { min-width: 0; }
    .reg-pw-feedback { font-size: .7rem; margin-top: .25rem; min-height: 1rem; }

    /* hints as a 2 x 2 grid instead of 4 stacked lines */
    .reg-pw-help { margin-bottom: .75rem; }
    .reg-pw-help .pw-strength-wrap { margin-top: 0; }
    .reg-pw-help .pw-hints {
      display: grid;
      grid-template-columns: 1fr 1fr;
      column-gap: .75rem;
      line-height: 1.6;
      font-size: .72rem;
    }

    /* the shared password block (public/js/password-field.js) fills this slot: its requirements get the same 2 x 2 grid. The [hidden] rule keeps
       "no requirements until the person types" working, because display:grid above would otherwise beat the hidden attribute. */
    .reg-pw-help .pwf { margin-top: 0; }
    .reg-pw-help .pwf-hints {
      display: grid;
      grid-template-columns: 1fr 1fr;
      column-gap: .75rem;
      line-height: 1.6;
      font-size: .72rem;
    }
    .reg-pw-help .pwf-hints[hidden] { display: none; }
    /* a little air between the match line / blocked-click message and the first checkbox, only while one of them is showing */
    #regPwfFoot:has(.pwf-match:not(:empty), .pwf-alert:not([hidden])) { margin-bottom: .5rem; }

    .reg-checks { margin-bottom: .9rem; }
    .reg-checks .login-checkbox { margin-top: 0; margin-bottom: .5rem; }

    /* ── Compact mode while the Sign Up tab is open (class set from the tab script) ── */
    .login-shell.is-register .login-form-panel { padding-top: 2rem; padding-bottom: 2rem; }
    .login-shell.is-register .login-tabs { margin-bottom: 1.25rem; }
    .login-shell.is-register .login-heading { font-size: 1.7rem; }
    .login-shell.is-register .login-subtitle { margin-bottom: 1.1rem; }
    .login-shell.is-register .login-label { margin-bottom: .3rem; }
    .login-shell.is-register .login-input { padding-top: .6rem; padding-bottom: .6rem; }
    .login-shell.is-register .login-divider { margin: 1rem 0; }
    .login-shell.is-register .login-footer-links { margin-top: 1rem; }
    .login-shell.is-register .login-back { margin-top: .6rem; }

    /* ── Responsive ── */
    @media (max-width: 1000px) {
      .reg-pw-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 860px) {
      .login-brand-panel { display: none; }
      .login-shell { border-radius: 1.25rem; max-width: 460px; }
      .login-form-panel { padding: 2.5rem 1.85rem; }
      .login-logo-mobile {
        display: block;
        max-width: 110px;
        margin: 0 auto 1.25rem;
      }
      .login-page { padding: 1.5rem 1rem; align-items: center; }
    }