/* ---------- Auth pages: modern split-screen login ---------- */

body.auth-body{
  height:100vh;
  height:100dvh;
  overflow:hidden;
  display:grid;
  grid-template-columns:1.05fr 1fr;
  background:linear-gradient(160deg,#0B0F14 0%,#111820 50%,#0E151C 100%);
}

/* ---- Left brand panel ---- */
.auth-side{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  gap:34px;
  padding:52px 56px 130px;
  color:#F3F4F6;
  background:
    radial-gradient(900px 620px at 18% -12%, rgba(63,184,176,.30), transparent 62%),
    radial-gradient(760px 520px at 108% 112%, rgba(14,124,134,.22), transparent 58%),
    radial-gradient(1.2px 1.2px at 14px 14px, rgba(255,255,255,.06) 1px, transparent 0),
    linear-gradient(160deg, #0D1219 0%, #111820 100%);
  background-size:auto, auto, 28px 28px, auto;
}
@media (prefers-color-scheme:dark){
  .auth-side{background:
    radial-gradient(900px 620px at 18% -12%, rgba(63,184,176,.24), transparent 62%),
    radial-gradient(760px 520px at 108% 112%, rgba(99,102,241,.20), transparent 58%),
    radial-gradient(1.2px 1.2px at 14px 14px, rgba(255,255,255,.06) 1px, transparent 0),
    linear-gradient(160deg, #15181D 0%, #0B0D10 100%);
  background-size:auto, auto, 28px 28px, auto;}
}
.auth-glow{position:absolute; border-radius:50%; filter:blur(52px); pointer-events:none;}
.auth-glow-a{width:300px; height:300px; top:-80px; inset-inline-end:-60px; background:rgba(63,184,176,.35); animation:auth-drift-a 11s ease-in-out infinite alternate;}
.auth-glow-b{width:240px; height:240px; bottom:-70px; inset-inline-start:-50px; background:rgba(99,102,241,.30); animation:auth-drift-b 13s ease-in-out infinite alternate;}
@keyframes auth-drift-a{from{transform:translate(0,0) scale(1);}to{transform:translate(-26px,26px) scale(1.14);}}
@keyframes auth-drift-b{from{transform:translate(0,0) scale(1);}to{transform:translate(22px,-20px) scale(1.1);}}
@media (prefers-reduced-motion: reduce){ .auth-glow-a,.auth-glow-b{animation:none;} }

.auth-side > *{position:relative; z-index:1;}
/* ลูกโป๊ะ glow ต้องอยู่นอก flow เสมอ — override กฎข้างบนที่ไม่งั้นทับ position:absolute */
.auth-side > .auth-glow{position:absolute; z-index:0;}

.auth-brand{
  display:inline-flex; align-items:center; gap:10px;
  color:#F3F4F6; text-decoration:none; font-weight:800; font-size:17px; letter-spacing:-.2px;
  align-self:flex-start;
}
.auth-brand .brand-mark{
  width:36px; height:36px; border-radius:10px;
  background:linear-gradient(135deg,#5ED4C9,#0E7C86);
  color:#fff; display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 20px -4px rgba(63,184,176,.6);
}
.auth-brand .brand-mark svg{width:19px; height:19px;}

.auth-pitch h2{
  font-size:clamp(26px,2.6vw,34px);
  line-height:1.22; letter-spacing:-.5px; font-weight:800;
  color:#fff; text-wrap:balance;
  margin-bottom:26px; max-width:20ch;
}
.auth-points{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:16px; max-width:44ch;}
.auth-points li{
  display:flex; align-items:flex-start; gap:12px;
  font-size:16px; line-height:1.55; color:#C9CED6;
}
.auth-points .pt-ic{
  width:26px; height:26px; border-radius:8px; flex-shrink:0;
  background:rgba(63,184,176,.12);
  border:1px solid rgba(63,184,176,.25);
  color:#5ED4C9;
  display:flex; align-items:center; justify-content:center;
}
.auth-points .pt-ic svg{width:13px; height:13px;}
.auth-points b{color:#F3F4F6; font-weight:700;}

.auth-metrics{
  display:flex; gap:36px; flex-wrap:wrap;
  padding-top:26px;
  border-top:1px solid rgba(255,255,255,.09);
}
.auth-metric .num{font-size:24px; font-weight:800; color:#8FE3D6; letter-spacing:-.5px;}
.auth-metric .lbl{font-size:14px; color:#9AA1AC; margin-top:3px;}

.auth-foot{font-size:14px; color:#7E8590;}
.auth-foot a{color:#9AA1AC; text-decoration:none;}
.auth-foot a:hover{color:#8FE3D6;}

/* กลุ่ม metrics + copyright เกาะขอบล่างของแผงซ้าย (ไม่ดึงเนื้อหาหลักลงไป) */
.auth-side-foot{
  position:absolute;
  left:56px; right:56px; bottom:38px;
  z-index:1;
}

/* ---- Right form panel ---- */
.auth-main{
  position:relative;
  display:flex; align-items:center; justify-content:center;
  padding:32px 24px;
  min-height:0;
  overflow-y:auto;
  background:var(--bg);
}
.auth-main::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(520px 340px at 82% 8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 65%),
    radial-gradient(440px 320px at 8% 100%, color-mix(in srgb, var(--good) 7%, transparent), transparent 60%);
}

.auth-card{
  position:relative; z-index:1;
  width:100%; max-width:430px;
  background:rgba(19,25,32,.85);
  backdrop-filter:blur(20px);
  border:1px solid rgba(63,184,176,.12);
  border-radius:20px;
  box-shadow:0 20px 60px -18px rgba(63,184,176,.2), 0 0 0 1px rgba(63,184,176,.05);
  padding:38px 34px;
  transition:all .5s cubic-bezier(.4,0,.2,1);
}
/* ═══ Neon Glow — Auth Card ═══ */
.auth-card:hover{
  border-color:rgba(63,184,176,.35);
  box-shadow:
    0 0 20px -4px rgba(63,184,176,.4),
    0 0 50px -10px rgba(63,184,176,.2),
    0 0 90px -20px rgba(176,142,248,.10),
    0 20px 60px -18px rgba(63,184,176,.3);
}
@media (prefers-color-scheme:dark){ .auth-card{box-shadow:0 2px 4px rgba(0,0,0,.4), 0 24px 48px -20px rgba(0,0,0,.55);} }

.auth-card .brand{justify-content:center; margin-bottom:22px;}
.auth-card h1{font-size:23px; font-weight:800; letter-spacing:-.4px; text-align:center; margin-bottom:8px;}
.auth-card .sub{text-align:center; color:var(--ink-dim); font-size:16px; line-height:1.55; margin-bottom:22px;}

.auth-card form{display:flex; flex-direction:column; gap:14px;}
.auth-card .field{margin:0;}
.auth-card input[type="text"],
.auth-card input[type="password"]{width:100%;}
.auth-card .btn.primary{
  width:100%; justify-content:center;
  padding:13px 20px; font-size:16px;
  margin-top:6px;
  background:linear-gradient(135deg, #5ED4C9, #0E7C86);
  box-shadow:0 8px 24px -6px rgba(63,184,176,.45);
}
.auth-card .btn.primary:hover{box-shadow:0 12px 32px -6px rgba(63,184,176,.55); transform:translateY(-1px);}

.auth-links{margin-top:18px; text-align:center; font-size:15px; color:var(--ink-faint);}
.auth-links + .auth-links{margin-top:10px; padding-top:14px; border-top:1px solid var(--border-soft);}
.auth-links a{color:#3FB8B0; font-weight:700; text-decoration:none;}
.auth-links a:hover{text-decoration:underline;}

/* ---- Adaptive: จอเตี้ย (desktop) — ย่อ/ซ่อนของตกแต่งเพื่อให้ทุกอย่างอยู่ในจอ ---- */
@media (max-height:840px){
  .auth-side{padding:36px 44px 104px; gap:24px;}
  .auth-side-foot{bottom:30px;}
  .auth-pitch h2{margin-bottom:18px;}
  .auth-points{gap:12px;}
}
@media (max-height:750px){
  .auth-side{padding:28px 40px 34px; gap:18px;}
  .auth-side-foot{display:none;}
  .auth-points li:nth-child(n+3){display:none;}
  .auth-card{padding:30px 28px;}
}
@media (max-height:620px){
  .auth-side{padding:20px 32px; gap:14px;}
  .auth-points{display:none;}
  .auth-pitch h2{font-size:20px; margin-bottom:0;}
  .auth-card{padding:24px 22px;}
  .auth-main{padding:18px 16px;}
}

/* ---- Responsive: stack on narrow screens — โชว์ฟอร์มทันที ไม่ต้องสกรอลล์ ---- */
@media (max-width:920px){
  body.auth-body{
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0,1fr);
  }
  .auth-side{padding:18px 22px; gap:0;}
  .auth-glow-a,.auth-glow-b{width:180px; height:180px;}
  .auth-brand{font-size:15px;}
  .auth-brand .brand-mark{width:30px; height:30px;}
  .auth-pitch h2{font-size:17px; margin:10px 0 0; max-width:none;}
  .auth-pitch h2 br{display:none;}
  .auth-points,
  .auth-side-foot{display:none;}
  .auth-main{padding:22px 16px 32px; align-items:flex-start;}
  .auth-card{max-width:480px;}
}
