/* ==========================================================================
   PREMIUM LIGHT & DYNAMIC LOGIN DESIGN - SYSTEM SAV COOP
   Tech Balance Co., Ltd.
   Bright Crystal Glassmorphism & Aurora Ambient Motion Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Kanit:wght@300;400;500;600&display=swap');

:root {
  --font-main: 'Prompt', 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Bright Modern Palette */
  --bg-base: #f1f5f9;
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #0284c7 100%);

  --card-bg: rgba(255, 255, 255, 0.82);
  --card-border: rgba(255, 255, 255, 0.95);
  --card-shadow: 0 25px 70px -15px rgba(37, 99, 235, 0.14),
    0 10px 30px -5px rgba(15, 23, 42, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.85);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --input-bg: rgba(255, 255, 255, 0.92);
  --input-border: #cbd5e1;
  --input-focus-border: #2563eb;
  --input-focus-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);

  --radius-card: 28px;
  --radius-input: 16px;
  --radius-btn: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.login-body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dedicated Centering Wrapper เพื่อให้การ์ดอยู่ตรงกลาง 100% ทั้งแนวตั้งและแนวนอน */
.login-page-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  box-sizing: border-box;
}

/* ==========================================================================
   DYNAMIC AURORA BACKGROUND & LIQUID BLOBS
   ========================================================================== */
.bg-ambient-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 10% 15%, rgba(219, 234, 254, 0.8) 0%, transparent 50%),
    radial-gradient(circle at 90% 85%, rgba(224, 231, 255, 0.8) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #f8fafc 0%, #edf2f7 100%);
}

/* Morphing Aurora Blobs with Vibrant Light Colors */
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.75;
  will-change: transform, border-radius;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #60a5fa 0%, #93c5fd 40%, rgba(147, 197, 253, 0) 70%);
  top: -120px;
  left: -80px;
  animation: floatMorph1 16s ease-in-out infinite alternate;
}

.orb-2 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #38bdf8 0%, #a5f3fc 45%, rgba(165, 243, 252, 0) 70%);
  bottom: -150px;
  right: -100px;
  animation: floatMorph2 20s ease-in-out infinite alternate;
}

.orb-3 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #818cf8 0%, #c7d2fe 45%, rgba(199, 210, 254, 0) 70%);
  top: 35%;
  right: 18%;
  opacity: 0.6;
  animation: floatMorph3 14s ease-in-out infinite alternate;
}

.orb-4 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #34d399 0%, #a7f3d0 40%, rgba(167, 243, 208, 0) 70%);
  bottom: 10%;
  left: 10%;
  opacity: 0.45;
  animation: floatMorph1 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatMorph1 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }

  50% {
    transform: translate(60px, 45px) scale(1.12) rotate(90deg);
    border-radius: 40% 60% 60% 40% / 40% 60% 40% 60%;
  }

  100% {
    transform: translate(-40px, -50px) scale(0.92) rotate(180deg);
    border-radius: 50% 60% 30% 60% / 60% 40% 60% 30%;
  }
}

@keyframes floatMorph2 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 40% 60% 70% 30% / 50% 60% 30% 60%;
  }

  50% {
    transform: translate(-70px, -50px) scale(1.08) rotate(-120deg);
    border-radius: 60% 40% 30% 70% / 70% 30% 50% 40%;
  }

  100% {
    transform: translate(50px, 40px) scale(0.95) rotate(-240deg);
    border-radius: 35% 65% 55% 45% / 45% 55% 65% 35%;
  }
}

@keyframes floatMorph3 {
  0% {
    transform: translate(0, 0) scale(1);
    border-radius: 50% 50% 40% 60% / 40% 50% 60% 50%;
  }

  50% {
    transform: translate(35px, -40px) scale(1.15);
    border-radius: 60% 40% 60% 40% / 50% 60% 40% 50%;
  }

  100% {
    transform: translate(-30px, 35px) scale(0.95);
    border-radius: 40% 60% 50% 50% / 60% 40% 50% 60%;
  }
}

/* ==========================================================================
   DYNAMIC FLUID SILK WAVES (3 Layers of Gentle Flowing Waves)
   ========================================================================== */
.ambient-waves-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 380px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.ambient-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  will-change: transform;
}

.wave-1 {
  animation: waveMotion1 18s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
  opacity: 0.85;
}

.wave-2 {
  animation: waveMotion2 23s cubic-bezier(0.36, 0.45, 0.63, 0.53) -4s infinite;
  opacity: 0.75;
}

.wave-3 {
  animation: waveMotion3 28s cubic-bezier(0.36, 0.45, 0.63, 0.53) -8s infinite;
  opacity: 0.6;
}

