/* ============================================
   Login Page - Ocean Night Premium Theme
   โรงแรมชานชเล - Hotel Management System
   ============================================ */

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

:root {
  --ocean-deep: #0a1628;
  --ocean-mid: #0d2137;
  --ocean-light: #13304d;
  --ocean-surface: rgba(255, 255, 255, 0.05);
  --ocean-glass: rgba(13, 33, 55, 0.6);
  --ocean-glass-border: rgba(255, 255, 255, 0.1);
  --ocean-text: #e8f0f8;
  --ocean-text-sec: #7ea8c9;
  --ocean-text-muted: #4a7a9d;
  --ocean-blue: #38bdf8;
  --ocean-cyan: #22d3ee;
  --ocean-gold: #fbbf24;
  --ocean-rose: #fb7185;
  --ocean-green: #34d399;
  --radius: 20px;
  --radius-sm: 12px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Prompt', sans-serif;
  height: 100vh;
  overflow: hidden;
  background: var(--ocean-deep);
  color: var(--ocean-text);
}

/* ===== OCEAN BACKGROUND ===== */
.ocean-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Sky gradient */
.ocean-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #050d1a 0%,
    #0a1a30 25%,
    #0d2847 50%,
    #1a3a5c 70%,
    #1e4a6e 85%,
    #1a3a5c 100%
  );
}

/* Moon */
.moon {
  position: absolute;
  top: 8%;
  right: 15%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef3c7, #fde68a 40%, #fbbf24 70%, transparent 100%);
  box-shadow: 
    0 0 40px rgba(251, 191, 36, 0.3),
    0 0 80px rgba(251, 191, 36, 0.15),
    0 0 120px rgba(251, 191, 36, 0.08);
  animation: moonGlow 6s ease-in-out infinite alternate;
}

.moon::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  box-shadow:
    25px 10px 0 5px rgba(245, 158, 11, 0.15),
    -5px 25px 0 3px rgba(245, 158, 11, 0.1);
}

@keyframes moonGlow {
  0% { box-shadow: 0 0 40px rgba(251, 191, 36, 0.3), 0 0 80px rgba(251, 191, 36, 0.15); }
  100% { box-shadow: 0 0 60px rgba(251, 191, 36, 0.4), 0 0 120px rgba(251, 191, 36, 0.2); }
}

/* Moon reflection on water */
.moon-reflection {
  position: absolute;
  bottom: 12%;
  right: 14%;
  width: 4px;
  height: 80px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.4), transparent);
  filter: blur(3px);
  animation: reflectionShimmer 3s ease-in-out infinite;
}

@keyframes reflectionShimmer {
  0%, 100% { opacity: 0.6; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* Stars */
.stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: starTwinkle ease-in-out infinite alternate;
}

.star:nth-child(1) { top: 5%; left: 10%; animation-duration: 3s; width: 3px; height: 3px; }
.star:nth-child(2) { top: 12%; left: 30%; animation-duration: 4s; animation-delay: 0.5s; }
.star:nth-child(3) { top: 8%; left: 55%; animation-duration: 3.5s; animation-delay: 1s; width: 2.5px; height: 2.5px; }
.star:nth-child(4) { top: 15%; left: 75%; animation-duration: 5s; }
.star:nth-child(5) { top: 3%; left: 45%; animation-duration: 4.5s; animation-delay: 1.5s; }
.star:nth-child(6) { top: 18%; left: 85%; animation-duration: 3s; animation-delay: 2s; width: 3px; height: 3px; }
.star:nth-child(7) { top: 7%; left: 65%; animation-duration: 4s; animation-delay: 0.8s; }
.star:nth-child(8) { top: 22%; left: 20%; animation-duration: 5.5s; animation-delay: 1.2s; }
.star:nth-child(9) { top: 10%; left: 92%; animation-duration: 3.2s; animation-delay: 2.5s; width: 2.5px; height: 2.5px; }
.star:nth-child(10) { top: 25%; left: 5%; animation-duration: 4.8s; animation-delay: 0.3s; }
.star:nth-child(11) { top: 2%; left: 80%; animation-duration: 3.7s; animation-delay: 1.8s; }
.star:nth-child(12) { top: 20%; left: 50%; animation-duration: 6s; animation-delay: 0.6s; width: 3px; height: 3px; }

@keyframes starTwinkle {
  0% { opacity: 0.2; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.4); }
}

/* Ocean water */
.ocean-water {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 35%;
  background: linear-gradient(180deg, 
    rgba(13, 40, 71, 0.6) 0%, 
    rgba(10, 22, 40, 0.9) 100%
  );
}

/* Waves */
.wave {
  position: absolute;
  left: -5%;
  width: 110%;
  height: 60px;
  background-repeat: repeat-x;
  background-size: 600px 60px;
}

.wave--1 {
  bottom: 28%;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 60'%3E%3Cpath d='M0,30 Q75,0 150,30 T300,30 T450,30 T600,30 V60 H0 Z' fill='%2338bdf8'/%3E%3C/svg%3E");
  animation: waveMove 12s linear infinite;
}

.wave--2 {
  bottom: 26%;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 60'%3E%3Cpath d='M0,30 Q75,0 150,30 T300,30 T450,30 T600,30 V60 H0 Z' fill='%2322d3ee'/%3E%3C/svg%3E");
  animation: waveMove 16s linear infinite reverse;
}

