/* Login page styling (loaded only by login.html).
   Desktop: full-bleed landscape artwork with the card on the left.
   Mobile:  dedicated portrait artwork as the background (logo in the top
   half), with the card centered on the bottom half and a gold button. */

.topbar { display: none !important; }
body { background: #101a30; }

/* Footer rides the artwork as a subtle overlay on desktop; on phones it
   flows after the card (see the media queries below). */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1;
  background: transparent; border: 0;
  color: rgba(226, 232, 240, .55); font-size: 12px;
  padding: 10px 16px calc(8px + env(safe-area-inset-bottom));
}

/* The login page paints its own artwork — no site wallpaper, and the content
   panel chrome comes off so the card floats directly on the art. */
body::before { display: none; }
main.container { max-width: none; margin: 0; padding: 0; position: relative; z-index: 1;
                 background: transparent; border: 0; box-shadow: none; border-radius: 0; }
main.container > .flash {
  position: relative; z-index: 2; max-width: 380px;
  margin: 14px 16px 0 7vw;
}

/* Desktop backdrop: the artwork covers the viewport, logo kept right. */
.login-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("login-branding.webp") center right / cover no-repeat #101a30;
}

/* Mobile-only banner image (hidden on desktop where the backdrop shows). */
.login-brand { display: none; }

.login-wrap {
  position: relative; z-index: 1;
  min-height: 96vh; display: flex; align-items: center;
  justify-content: flex-start; padding: 24px 7vw;
}
.auth-card {
  width: min(380px, 100%); margin: 0;
  background: rgba(255, 255, 255, .95); border-radius: 14px;
  padding: 26px 26px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.auth-card h1 { margin-top: 0; }
.auth-card .form { padding: 0; border: 0; box-shadow: none; background: transparent; }

#login-fade {
  position: fixed; inset: 0; z-index: 60; background: #fff;
  opacity: 0; pointer-events: none; transition: opacity 1s ease;
}

/* ------------------------------------------------------------------ */
/* Phones: the dedicated portrait artwork fills the screen (the shield */
/* and wordmark live in its top half) and the card is centered on the  */
/* empty bottom half.                                                  */
/* ------------------------------------------------------------------ */
@media (max-width: 720px) {
  .login-bg {
    background: url("login-branding-mobile.webp")
                center top / cover no-repeat #101a30;
  }
  .login-brand { display: none; }
  .login-page-flow {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
  }
  .login-wrap {
    /* Everything below the artwork's logo: the bottom half of the screen,
       with the card centered inside it. */
    margin-top: 50vh; margin-top: 50dvh;
    flex: 1 0 auto; min-height: 0;
    justify-content: center; align-items: center;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .auth-card { width: 100%; max-width: 420px; padding: 20px 18px 16px; }
  .auth-card h1 { font-size: 22px; }
  /* 16px inputs stop iOS Safari from auto-zooming the page on focus. */
  .auth-card input { font-size: 16px; padding: 12px; }
  .auth-card .btn-primary { width: 100%; padding: 12px; font-size: 16px; }
  main.container > .flash {
    position: fixed; top: 0; left: 0; right: 0; z-index: 3;
    max-width: none; margin: 12px 16px 0;
  }
  .footer { position: static; text-align: center; padding: 0 16px 14px; }
}

/* Login button: gold on every device, matching the artwork's shield. */
.auth-card .btn-primary {
  background: linear-gradient(180deg, #d8b878, #b8924a);
  border: 1px solid #a5823f;
  color: #16203a; font-weight: 700;
}
.auth-card .btn-primary:hover,
.auth-card .btn-primary:active {
  background: linear-gradient(180deg, #e0c288, #c19c53);
  color: #16203a;
}

/* Short/landscape phones: a mini desktop — the wide artwork backs the
   screen (logo center-right) with a compact card on the left. */
@media (max-width: 900px) and (max-height: 480px) {
  .login-bg {
    display: block;
    background: url("login-branding.webp") center right / cover
                no-repeat #101a30;
  }
  .login-brand { display: none; }
  .login-page-flow {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: row;
    align-items: center; align-items: safe center;
    justify-content: flex-start;
    padding: 10px calc(12px + env(safe-area-inset-right))
             10px calc(16px + env(safe-area-inset-left));
  }
  .login-wrap { padding: 0; margin-top: 0; min-height: 0; flex: 0 1 380px; }
  .auth-card { width: 100%; max-width: 380px; padding: 14px 18px 12px; }
  .auth-card h1 { font-size: 20px; margin-bottom: 8px; }
  .auth-card .form label { margin-bottom: 8px; }
  .auth-card input { font-size: 16px; padding: 8px 10px; }
  .auth-card .actions { margin-top: 8px; }
  .auth-card .btn-primary { width: 100%; padding: 9px; font-size: 16px; }
  main.container > .flash { max-width: none; margin: 8px 12px 0; }
  .footer { position: fixed; text-align: right; }
}
