/* ============================================================
   Login page — professional split-screen (brand panel + form).
   Loaded only by login.php, after styles.css (which provides the
   design tokens used below). Class prefix: .auth-*
   ============================================================ */

.auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.auth-shell { display: flex; min-height: 100vh; }

/* ---------- left brand panel ---------- */
.auth-aside {
  flex: 1.05;
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex; flex-direction: column;   /* let the inner wrapper fill full height */
  background:
    linear-gradient(165deg,
      color-mix(in oklab, var(--accent) 70%, #15122b) 0%,
      var(--accent) 46%,
      color-mix(in oklab, var(--accent) 56%, #7C3AED) 100%);
}
/* layered glows + dot texture overlay */
.auth-aside::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(680px 420px at 82% 6%, rgba(255, 255, 255, .22), transparent 62%),
    radial-gradient(560px 460px at 6% 98%, rgba(0, 0, 0, .30), transparent 60%),
    radial-gradient(440px 320px at 48% 58%, color-mix(in oklab, #fff 12%, transparent), transparent 72%),
    radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: auto, auto, auto, 24px 24px;
  pointer-events: none;
  animation: auth-glow 16s ease-in-out infinite alternate;
}
@keyframes auth-glow {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  to   { transform: translate3d(-2%, 1.6%, 0) scale(1.06); opacity: .9; }
}
.auth-aside-inner {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; flex-direction: column;
  width: 100%; box-sizing: border-box;
  padding: 44px 56px;
}
/* brand + hero + features: centered block (footer stays at the bottom) */
.auth-aside-body {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 30px;
}
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-logo {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  backdrop-filter: blur(4px);
}
.auth-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.auth-brand-tag { font-size: 12px; opacity: .82; margin-top: 1px; }

.auth-hero { max-width: 430px; }
.auth-hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 38px; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 16px;
}
.auth-hero-sub { font-size: 15px; line-height: 1.62; opacity: .9; margin: 0 0 30px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-feats li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; opacity: .96; }
.auth-tick {
  width: 23px; height: 23px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .14);
}
.auth-aside-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; opacity: .9;
}
.auth-status { display: inline-flex; align-items: center; gap: 8px; }
.auth-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: auth-pulse 2s infinite;
}
@keyframes auth-pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.auth-ver { opacity: .75; letter-spacing: .02em; }

/* ---------- right form panel ---------- */
.auth-main {
  flex: .95;
  display: grid; place-items: center;
  padding: 32px;
  background:
    radial-gradient(900px 480px at 50% -12%, color-mix(in oklab, var(--accent) 9%, transparent), transparent),
    radial-gradient(var(--grid-dot) 1px, transparent 1px),
    var(--canvas);
  background-size: auto, 22px 22px, auto;
}
.auth-card {
  width: 388px; max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 38px 36px 30px;
  animation: auth-rise .45s cubic-bezier(.2, .7, .2, 1);
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.auth-card-logo {
  display: none;
  width: 44px; height: 44px; border-radius: 13px; margin: 0 auto 18px;
  place-items: center; background: var(--accent);
  box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 45%, transparent);
}
.auth-title { font-family: var(--font-display); font-weight: 700; font-size: 23px; letter-spacing: -.02em; margin: 0 0 5px; }
.auth-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 24px; }

.auth-err {
  display: flex; align-items: center; gap: 9px;
  background: var(--err-soft); color: var(--err);
  font-size: 12.5px; font-weight: 500;
  border-radius: 11px; padding: 11px 13px; margin-bottom: 18px;
}
.auth-err svg { flex-shrink: 0; }

.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.auth-card .bst-input { height: 44px; border-radius: 11px; font-size: 13.5px; width: 100%; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.auth-card .bst-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); outline: none; }

/* password field + show/hide toggle */
.auth-pass { position: relative; }
.auth-pass .bst-input { padding-right: 44px; }
.auth-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--text-faint); cursor: pointer; border-radius: 8px;
  display: grid; place-items: center; transition: color .15s, background .15s;
}
.auth-eye:hover { color: var(--text); background: var(--canvas-2); }

/* 2FA code input */
.auth-code { text-align: center; letter-spacing: .28em; font-size: 18px; height: 50px; font-weight: 600; }

.auth-btn {
  width: 100%; height: 46px; margin-top: 4px;
  border: none; border-radius: 12px;
  background: var(--accent); color: var(--accent-fg);
  font-family: var(--font-body); font-weight: 650; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 38%, transparent);
  transition: filter .15s, transform .06s;
}
.auth-btn:hover { filter: brightness(1.06); }
.auth-btn:active { transform: translateY(1px); }

.auth-alt { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }
.auth-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

.auth-foot {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--text-faint);
}

/* uploaded brand logo (Settings → General) */
.auth-logo img, .auth-card-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 10px; }
.auth-card-logo.has-img { background: #fff; border: 1px solid var(--line); box-shadow: none; }

/* remember-me checkbox */
.auth-remember {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--text-muted); cursor: pointer;
  margin: -2px 0 18px; user-select: none;
}
.auth-remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check {
  width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  display: inline-grid; place-items: center; transition: background .15s, border-color .15s;
}
.auth-check::after {
  content: ""; width: 5px; height: 9px; margin-top: -2px;
  border: solid var(--accent-fg); border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .15s;
}
.auth-remember input:checked + .auth-check { background: var(--accent); border-color: var(--accent); }
.auth-remember input:checked + .auth-check::after { transform: rotate(45deg) scale(1); }
.auth-remember input:focus-visible + .auth-check { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }

/* subtle accent ring on the card */
.auth-card { box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in oklab, var(--accent) 7%, transparent); }

/* ---------- entrance animations (staggered) ---------- */
@keyframes auth-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-brand, .auth-hero-title, .auth-hero-sub, .auth-feats li, .auth-aside-foot {
  animation: auth-in .65s both cubic-bezier(.2, .7, .2, 1);
}
.auth-brand            { animation-delay: .04s; }
.auth-hero-title       { animation-delay: .12s; }
.auth-hero-sub         { animation-delay: .20s; }
.auth-feats li:nth-child(1) { animation-delay: .28s; }
.auth-feats li:nth-child(2) { animation-delay: .35s; }
.auth-feats li:nth-child(3) { animation-delay: .42s; }
.auth-aside-foot       { animation-delay: .52s; }
.auth-card             { animation-delay: .10s; }
.auth-feats li:hover .auth-tick { transform: scale(1.08); transition: transform .15s; }

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .auth-aside::before, .auth-brand, .auth-hero-title, .auth-hero-sub,
  .auth-feats li, .auth-aside-foot, .auth-card, .auth-dot { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .auth-aside { display: none; }
  .auth-main { flex: 1; }
  .auth-card-logo { display: grid; }
}