@keyframes waveMotion1 {
  0% {
    transform: translateX(0) scaleY(1);
  }

  50% {
    transform: translateX(-25%) scaleY(1.08);
  }

  100% {
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes waveMotion2 {
  0% {
    transform: translateX(-50%) scaleY(1.05);
  }

  50% {
    transform: translateX(-20%) scaleY(0.92);
  }

  100% {
    transform: translateX(0) scaleY(1.05);
  }
}

@keyframes waveMotion3 {
  0% {
    transform: translateX(0) scaleY(0.95);
  }

  50% {
    transform: translateX(6%) scaleY(1.1);
  }

  100% {
    transform: translateX(-7%) scaleY(1.02);
  }
}

/* ==========================================================================
   AMBIENT LIGHT BEAMS
   ========================================================================== */
.ambient-light-beams {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.light-beam {
  position: absolute;
  width: 320px;
  height: 140vh;
  transform: rotate(-35deg);
  filter: blur(45px);
  pointer-events: none;
  will-change: transform, opacity;
}

.beam-1 {
  top: -30%;
  left: 5%;
  background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.18) 50%, transparent 100%);
  animation: beamDrift1 20s ease-in-out infinite alternate;
}

.beam-2 {
  bottom: -30%;
  right: 5%;
  background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.14) 50%, transparent 100%);
  animation: beamDrift2 25s ease-in-out infinite alternate;
}

@keyframes beamDrift1 {
  0% {
    transform: rotate(-35deg) translate(0, 0);
    opacity: 0.5;
  }

  50% {
    transform: rotate(-32deg) translate(40px, 30px);
    opacity: 0.85;
  }

  100% {
    transform: rotate(-38deg) translate(-30px, -20px);
    opacity: 0.5;
  }
}

@keyframes beamDrift2 {
  0% {
    transform: rotate(-35deg) translate(0, 0);
    opacity: 0.45;
  }

  50% {
    transform: rotate(-38deg) translate(-50px, -30px);
    opacity: 0.8;
  }

  100% {
    transform: rotate(-32deg) translate(30px, 25px);
    opacity: 0.45;
  }
}

/* ==========================================================================
   ELEGANT FOUR-POINT STAR SPARKLES (FinTech Crystal Ambient Aura)
   ========================================================================== */
.ambient-sparkles {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

/* Random Sparkles via JavaScript (นุ่มนวล อ่อนช้อย สไตล์ FinTech Crystal ตามแบบ cult_coop) */
.random-sparkle {
  position: absolute;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  animation: sparklePopBloom 5.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform, opacity;
  z-index: 5;
}

.random-sparkle svg {
  width: 100%;
  height: 100%;
}

@keyframes sparklePopBloom {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }

  25% {
    transform: translate(-50%, -50%) scale(1.12) rotate(25deg);
    opacity: 0.85;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.0) rotate(45deg);
    opacity: 0.8;
  }

  75% {
    transform: translate(-50%, -50%) scale(0.92) rotate(65deg);
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) scale(0) rotate(90deg);
    opacity: 0;
  }
}

/* Subtle Modern Grid Overlay */
.bg-grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  z-index: 1;
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
}

/* ==========================================================================
   MAIN LOGIN CARD & ENTRANCE ANIMATION
   ========================================================================== */
.login-container-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(35px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Crystal Glass Card Container */
.premium-login-card {
  background: var(--card-bg);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-radius: var(--radius-card);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 42px 38px 36px 38px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

/* นุ่มนวลด้วยการแอนิเมชัน opacity บน pseudo-element แทนการแอนิเมชัน box-shadow โดยตรง เพื่อป้องกัน Repaint/Flickering บน GPU */
.premium-login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  box-shadow: 0 35px 85px -10px rgba(37, 99, 235, 0.22),
    0 15px 35px -5px rgba(15, 23, 42, 0.08);
  opacity: 0;
  pointer-events: none;
  animation: cardGlowPulse 8s ease-in-out infinite alternate;
}

@keyframes cardGlowPulse {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.premium-login-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 85px -12px rgba(37, 99, 235, 0.22),
    0 14px 35px -6px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.95);
}

/* Prismatic Edge Accent */
.premium-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8 0%, #6366f1 35%, #3b82f6 70%, #10b981 100%);
  opacity: 0.95;
}

/* ==========================================================================
   HEADER & LOGO WITH LEVITATION & HALO RIPPLE
   ========================================================================== */
.card-header-section {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

.coop-logo-wrapper {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoLevitate 6s ease-in-out infinite alternate;
}

@keyframes logoLevitate {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-7px);
  }
}

