/* CJM Portal — sign-in page. Same palette as the dashboard (--bg, cyan). */
:root {
  --bg: #05050a;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --cyan: #22d3ee;
  --cyan-deep: #06b6d4;
  --cyan-glow: rgba(34, 211, 238, 0.35);
  --text: #f2f2f5;
  --text-dim: rgba(255, 255, 255, 0.58);
  --text-faint: rgba(255, 255, 255, 0.34);
  --red: #f87171;
  --amber: #fbbf24;
  --green: #34d399;
  --radius: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── Layout ─────────────────────────────────────────────── */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 560px) 1fr;
}
.auth-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 32px clamp(24px, 5vw, 64px);
  background:
    radial-gradient(600px 400px at 0% 0%, rgba(34, 211, 238, 0.07), transparent 70%),
    var(--bg);
  border-right: 1px solid var(--border);
}

/* ── Brand ──────────────────────────────────────────────── */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-link:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px var(--border), 0 6px 20px rgba(6, 182, 212, 0.25); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.accent { color: var(--cyan); }
.staff-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #0b0b12; background: var(--amber); padding: 4px 10px; border-radius: 999px;
}

/* ── Card ───────────────────────────────────────────────── */
.card {
  margin: auto 0;
  padding: 40px 0 24px;
  width: 100%;
  max-width: 400px;
  align-self: center;
  animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 5px 12px 5px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 999px;
}
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--cyan); animation: ping 2s var(--ease) infinite;
}
@keyframes ping { from { opacity: .8; transform: scale(.5); } to { opacity: 0; transform: scale(1.6); } }
.staff .eyebrow { color: var(--amber); background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.25); }
.staff .pulse, .staff .pulse::after { background: var(--amber); border-color: var(--amber); }

.headline { margin: 0 0 8px; font-size: clamp(30px, 4vw, 38px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 750; }
.lede { margin: 0 0 28px; color: var(--text-dim); font-size: 15px; }

/* ── Notice (expired session, signed out, password saved) ── */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 22px; padding: 12px 14px;
  font-size: 13.5px; color: var(--text);
  background: var(--panel-strong); border: 1px solid var(--border-strong); border-radius: var(--radius);
  animation: rise .4s var(--ease) both;
}
.notice.ok { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }
.notice.warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.notice.ok svg { color: var(--green); }
.notice.warn svg { color: var(--amber); }

/* ── Fields ─────────────────────────────────────────────── */
.view { animation: rise .35s var(--ease) both; }
.field { margin-bottom: 18px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-faint); pointer-events: none; transition: color .2s;
}
input[type=email], input[type=password], input[type=text] {
  width: 100%; height: 48px; padding: 0 44px 0 42px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
}
input::placeholder { color: var(--text-faint); }
input:hover { border-color: var(--border-strong); }
input:focus { border-color: rgba(34, 211, 238, 0.6); background: rgba(34, 211, 238, 0.04); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12); }
.input-wrap:focus-within .input-icon { color: var(--cyan); }
.field.invalid input { border-color: rgba(248, 113, 113, 0.6); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.1); }
.field-error { margin: 6px 0 0; font-size: 12.5px; color: var(--red); min-height: 0; }
.field-error:empty { display: none; }

/* autofill: keep the dark look */
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0c0d14 inset;
  caret-color: var(--text);
}

.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  color: var(--text-faint); background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.password-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.password-toggle svg { width: 17px; height: 17px; }

.caps-warning {
  display: flex; align-items: center; gap: 6px; margin: 7px 0 0;
  font-size: 12.5px; color: var(--amber);
}
.caps-warning::before { content: '⇪'; font-size: 13px; }

