/* ============================================================
   VSS Login Page — Pure CSS
   ใช้ Noto Sans Thai · accent #1a56db / #60a5fa
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100vh;
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  color: #0f172a;
  overflow-x: hidden;
}

/* ===== Background — deep navy with layered gradients ===== */
body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(59,130,246,.22), transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(96,165,250,.16), transparent 60%),
    linear-gradient(180deg, #0a2540 0%, #061b30 100%);
  background-attachment: fixed;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  width: 600px; height: 600px;
  top: -200px; right: -200px;
  background: radial-gradient(circle, rgba(59,130,246,.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}

/* ===== Page layout ===== */
.vssl-page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
}

/* ===== Title block ===== */
.vssl-title {
  text-align: center;
  margin-bottom: 28px;
  color: #fff;
  animation: vsslFadeUp .6s cubic-bezier(.2,.7,.3,1) both;
}
.vssl-logo {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: #fff;
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow:
    0 12px 28px -8px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,.08),
    inset 0 0 0 1px rgba(255,255,255,.3);
}
.vssl-logo img {
  width: 72%; height: 72%;
  object-fit: contain;
  display: block;
}
.vssl-title h1 {
  font: 700 22px 'Noto Sans Thai';
  color: #f8fafc;
  margin: 0;
  letter-spacing: .2px;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.vssl-title .sub {
  font: 400 13px 'Noto Sans Thai';
  color: #bfdbfe;
  margin-top: 4px;
  letter-spacing: 1px;
  opacity: .8;
}

/* ===== Login card ===== */
.vssl-card {
  width: 100%; max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 32px 28px;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,.06);
  animation: vsslFadeUp .6s cubic-bezier(.2,.7,.3,1) .1s both;
}
.vssl-card-head {
  margin-bottom: 22px;
}
.vssl-card-head h2 {
  font: 700 17px 'Noto Sans Thai';
  color: #0f172a;
  margin: 0 0 4px;
}
.vssl-card-head .muted {
  font: 400 12.5px 'Noto Sans Thai';
  color: #64748b;
}

/* Fields */
.vssl-field {
  margin-bottom: 14px;
}
.vssl-field label {
  display: block;
  font: 500 12px 'Noto Sans Thai';
  color: #475569;
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.vssl-inp {
  position: relative;
}
.vssl-inp .icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
  transition: color .15s;
}
.vssl-inp input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 38px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: 500 14px 'Noto Sans Thai';
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.vssl-inp input::placeholder { color: #94a3b8; font-weight: 400; }
.vssl-inp input:hover { border-color: #94a3b8; }
.vssl-inp input:focus {
  border-color: #1a56db;
  box-shadow: 0 0 0 4px rgba(26,86,219,.12);
}
.vssl-inp input:focus ~ .icon { color: #1a56db; }

/* Show/hide password toggle */
.vssl-pwtoggle {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: 0; background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  display: grid; place-items: center;
  transition: color .15s, background .15s;
  padding: 0;
}
.vssl-pwtoggle:hover { color: #475569; background: #f1f5f9; }
.vssl-pwtoggle i { font-size: 16px; }

/* Inline error */
.vssl-error {
  background: linear-gradient(180deg, #fef2f2, #fee2e2);
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: 8px;
  font: 500 12.5px 'Noto Sans Thai';
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  animation: vsslShake .35s;
}
.vssl-error i { font-size: 14px; flex-shrink: 0; }

/* Login button */
.vssl-btn {
  width: 100%;
  height: 44px;
  border: 0;
  background: linear-gradient(180deg, #3b82f6 0%, #1a56db 100%);
  color: #fff;
  font: 600 14px 'Noto Sans Thai';
  border-radius: 9px;
  cursor: pointer;
  margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow:
    0 8px 20px -6px rgba(26,86,219,.6),
    inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .12s, box-shadow .15s, filter .15s;
  letter-spacing: .3px;
}
.vssl-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 12px 26px -6px rgba(26,86,219,.7),
    inset 0 1px 0 rgba(255,255,255,.2);
}
.vssl-btn:active { transform: translateY(0); }
.vssl-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.vssl-btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 999px;
  animation: vsslSpin .8s linear infinite;
  display: none;
}
.vssl-btn.loading .spinner { display: inline-block; }
.vssl-btn.loading .label { opacity: .7; }
.vssl-btn.loading .arrow { display: none; }

/* Footer */
.vssl-footer {
  margin-top: 28px;
  color: #64748b;
  font: 400 11.5px 'Noto Sans Thai';
  text-align: center;
  animation: vsslFadeUp .6s cubic-bezier(.2,.7,.3,1) .2s both;
}
.vssl-footer .copyright { color: #94a3b8; }

/* Animations */
@keyframes vsslFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vsslShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
@keyframes vsslSpin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .vssl-page { padding: 28px 16px 16px; }
  .vssl-card { padding: 24px 22px 22px; border-radius: 14px; }
  .vssl-title { margin-bottom: 22px; }
  .vssl-logo { width: 60px; height: 60px; border-radius: 14px; }
  .vssl-title h1 { font-size: 19px; }
  .vssl-title .sub { font-size: 11px; }
}
@media (min-width: 768px) {
  .vssl-card { padding: 36px 36px 30px; }
}

/* Hide browser-native password reveal icons (Edge/IE has ::-ms-reveal, ::-ms-clear;
   Safari/Chrome show ::-webkit-credentials-auto-fill-button). We render our own
   eye toggle via .vssl-pwtoggle so the native one would be a duplicate. */
.vssl-inp input::-ms-reveal,
.vssl-inp input::-ms-clear { display: none; width: 0; height: 0; }
.vssl-inp input::-webkit-credentials-auto-fill-button,
.vssl-inp input::-webkit-strong-password-auto-fill-button { visibility: hidden; display: none !important; pointer-events: none; height: 0; width: 0; margin: 0; }