/* Multi-Layer Ripple Halo Rings */
.logo-ripple-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  animation: haloRipple 3.6s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.logo-ripple-ring:nth-child(2) {
  animation-delay: -1.8s;
  border-color: rgba(99, 102, 241, 0.35);
}

@keyframes haloRipple {
  0% {
    width: 90px;
    height: 90px;
    opacity: 0.9;
    transform: scale(0.95);
  }

  100% {
    width: 155px;
    height: 155px;
    opacity: 0;
    transform: scale(1.4);
  }
}

.logo-glow-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.5) 0%, rgba(99, 102, 241, 0.45) 50%, rgba(52, 211, 153, 0.4) 100%);
  filter: blur(10px);
  opacity: 0.75;
  animation: glowPulse 4s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% {
    opacity: 0.5;
    transform: scale(0.96);
  }

  100% {
    opacity: 0.95;
    transform: scale(1.05);
  }
}

.coop-logo-frame {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.22),
    0 0 0 2px rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.coop-logo-frame:hover {
  transform: scale(1.04);
}

.coop-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.system-main-title {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  line-height: 1.35;
}

/* Cooperative Name Badge */
.coop-name-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.85);
  border-radius: 20px;
  padding: 6px 14px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
  max-width: 100%;
  transition: all 0.25s ease;
}