/* Remembered account chip */
.remembered {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #001318;
  background: linear-gradient(135deg, var(--cyan), #3b82f6);
}
.remembered-email { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toggle switch */
.toggle { display: flex; align-items: center; gap: 10px; margin: 4px 0 22px; font-size: 13.5px; font-weight: 500; color: var(--text-dim); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  position: relative; width: 36px; height: 20px; flex: none;
  background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border); border-radius: 999px; transition: background .2s;
}
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.toggle input:checked + .toggle-track { background: var(--cyan-deep); border-color: var(--cyan-deep); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── Buttons ────────────────────────────────────────────── */
button { font: inherit; }
.primary, .secondary {
  position: relative; width: 100%; height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; font-weight: 700; border-radius: var(--radius); cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
}
.primary {
  color: #001318; border: 0;
  background: linear-gradient(180deg, #3fe0f5, var(--cyan-deep));
  box-shadow: 0 8px 24px -8px var(--cyan-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 30px -8px var(--cyan-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.primary:active:not(:disabled) { transform: translateY(0); }
.secondary { color: var(--text); background: var(--panel-strong); border: 1px solid var(--border-strong); }
.secondary:hover:not(:disabled) { border-color: rgba(34, 211, 238, 0.5); }
.primary:disabled, .secondary:disabled { opacity: .55; cursor: not-allowed; }
.loading .btn-label { opacity: .85; }
.loading::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { padding: 0; background: none; border: 0; color: var(--cyan); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.small { font-size: 12.5px; }
.link-btn.back { color: var(--text-dim); }
.link-btn.back:hover { color: var(--text); }
.alt { margin: 20px 0 0; text-align: center; font-size: 13.5px; color: var(--text-dim); }

/* ── Messages ───────────────────────────────────────────── */
.msg-area:empty { display: none; }
.msg-area { margin-top: 16px; }
.msg { padding: 11px 14px; font-size: 13.5px; border-radius: var(--radius); animation: rise .3s var(--ease) both; }
.msg.error { color: #fecaca; background: rgba(248, 113, 113, 0.09); border: 1px solid rgba(248, 113, 113, 0.3); }
.msg.ok { color: #a7f3d0; background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.3); }
.msg .link-btn { margin-left: 4px; font-size: inherit; }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ── Password strength ──────────────────────────────────── */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.strength span { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); transition: background .25s; }
.strength[data-score="1"] span:nth-child(-n+1) { background: var(--red); }
.strength[data-score="2"] span:nth-child(-n+2) { background: var(--amber); }
.strength[data-score="3"] span:nth-child(-n+3) { background: var(--cyan); }
.strength[data-score="4"] span { background: var(--green); }
.strength-label { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); min-height: 18px; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-faint); transition: color .2s; }
.checklist li::before {
  content: ''; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--text-faint); transition: all .2s;
}
.checklist li.met { color: var(--text-dim); }
.checklist li.met::before {
  border-color: var(--green); background: var(--green)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305050a' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 9px no-repeat;
}
.match { margin: 6px 0 0; font-size: 12.5px; min-height: 18px; }
.match.ok { color: var(--green); }
.match.bad { color: var(--red); }

/* ── Sent / expired views ───────────────────────────────── */
.sent-icon {
  width: 56px; height: 56px; margin: 10px 0 18px; display: grid; place-items: center;
  border-radius: 16px; color: var(--cyan); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25);
}
.sent-icon svg { width: 26px; height: 26px; }
.sent-text { margin: 0 0 22px; color: var(--text-dim); font-size: 14.5px; }
.sent-text strong { color: var(--text); font-weight: 600; word-break: break-all; }

/* ── Footer ─────────────────────────────────────────────── */
.auth-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font-size: 12px; color: var(--text-faint); }
.secure { display: inline-flex; align-items: center; gap: 6px; }
.secure svg { width: 13px; height: 13px; }

/* ── Visual side ────────────────────────────────────────── */
.auth-visual {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end;
  padding: clamp(32px, 5vw, 72px);
  background:
    linear-gradient(180deg, rgba(5, 5, 10, 0.15) 0%, rgba(5, 5, 10, 0.35) 45%, rgba(5, 5, 10, 0.92) 100%),
    linear-gradient(90deg, rgba(5, 5, 10, 0.6) 0%, transparent 35%),
    var(--login-bg, url('/assets/login/week-00.webp')) center 40% / cover no-repeat;
}
.visual-glow {
  position: absolute; width: 60%; aspect-ratio: 1; left: 20%; top: 25%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 60%);
  filter: blur(40px); animation: drift 14s ease-in-out infinite alternate; pointer-events: none;
}
@keyframes drift { from { transform: translate(-6%, -4%); } to { transform: translate(6%, 5%); } }

.showcase {
  position: relative; max-width: 520px; padding: 30px;
  background: rgba(10, 12, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px;
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  animation: rise .8s .15s var(--ease) both;
}
.showcase-eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.showcase-title { margin: 0 0 22px; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; letter-spacing: -0.02em; }
.showcase-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.showcase-list li { display: flex; gap: 14px; align-items: flex-start; }
.showcase-list .ico {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  color: var(--cyan); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.22); border-radius: 11px;
}
.showcase-list .ico svg { width: 18px; height: 18px; }
.showcase-list strong { display: block; font-size: 14.5px; }
.showcase-list small { display: block; font-size: 13px; color: var(--text-dim); }
.showcase-foot { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); }
.showcase-foot svg { width: 15px; height: 15px; color: var(--green); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-main {
    border-right: 0; min-height: 100vh; min-height: 100dvh; padding: 20px 16px 24px;
    background:
      linear-gradient(180deg, rgba(5, 5, 10, 0.55) 0%, var(--bg) 42%),
      var(--login-bg, url('/assets/login/week-00.webp')) center top / 100% auto no-repeat,
      var(--bg);
  }
  .auth-visual { display: none; }
  .card { padding-top: 56px; max-width: 440px; }
}
@media (max-width: 420px) {
  .headline { font-size: 28px; }
  .auth-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
