/* ============================================================
   AFK — member login. Premium dark gym theme.
   Native system type (SF Pro on Apple, Segoe UI on Windows,
   Roboto on Android), layered depth, restrained motion.
   Mobile-first; centres to a single card on larger screens.
   ============================================================ */
:root {
  --bg: #0a0b0d;
  --text: #f7f8f9;
  --text-dim: #c9ced3;
  --muted: #9aa1a8;
  --muted-2: #6b7178;
  --red: #f5333d;
  --red-hi: #ff505a;
  --red-lo: #d41d27;
  --yellow: #f6c418;

  --card: rgba(15, 17, 20, 0.80);
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-str: rgba(255, 255, 255, 0.14);
  --field: rgba(255, 255, 255, 0.045);
  --field-border: rgba(255, 255, 255, 0.11);

  --r-lg: 24px;
  --r-md: 14px;
  --r-sm: 12px;
  --ring: 0 0 0 3px rgba(245, 51, 61, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.login-page {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  position: relative;
  overflow-x: hidden;
}
::selection { background: rgba(245, 51, 61, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 2px; border-radius: 6px; }

/* Background photo + legibility treatment */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background: #000 url("/img/gym-bg.jpg") center 18% / cover no-repeat;
  transform: scale(1.04); /* hide edges, add a touch of depth */
}
.bg-scrim {
  position: fixed; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(10,11,13,0) 0%, rgba(10,11,13,0.25) 55%, rgba(10,11,13,0.6) 100%),
    linear-gradient(180deg, rgba(8,9,11,0.35) 0%, rgba(8,9,11,0.5) 34%, rgba(8,9,11,0.86) 68%, rgba(8,9,11,0.97) 100%);
}

/* Top bar */
.topbar {
  position: relative; z-index: 3;
  display: flex; justify-content: flex-end;
  padding: calc(14px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 0 18px;
}
.help {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--hairline-str);
  color: #eef0f2; font-size: 13.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background 0.18s, border-color 0.18s, transform 0.06s;
}
.help:hover { background: rgba(255, 255, 255, 0.13); }
.help:active { transform: scale(0.97); }
.help svg { opacity: 0.85; }

/* Layout */
.login-wrap {
  position: relative; z-index: 2;
  min-height: calc(100svh - 52px);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  gap: 20px;
}

/* Brand */
.brand { text-align: center; margin: 10px 0 2px; }
.brand-logo {
  font-style: italic; font-weight: 800; font-size: 52px; line-height: 1;
  letter-spacing: -2.5px; text-shadow: 0 4px 22px rgba(0, 0, 0, 0.6);
}
.brand-logo .af { color: #fff; }
.brand-logo .k { color: var(--red); }
.brand-pill {
  display: inline-block; margin-top: 9px;
  background: var(--yellow); color: #121212;
  font-weight: 800; font-size: 11px; letter-spacing: 0.36em;
  padding: 5px 9px 5px 15px; border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Card */
.card {
  position: relative;
  width: 100%; max-width: 432px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0) 120px),
    var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 28px 24px 26px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 70px -20px rgba(0, 0, 0, 0.75),
    0 8px 24px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card h1 {
  margin: 2px 0 7px; text-align: center;
  font-size: 31px; font-weight: 800; letter-spacing: -0.8px;
}
.card h1 span { color: var(--red); }
.sub { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* Fields */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-dim); margin: 0 0 8px 2px; }
.input {
  display: flex; align-items: center; gap: 11px;
  background: var(--field); border: 1px solid var(--field-border);
  border-radius: var(--r-md); padding: 0 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.input:focus-within {
  border-color: var(--red);
  box-shadow: var(--ring);
  background: rgba(255, 255, 255, 0.06);
}
.input .icon { color: var(--muted-2); flex: none; transition: color 0.16s ease; }
.input:focus-within .icon { color: var(--red); }
.input input {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); font-family: var(--font); font-size: 16px; padding: 15px 0; letter-spacing: -0.01em;
}
.input input::placeholder { color: #6a7077; }
.eye {
  flex: none; background: transparent; border: 0; cursor: pointer;
  color: var(--muted-2); padding: 7px; margin-right: -5px; border-radius: 9px; display: inline-flex;
  transition: color 0.15s, background 0.15s;
}
.eye:hover { color: #cfd3d7; background: rgba(255,255,255,0.06); }
.eye[aria-pressed="true"] { color: var(--red); }

/* Remember / forgot row */
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 6px 2px 20px;
}
.remember { display: inline-flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 14px; cursor: pointer; user-select: none; }
.remember input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; border: 1.8px solid #4c525b; border-radius: 6px;
  background: transparent; cursor: pointer; position: relative; flex: none;
  transition: background 0.15s, border-color 0.15s;
}
.remember input:checked { background: var(--red); border-color: var(--red); }
.remember input:checked::after {
  content: ""; position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.forgot { background: none; border: 0; cursor: pointer; color: var(--red); font-size: 14px; font-weight: 600; padding: 2px; }
.forgot:hover { color: var(--red-hi); }

/* Primary button */
.btn-primary {
  width: 100%; border: 0; cursor: pointer; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--red-hi), var(--red-lo));
  color: #fff; font-family: var(--font); font-size: 16.5px; font-weight: 700; letter-spacing: 0;
  padding: 16px 18px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 12px 26px -6px rgba(212, 29, 39, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.3);
  transition: filter 0.16s, transform 0.07s, box-shadow 0.16s;
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.98); }
.btn-primary:disabled { filter: grayscale(0.45) brightness(0.72); cursor: default; transform: none; box-shadow: none; }
.btn-primary .arr { font-weight: 600; transition: transform 0.18s ease; }
.btn-primary:hover .arr { transform: translateX(3px); }