.coop-name-box:hover {
  background: #ffffff;
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.coop-name-box i {
  color: var(--primary-color);
  font-size: 13px;
  flex-shrink: 0;
}

.coop-name-text {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   FORM INPUTS & LABELS
   ========================================================================== */
.form-group-custom {
  margin-bottom: 20px;
  position: relative;
}

.form-label-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.input-icon-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.input-leading-icon {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: var(--text-light) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  margin: 0 !important;
  pointer-events: none !important;
  transition: color 0.25s ease, transform 0.25s ease !important;
  z-index: 2 !important;
}

/* ป้องกัน Bootstrap 2.3.2 input[type="text"] / input[type="password"] ที่กำหนด height: 20px, margin-bottom: 10px ทับสไตล์ */
.login-container-wrapper input.premium-input,
.login-container-wrapper input[type="text"].premium-input,
.login-container-wrapper input[type="password"].premium-input,
.input-icon-wrapper input.premium-input,
input.premium-input,
.premium-input {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 10px 16px 10px 44px !important;
  margin: 0 !important;
  margin-bottom: 0 !important;
  font-family: var(--font-main) !important;
  font-size: 14px !important;
  line-height: normal !important;
  color: var(--text-main) !important;
  background: var(--input-bg) !important;
  border: 1.5px solid var(--input-border) !important;
  border-radius: var(--radius-input) !important;
  outline: none !important;
  vertical-align: middle !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

.login-container-wrapper input.premium-input::placeholder,
.login-container-wrapper input[type="text"].premium-input::placeholder,
.login-container-wrapper input[type="password"].premium-input::placeholder,
.premium-input::placeholder {
  color: #94a3b8 !important;
  font-size: 13px !important;
  line-height: normal !important;
}

.login-container-wrapper input.premium-input:focus,
.login-container-wrapper input[type="text"].premium-input:focus,
.login-container-wrapper input[type="password"].premium-input:focus,
input.premium-input:focus,
.premium-input:focus {
  background: #ffffff !important;
  border-color: var(--input-focus-border) !important;
  box-shadow: var(--input-focus-shadow), 0 4px 12px rgba(37, 99, 235, 0.08) !important;
  outline: none !important;
}

.input-icon-wrapper:focus-within .input-leading-icon {
  color: var(--primary-color) !important;
  transform: translateY(-50%) scale(1.1) !important;
}

/* Toggle Password Visibility Button */
.btn-toggle-password {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  padding: 6px 8px !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 3 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.btn-toggle-password:hover {
  color: var(--primary-color) !important;
  background: rgba(241, 245, 249, 0.9) !important;
}

.btn-toggle-password:focus {
  outline: none !important;
}

/* Dynamic Inline Warning Toast (Thai/Special Character Notice ตามมาตรฐาน cult_coop) */
.input-warning-msg {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #dc2626;
  font-weight: 500;
  margin-top: 6px;
  padding: 6px 12px;
  background: #fef2f2;
  border-radius: 10px;
  border: 1px solid #fee2e2;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.06);
  animation: warningShake 0.4s ease forwards;
}

@keyframes warningShake {
  0% {
    transform: translateY(-4px) scale(0.97);
    opacity: 0;
  }

  50% {
    transform: translateY(0) scale(1.02);
    opacity: 1;
  }

  75% {
    transform: translateX(-4px);
  }

  90% {
    transform: translateX(4deg);
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   SUBMIT BUTTON WITH SHIMMER GRADIENT
   ========================================================================== */
button.btn-submit-premium,
.btn-submit-premium {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  background: var(--primary-gradient) !important;
  border: none !important;
  border-radius: var(--radius-btn) !important;
  color: #ffffff !important;
  font-family: var(--font-main) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  cursor: pointer !important;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.38),
    0 4px 10px -2px rgba(37, 99, 235, 0.2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin: 0 !important;
  margin-top: 10px !important;
  padding: 0 !important;
}

/* Shimmer Light Reflection Wave */
.btn-submit-premium::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(60deg,
      transparent 0%,
      rgba(255, 255, 255, 0.32) 50%,
      transparent 100%);
  transform: rotate(25deg);
  animation: shimmerSweep 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shimmerSweep {
  0% {
    left: -70%;
  }

  30% {
    left: 130%;
  }

  100% {
    left: 130%;
  }
}

.btn-submit-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(37, 99, 235, 0.5),
    0 6px 14px -2px rgba(37, 99, 235, 0.25);
  filter: brightness(1.05);
}

.btn-submit-premium:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.4);
}

.btn-submit-premium:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   ALERTS & FEEDBACK
   ========================================================================== */
.premium-alert {
  display: none;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  margin-bottom: 20px;
  align-items: center;
  gap: 10px;
  animation: alertFadeIn 0.3s ease forwards;
}

.premium-alert:empty,
#box_alert_login:empty {
  display: none !important;
}

@keyframes alertFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.premium-alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ==========================================================================
   FOOTER COPYRIGHT & CORPORATE BRANDING
   ========================================================================== */
.card-footer-info {
  margin-top: 26px;
  text-align: center;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  padding-top: 18px;
}

.company-branding {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
}

.company-branding strong {
  color: #334155;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE GPU ANTI-FLICKER (Tablets & Mobile Phones)
   ========================================================================== */
@media (max-width: 768px) {
  body.login-body {
    padding: 16px 12px;
  }

  .login-page-wrapper {
    padding: 16px 10px;
  }

  /* ป้องกันการกระพริบ (Flicker) บน Android / WebKit WebView */
  .premium-login-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    box-shadow: 0 15px 40px -10px rgba(37, 99, 235, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.95) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    transform: translate3d(0, 0, 0) !important;
    padding: 32px 22px 26px 22px;
    border-radius: 22px;
  }

  /* ปิด glow pulse pseudo-element บนมือถือ */
  .premium-login-card::after {
    display: none !important;
    animation: none !important;
  }

  /* ปรับแต่ง Ambient Orbs บนจอมือถือ ป้องกัน GPU Overload / Flickering */
  .ambient-orb {
    filter: blur(35px) !important;
    animation: none !important;
    opacity: 0.55 !important;
    will-change: auto !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    transform: translate3d(0, 0, 0) !important;
  }

  .orb-1 {
    width: 280px !important;
    height: 280px !important;
    top: -60px !important;
    left: -40px !important;
  }

  .orb-2 {
    width: 300px !important;
    height: 300px !important;
    bottom: -80px !important;
    right: -50px !important;
  }

  .orb-3,
  .orb-4 {
    display: none !important;
  }

  /* ปิดแอนิเมชันคลื่น SVG บนมือถือเพื่อป้องกันการกระตุกและเฟรมเรตร่วง */
  .ambient-wave {
    animation: none !important;
  }

  .ambient-waves-container {
    height: 200px;
  }

  .ambient-light-beams,
  .ambient-sparkles {
    display: none !important;
  }

  /* ปิด ripple ring ขยายขนาดบนโลโก้สำหรับมือถือ ป้องกันภาพสั่นไหว */
  .logo-ripple-ring {
    animation: none !important;
    display: none !important;
  }

  .coop-logo-wrapper {
    animation: none !important;
    width: 88px;
    height: 88px;
    margin-bottom: 16px;
  }

  .coop-logo-frame {
    width: 80px;
    height: 80px;
  }

  .logo-glow-ring {
    animation: none !important;
    opacity: 0.6 !important;
  }

  .system-main-title {
    font-size: 18px;
  }

  .premium-input {
    height: 46px;
    font-size: 13.5px;
  }

  .btn-submit-premium {
    height: 46px;
    font-size: 14.5px;
  }
}

/* รองรับโหมดประหยัดพลังงานและการลดแอนิเมชันของระบบปฏิบัติการ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}