/* Journal login v2: premium dark glass. Loaded after journal-access.css (shared with admin pages),
   so every rule is scoped to body.login-v2 and the old light styles are only overridden here. */

@font-face {
  font-family: "JournalLogin";
  src: url("assets/fonts/Sarabun-Regular.ttf");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JournalLogin";
  src: url("assets/fonts/Sarabun-SemiBold.ttf");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "JournalLogin";
  src: url("assets/fonts/Sarabun-ExtraBold.ttf");
  font-weight: 800;
  font-display: swap;
}

html:has(body.login-v2) {
  background: #040806;
}
body.login-v2 {
  --t2-net1: 34, 230, 155;
  --t2-net2: 240, 199, 94;
  min-height: 100svh;
  padding: clamp(20px, 5vw, 48px) 16px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--t2-text);
  font-family: "JournalLogin", system-ui, sans-serif;
  font-weight: 600;
  position: relative;
}

/* orbit rings behind the card */
.lg-orbit {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(120vw, 980px);
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
  z-index: -1;
}
.lg-orbit i {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 1px dashed rgba(240, 199, 94, 0.22);
  animation: c2-rot 120s linear infinite;
}
.lg-orbit i:nth-child(2) {
  width: 72%;
  height: 72%;
  border: 2px solid transparent;
  border-top-color: rgba(34, 230, 155, 0.55);
  border-left-color: rgba(34, 230, 155, 0.12);
  filter: drop-shadow(0 0 12px rgba(34, 230, 155, 0.6));
  animation-duration: 18s;
  animation-direction: reverse;
}
@keyframes c2-rot {
  to {
    rotate: 360deg;
  }
}

/* card */
body.login-v2 .login-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 500px);
  padding: clamp(26px, 5vw, 44px);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 90px rgba(34, 230, 155, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
body.login-v2 .login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--t2-ang), rgba(255, 255, 255, 0.06) 0%, rgba(34, 230, 155, 0.9) 12%, rgba(255, 255, 255, 0.06) 28%, rgba(240, 199, 94, 0.85) 62%, rgba(255, 255, 255, 0.06) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: t2-spin 9s linear infinite;
}

body.login-v2 .access-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--t2-text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
}
body.login-v2 .access-brand img {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(240, 199, 94, 0.5), 0 0 24px rgba(240, 199, 94, 0.35);
}
body.login-v2 .access-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--t2-green);
}
body.login-v2 .access-kicker::before {
  content: "";
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--t2-green), transparent);
  box-shadow: 0 0 10px var(--t2-green);
}
body.login-v2 h1 {
  margin: 12px 0 8px;
  font-size: clamp(34px, 7vw, 46px);
  line-height: 1.25;
  font-weight: 800;
  color: var(--t2-text);
  background: linear-gradient(100deg, #fff, #f6dc8e 55%, #22e69b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.login-v2 p {
  color: var(--t2-muted);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 400;
}

/* form */
body.login-v2 form {
  display: grid;
  gap: 16px;
  margin: 26px 0 8px;
}
body.login-v2 label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--t2-text);
}
body.login-v2 input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--t2-line);
  border-radius: 14px;
  background: rgba(4, 8, 6, 0.55);
  color: var(--t2-text);
  font: inherit;
  font-size: 17px;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
body.login-v2 input:focus {
  outline: none;
  border-color: var(--t2-green);
  background: rgba(4, 8, 6, 0.8);
  box-shadow: 0 0 0 4px rgba(34, 230, 155, 0.16), 0 0 26px rgba(34, 230, 155, 0.18);
}
body.login-v2 input:-webkit-autofill {
  -webkit-text-fill-color: var(--t2-text);
  -webkit-box-shadow: 0 0 0 1000px #0a140f inset;
  caret-color: var(--t2-text);
}
body.login-v2 form button[type="submit"] {
  position: relative;
  overflow: hidden;
  min-height: 56px;
  margin-top: 4px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f6dc8e, #d4a948);
  color: #1b1405;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(235, 203, 120, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.25s, box-shadow 0.25s;
}
body.login-v2 form button[type="submit"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-20deg);
  animation: t2-sweep 3.6s ease-in-out infinite;
}
body.login-v2 form button[type="submit"]:hover {
  transform: translateY(-2px);
}
body.login-v2 form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: wait;
}
body.login-v2 #access-message {
  min-height: 1.4em;
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #ff8a8e;
}

/* request access */
body.login-v2 .request-access {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(240, 199, 94, 0.4);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(240, 199, 94, 0.12), rgba(255, 255, 255, 0.03));
}
body.login-v2 .request-access h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #f6dc8e;
}
body.login-v2 .request-access p {
  margin: 0 0 14px;
  font-size: 14px;
}
body.login-v2 .request-line {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid rgba(240, 199, 94, 0.55);
  border-radius: 14px;
  background: rgba(240, 199, 94, 0.1);
  color: var(--t2-text);
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
body.login-v2 .request-line:hover {
  background: rgba(240, 199, 94, 0.2);
  box-shadow: 0 0 28px rgba(240, 199, 94, 0.25);
  transform: translateY(-2px);
}
body.login-v2 .access-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--t2-line);
  font-size: 13px;
  color: rgba(244, 247, 242, 0.55);
}
body.login-v2 .back-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--t2-green);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
body.login-v2 .back-link:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .lg-orbit i,
  body.login-v2 .login-card::before,
  body.login-v2 form button[type="submit"]::after {
    animation: none !important;
  }
}
