:root {
  --ink: #e2e8f0;
  --muted: rgba(148, 163, 184, 0.85);
  --font: "Figtree", "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: #030712;
}

.login-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2.5rem 1rem;
  background-color: #030712;
  background-image:
    radial-gradient(ellipse 90% 70% at 20% 0%, rgba(20, 184, 166, 0.20), transparent 50%),
    radial-gradient(ellipse 80% 60% at 80% 100%, rgba(6, 182, 212, 0.15), transparent 45%),
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(99, 102, 241, 0.06), transparent 55%),
    linear-gradient(165deg, #030712 0%, #0f172a 40%, #0c4a6e 100%);
}

.login-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 15%, transparent 70%);
}

@keyframes float-orb-1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33% { transform: translate(30px, -20px) scale(1.1); opacity: 0.8; }
  66% { transform: translate(-15px, 15px) scale(0.95); opacity: 0.5; }
}
@keyframes float-orb-2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  40% { transform: translate(-25px, 25px) scale(1.08); opacity: 0.7; }
  70% { transform: translate(20px, -10px) scale(0.92); opacity: 0.4; }
}
@keyframes float-orb-3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(15px, -30px) scale(1.15); opacity: 0.6; }
}
@keyframes shimmer-line {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(24px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.orb {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
}
.orb-1 {
  left: -10rem;
  top: 15%;
  width: 340px;
  height: 340px;
  background: rgba(20, 184, 166, 0.08);
  animation: float-orb-1 8s ease-in-out infinite;
}
.orb-2 {
  right: -8rem;
  bottom: 20%;
  width: 280px;
  height: 280px;
  background: rgba(6, 182, 212, 0.08);
  animation: float-orb-2 10s ease-in-out infinite;
}
.orb-3 {
  left: 40%;
  top: 60%;
  width: 200px;
  height: 200px;
  background: rgba(99, 102, 241, 0.05);
  filter: blur(60px);
  animation: float-orb-3 12s ease-in-out infinite;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.particle-1 { width: 3px; height: 3px; background: rgba(20,184,166,.6); top: 15%; left: 8%; animation: pulse-glow 3s ease-in-out infinite; }
.particle-2 { width: 2px; height: 2px; background: rgba(6,182,212,.5); top: 70%; right: 12%; animation: pulse-glow 4s ease-in-out infinite 1s; }
.particle-3 { width: 4px; height: 4px; background: rgba(99,102,241,.4); bottom: 20%; left: 15%; animation: pulse-glow 5s ease-in-out infinite .5s; }
.particle-4 { width: 2px; height: 2px; background: rgba(20,184,166,.5); top: 35%; right: 20%; animation: pulse-glow 3.5s ease-in-out infinite 1.5s; }
.particle-5 { width: 3px; height: 3px; background: rgba(6,182,212,.4); bottom: 35%; left: 25%; animation: pulse-glow 4.5s ease-in-out infinite 2s; }

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 2rem 2rem 2.15rem;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 32px 64px -16px rgba(0, 0, 0, 0.6),
    0 0 100px -30px rgba(20, 184, 166, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: fade-in-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.5), rgba(6, 182, 212, 0.5), transparent);
}

.login-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
  animation: shimmer-line 6s ease-in-out infinite;
  pointer-events: none;
}

.login-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 1.75rem;
}

.logo-wrap { display: inline-block; text-decoration: none; }

.logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(6, 182, 212, 0.2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
  transition: box-shadow 0.25s ease;
}

.logo-wrap:hover .logo-ring {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 10px 30px rgba(20, 184, 166, 0.12);
}

.logo-ring img {
  width: 2.75rem;
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 1rem 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(45, 212, 191, 0.8);
}

.login-header h1 {
  margin: 0.55rem 0 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.95);
}

.sub {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.8);
}

.login-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.15rem;
}

.field {
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(203, 213, 225, 0.9);
}

.input-wrap {
  position: relative;
}

.input-wrap .ico {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  padding-left: 0.9rem;
  color: #64748b;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
  color: #e2e8f0;
  padding: 0.8rem 1rem 0.8rem 2.6rem;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrap input::placeholder { color: rgba(148, 163, 184, 0.5); }

.input-wrap input:focus {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(20, 184, 166, 0.5);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12), 0 0 20px -5px rgba(20, 184, 166, 0.15);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.9);
  user-select: none;
  cursor: pointer;
}

.remember input {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  accent-color: #0d9488;
  cursor: pointer;
}

.login-btn {
  position: relative;
  overflow: hidden;
  margin-top: 0.15rem;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #0284c7 100%);
  box-shadow:
    0 4px 16px rgba(13, 148, 136, 0.4),
    0 0 40px -10px rgba(13, 148, 136, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 8px 24px rgba(13, 148, 136, 0.5),
    0 0 60px -10px rgba(13, 148, 136, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-btn:hover::before { left: 100%; }

.login-btn:active {
  transform: translateY(0) scale(0.985);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.login-error {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.login-footer {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(100, 116, 139, 0.6);
  animation: fade-in-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@media (min-width: 640px) {
  .login-card { padding: 2.5rem; }
}