/* Divider */
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--hairline-str), transparent); }

/* Secondary button */
.btn-outline {
  display: flex; align-items: center; justify-content: center;
  width: 100%; text-decoration: none;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--field-border);
  color: #eceef0; font-size: 15px; font-weight: 600;
  padding: 15px 18px; border-radius: var(--r-md);
  transition: background 0.16s, border-color 0.16s, transform 0.07s;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--hairline-str); }
.btn-outline:active { transform: translateY(1px); }
.btn-outline span { color: var(--red); margin-left: 6px; font-weight: 700; }

/* Inline messages */
.form-msg { margin: 0 0 16px; font-size: 14px; line-height: 1.45; border-radius: var(--r-sm); padding: 12px 14px; }
.form-msg.error { color: #ffd9db; background: rgba(245, 51, 61, 0.13); border: 1px solid rgba(245, 51, 61, 0.42); }
.form-msg.ok { color: #c9f4d4; background: rgba(46, 160, 80, 0.13); border: 1px solid rgba(46, 160, 80, 0.42); }

/* Feature strip */
.features {
  list-style: none; margin: 4px 0 0; padding: 6px 2px 0;
  display: flex; width: 100%; max-width: 432px;
}
.features li {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-dim); text-align: center; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.3;
  position: relative; padding: 0 6px;
}
.features li + li::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 1px;
  background: var(--hairline-str);
}
.features li svg { color: #f0f2f4; opacity: 0.95; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: 100%; max-width: 416px;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 90px), #141619;
  border: 1px solid var(--hairline); border-radius: 20px;
  padding: 26px 24px; box-shadow: 0 30px 80px -16px rgba(0, 0, 0, 0.8);
  animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-card h2 { margin: 0 0 9px; font-size: 21px; font-weight: 800; letter-spacing: -0.5px; }
.modal-card .sub { text-align: left; margin-bottom: 14px; font-size: 14.5px; }
.btn-text { width: 100%; margin-top: 10px; background: none; border: 0; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 10px; border-radius: 8px; }
.btn-text:hover { color: #d2d6da; background: rgba(255,255,255,0.04); }

/* Larger screens */
@media (min-width: 560px) {
  .brand-logo { font-size: 58px; }
  .login-wrap { justify-content: center; gap: 24px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card, .modal-card { animation: none; }
  .btn-primary, .btn-primary .arr, .help, .input, .eye, .btn-outline { transition: none; }
  .bg { transform: none; }
}

/* ============================================================
   "Logging in" splash — shown on successful login, continues
   seamlessly into the member app's matching splash (portal.css).
   ============================================================ */
#afk-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: #0a0b0d url("/img/gym-bg.jpg") center 18% / cover no-repeat;
  opacity: 0; animation: splFadeIn .3s ease forwards;
}
#afk-splash .spl-scrim { position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 50% 42%, rgba(10,11,13,.3), rgba(8,9,11,.82) 72%, rgba(8,9,11,.95)); }
#afk-splash .spl-inner { position: relative; text-align: center; padding: 0 24px; }
#afk-splash .spl-logo {
  font-style: italic; font-weight: 800; font-size: 64px; line-height: 1; letter-spacing: -3px;
  text-shadow: 0 8px 30px rgba(0,0,0,.6); animation: splBreath 2.6s ease-in-out .8s infinite;
}
#afk-splash .spl-logo span { display: inline-block; }
#afk-splash .spl-logo .af { color: #fff; animation: splRise .6s cubic-bezier(.2,.8,.2,1) both; }
#afk-splash .spl-logo .k { color: var(--red); animation: splRise .6s cubic-bezier(.2,.8,.2,1) .1s both; }
#afk-splash .spl-pill {
  display: inline-block; margin-top: 12px; background: var(--yellow); color: #121212;
  font-weight: 800; font-size: 12px; letter-spacing: .36em; padding: 5px 10px 5px 16px; border-radius: 7px;
  box-shadow: 0 8px 22px rgba(0,0,0,.4); animation: splRise .6s cubic-bezier(.2,.8,.2,1) .22s both;
}
#afk-splash .spl-bar {
  width: 168px; height: 4px; border-radius: 99px; margin: 32px auto 0; position: relative; overflow: hidden;
  background: rgba(255,255,255,.12); animation: splBarFade .5s ease .38s both;
}
#afk-splash .spl-bar span {
  position: absolute; top: 0; left: 0; height: 100%; width: 42%; border-radius: 99px;
  background: linear-gradient(90deg, rgba(255,80,90,0), var(--red-hi) 35%, var(--red) 65%, rgba(245,51,61,0));
  animation: splSweep 1.15s cubic-bezier(.65,.02,.35,1) infinite;
}
#afk-splash .spl-text { margin-top: 16px; color: #aeb4bb; font-size: 13.5px; font-weight: 600; letter-spacing: .04em; animation: splBarFade .5s ease .48s both; }
@keyframes splFadeIn { to { opacity: 1; } }
@keyframes splRise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes splBarFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splSweep { 0% { transform: translateX(-140%); } 100% { transform: translateX(340%); } }
@keyframes splBreath { 0%,100% { filter: drop-shadow(0 0 0 rgba(245,51,61,0)); } 50% { filter: drop-shadow(0 0 26px rgba(245,51,61,.4)); } }
@media (prefers-reduced-motion: reduce) {
  #afk-splash, #afk-splash .spl-logo, #afk-splash .spl-logo .af, #afk-splash .spl-logo .k, #afk-splash .spl-pill, #afk-splash .spl-bar, #afk-splash .spl-text { animation-duration: .01s; }
  #afk-splash .spl-bar span { animation: none; width: 100%; }
}