.wave--3 {
  bottom: 24%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 60'%3E%3Cpath d='M0,30 Q75,0 150,30 T300,30 T450,30 T600,30 V60 H0 Z' fill='%2338bdf8'/%3E%3C/svg%3E");
  animation: waveMove 20s linear infinite;
}

@keyframes waveMove {
  0% { background-position-x: 0; }
  100% { background-position-x: 600px; }
}

/* Boat */
.boat-wrap {
  position: absolute;
  bottom: 30%;
  animation: boatDrift 40s linear infinite;
}

.boat-wrap svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  animation: boatRock 4s ease-in-out infinite;
}

@keyframes boatDrift {
  0% { left: -8%; }
  100% { left: 108%; }
}

@keyframes boatRock {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-4px); }
}

/* ===== LOGIN LAYOUT ===== */
.login-layout {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ===== LOGIN CARD ===== */
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--ocean-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--ocean-glass-border);
  border-radius: var(--radius);
  padding: 2.5rem 2.25rem;
  position: relative;
  overflow: hidden;
  animation: cardReveal 1s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.3s;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ocean-blue), var(--ocean-cyan), var(--ocean-gold));
}

/* Subtle shimmer effect on card */
.login-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, transparent 30%, rgba(56, 189, 248, 0.02) 50%, transparent 70%);
  animation: cardShimmer 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cardReveal {
  0% { opacity: 0; transform: translateY(40px) scale(0.95); }
  60% { opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}

@keyframes cardShimmer {
  0%, 100% { transform: translate(-10%, -10%) rotate(0deg); }
  50% { transform: translate(10%, 10%) rotate(180deg); }
}

/* ===== LOGO ===== */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  animation: logoFade 0.8s ease both;
  animation-delay: 0.6s;
}

.logo__icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--ocean-blue), var(--ocean-cyan));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
  animation: iconFloat 6s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.logo__text {
  font-family: 'Sriracha', cursive;
  font-size: 1.9rem;
  background: linear-gradient(135deg, var(--ocean-text), var(--ocean-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes logoFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 2rem;
  animation: headerFade 0.8s ease both;
  animation-delay: 0.8s;
}

.header__greeting {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  position: relative;
  display: inline-block;
}

.header__greeting::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ocean-gold), transparent);
  border-radius: 2px;
}

.header__subtitle {
  font-size: 0.88rem;
  color: var(--ocean-text-sec);
  margin-top: 0.75rem;
}

.header__clock {
  font-size: 0.8rem;
  color: var(--ocean-text-muted);
  margin-top: 0.4rem;
}

@keyframes headerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== ALERTS ===== */
.alert-box {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.alert-box.show { display: flex; }

.alert-box--error {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.2);
  color: var(--ocean-rose);
  animation: alertShake 0.5s ease;
}

.alert-box--warn {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--ocean-gold);
}

@keyframes alertShake {
  0%, 100% { transform: translateX(0); }
  15%, 55%, 85% { transform: translateX(-5px); }
  35%, 75% { transform: translateX(5px); }
}

/* ===== FORM ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: formFade 0.8s ease both;
  animation-delay: 1s;
}

@keyframes formFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating label input */
.field {
  position: relative;
}

.field__input {
  width: 100%;
  padding: 1rem 1rem 1rem 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--ocean-text);
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.field__input::placeholder {
  color: transparent;
}

.field__label {
  position: absolute;
  left: 2.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--ocean-text-muted);
  pointer-events: none;
  transition: var(--transition);
  background: transparent;
  padding: 0 0.25rem;
}

.field__icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ocean-text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 1;
}

.field__toggle {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ocean-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem;
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 1;
}

.field__toggle:hover { color: var(--ocean-blue); }

/* Focus & filled states */
.field__input:focus,
.field__input:not(:placeholder-shown) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ocean-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.field__input:focus ~ .field__label,
.field__input:not(:placeholder-shown) ~ .field__label {
  top: -1px;
  transform: translateY(-100%);
  font-size: 0.72rem;
  color: var(--ocean-blue);
  background: var(--ocean-glass);
  padding: 0 0.4rem;
  border-radius: 4px;
}

.field__input:focus ~ .field__icon {
  color: var(--ocean-blue);
}

/* ===== BUTTON ===== */
.btn-login {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--ocean-blue), #0ea5e9);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.35);
}

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

.btn-login:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Ripple effect */
.btn-login .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Spinner */
.btn-login .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-login.is-loading .spinner { display: block; }
.btn-login.is-loading .btn-label { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  animation: formFade 0.8s ease both;
  animation-delay: 1.2s;
}

.footer__text {
  font-size: 0.75rem;
  color: var(--ocean-text-muted);
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  color: var(--ocean-text-sec);
  cursor: pointer;
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  animation: logoFade 0.8s ease both;
  animation-delay: 1.5s;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.14);
  color: var(--ocean-text);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .login-card { padding: 2rem 1.5rem; border-radius: 16px; }
  .logo__text { font-size: 1.6rem; }
  .header__greeting { font-size: 1.25rem; }
  .moon { width: 60px; height: 60px; top: 5%; right: 10%; }
  .boat-wrap { display: none; }
}

/* ===== SWAL DARK ===== */
.swal2-popup { background: #0d2137 !important; color: #e8f0f8 !important; border: 1px solid rgba(255,255,255,0.08) !important; border-radius: 16px !important; }
.swal2-title { color: #e8f0f8 !important; }
.swal2-html-container { color: #7ea8c9 !important; }
.swal2-confirm { background: linear-gradient(135deg, #38bdf8, #0ea5e9) !important; border-radius: 8px !important; }
