/* Custom Font */
@font-face {
  font-family: 'Space Habitat';
  src: url('../../assets/font/DFVN MBF Space Habitat Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root { 
  --login-bg: #0f0a1f; 
  --login-panel: #1b1233; 
  --login-input: #281b4f; 
  --login-text: #e5e7eb; 
  --login-muted: #a3a3a3; 
  --login-primary: #7c3aed; 
  --login-primary-2: #22d3ee; 
}

/* Video Background */
.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 1;
  transition: opacity 1.5s ease-in-out;
  pointer-events: none;
}

/* Override global styles để trang này không bị ảnh hưởng */
.page-forgot * {
  margin: 0;
}

.page-forgot section {
  padding: 0 !important;
  background-color: transparent !important;
}

/* Image Background (acts like video background) */
.image-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 1;
  transition: opacity 1.5s ease-in-out, transform 16s ease-in-out;
  transform: scale(1.02);
  animation: kenburnsBg 16s ease-in-out infinite alternate;
}

html, body {
  background: transparent !important;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Ngăn cuộn trên desktop */
  height: 100vh;
  width: 100vw;
}

body { 
  background: transparent !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Remove global scrim to avoid any light wash */
  background: transparent;
  z-index: 0;
  pointer-events: none;
}

h1, h2, h3 {
  font-family: 'Space Habitat', sans-serif;
}

.auth-split { 
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed; /* Fixed để chiếm toàn bộ viewport */
  top: 0;
  left: 0;
  z-index: 1;
  overflow: hidden; /* Ngăn cuộn */
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

/* Không cần các style cho auth-left và auth-right nữa vì đã xóa khỏi HTML */

/* Ensure the grid wrapper has no background */
.auth-split {
  background: transparent !important;
}

.auth-card { 
  width: 100%; 
  max-width: 460px; 
  margin-inline: auto;
  color: var(--login-text);
  position: relative;
  /* Dark translucent glass that matches video palette */
  background: linear-gradient(180deg, rgba(10,7,22,0.38), rgba(10,7,22,0.28));
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
  /* Milky white border around the card */
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  padding: 28px 28px 24px; /* Giảm padding để vừa viewport */
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(124, 58, 237, 0.14),
    0 0 36px rgba(34, 211, 238, 0.10);
  max-height: 90vh; /* Giới hạn chiều cao */
  overflow-y: auto; /* Cho phép cuộn nội dung card nếu cần trên màn hình nhỏ */
}

/* Subtle gradient gloss inside the glass card */
/* Subtle colored glow to harmonize with galaxy video (no white) */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  background:
    radial-gradient(600px 320px at 18% 0%, rgba(124, 58, 237, 0.12), transparent 62%),
    radial-gradient(520px 300px at 100% 85%, rgba(34, 211, 238, 0.10), transparent 62%);
}

/* Subtle inner highlight for extra definition */
.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Multi-step inline transition (Forgot -> Verify) */
.auth-card--forgot,
.auth-card--verify {
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
  position: absolute; /* Absolute để cả 2 card nằm cùng vị trí, chồng lên nhau */
}

.auth-card--verify {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  filter: blur(2px);
  pointer-events: none;
}

body.is-verify .auth-card--forgot {
  opacity: 0;
  transform: scale(0.985);
  filter: blur(2px);
  pointer-events: none;
}

body.is-verify .auth-card--verify {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
}

/* Verify code inputs */
.code-group {
  display: grid;
  grid-template-columns: repeat(6, 48px);
  gap: 10px;
  justify-content: center;
  /* Center the entire group within the form column */
  margin: 16px auto 8px;
}

.code-input {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: rgba(10, 7, 22, 0.22);
  color: #fff;
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.code-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.6);
  transform: translateY(-1px);
}

@media (max-width: 420px) {
  .code-group {
    grid-template-columns: repeat(6, 42px);
    gap: 8px;
  }
  .code-input {
    width: 42px;
    height: 50px;
  }
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: .6rem; 
  color: var(--login-text); 
  text-decoration: none; 
  margin-bottom: 24px; 
}

.brand img { 
  width: 28px; 
  height: 28px; 
}

/* Back to Home Button */
.back-home {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  left: calc(20px + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* No extra override needed now that it is placed outside the card */

.back-home:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(34, 211, 238, 0.2) 100%);
  border-color: #7c3aed;
  transform: translateX(-5px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

.back-home i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.back-home:hover i {
  transform: translateX(-3px);
}

.auth-title { 
  margin: 0 0 8px; 
  font-size: clamp(2rem, 1.5rem + 1.5vw, 2.4rem); 
  font-weight: 800; 
  color: #fff; 
}

.auth-subtitle { 
  color: var(--login-muted); 
  margin-bottom: 18px; 
}

.form-row { 
  margin-bottom: 20px; 
}

.form-label { 
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px; 
  color: var(--login-text); 
  font-weight: 600;
  font-size: 0.95rem;
}

.form-label i {
  color: var(--login-primary);
  font-size: 1rem;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

/* Emphasize the email input block */
#row-email .input-wrapper {
  /* Dark translucent glass to avoid any white tint */
  background: rgba(10, 7, 22, 0.18);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 32px;
  box-shadow:
    0 12px 28px rgba(124, 58, 237, 0.18),
    0 4px 14px rgba(34, 211, 238, 0.16);
}

#row-email .input-wrapper:focus-within {
  border-color: transparent;
  box-shadow:
    0 0 0 2px rgba(124, 58, 237, 0.75),
    0 12px 32px rgba(124, 58, 237, 0.4),
    0 4px 18px rgba(34, 211, 238, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.18);
}

#row-email .form-input {
  background: transparent;
  border: none;
}

#row-email .form-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  transition: all 0.3s ease;
  pointer-events: none;
}

.input-wrapper:focus-within .input-icon {
  background: linear-gradient(135deg, #7c3aed 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: translateY(-50%) scale(1.15);
  filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.6));
}

.form-input { 
  width: 100%; 
  padding: 14px 14px 14px 48px;
  background: transparent !important;
  border: none !important;
  border-radius: 28px; 
  color: var(--login-text); 
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: none !important;
  position: relative;
}

.form-input::placeholder { 
  color: rgba(255, 255, 255, 0.4); 
}

.form-input:focus { 
  outline: none; 
  background: transparent !important;
  box-shadow: none !important;
  transform: translateY(-2px);
}

.form-actions { 
  margin-top: 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.btn-primary { 
  width: 100%; 
  padding: 14px 16px; 
  background: linear-gradient(90deg, var(--login-primary), var(--login-primary-2)); 
  color: #fff; 
  border: none; 
  border-radius: 28px; 
  font-weight: 700; 
  cursor: pointer; 
  transition: filter 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover { 
  filter: brightness(1.05); 
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.helper { 
  text-align: center; 
  color: var(--login-muted); 
  font-size: 0.95rem;
}

.helper a {
  color: var(--login-primary-2);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.helper a:hover {
  color: var(--login-primary);
}

.toast { 
  display: none; 
  border-radius: 12px; 
  padding: .75rem .9rem; 
  font-size: .95rem; 
  margin-bottom: 16px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.success { 
  display: block; 
  background: #0f3d2e; 
  color: #b7f7d0; 
  border: 1px solid #1c7a5b; 
}

.toast.error { 
  display: block; 
  background: #3b0a0a; 
  color: #fecaca; 
  border: 1px solid #7f1d1d; 
}

@media (max-width: 900px) { 
  .auth-split { 
    grid-template-columns: 1fr; 
  } 
  .auth-left { 
    min-height: 36vh; 
  } 
}

/* Fixed back-home positioning (viewport) */
.auth-card .back-home {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 1000;
}

@media (min-width: 768px) {
  .auth-card .back-home {
    top: calc(20px + env(safe-area-inset-top));
    left: calc(20px + env(safe-area-inset-left));
  }
}

@media (max-width: 570px) {
  .auth-card .back-home {
    font-size: 0.85rem;
    padding: 8px 14px;
  }
}

/* Page enter fog overlay for smooth reveal */
.page-enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 700ms ease;
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(1000px 700px at 70% 80%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(0deg, rgba(15,10,31,0.25), rgba(15,10,31,0.25));
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.page-enter-overlay.hide {
  opacity: 0;
}

/* Gentle background motion for forgot-password */
@keyframes kenburnsBg {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.06) translate3d(1.5%, 1.5%, 0); }
}

.video-background {
  animation: kenburnsBg 16s ease-in-out infinite alternate;
}

/* Subtle drift on the left artwork background */
@keyframes bgDrift {
  0% { background-position: 50% 50%; }
  100% { background-position: 52% 48%; }
}

.auth-left::before {
  animation: bgDrift 20s ease-in-out infinite alternate;
}
/* Lift content for shorter viewports (e.g., many 15" laptops) */
/* For Forgot Password, keep card centered even on shorter viewports */
@media (max-height: 900px) {
  .page-forgot .auth-split { 
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .page-forgot .auth-card { 
    margin: 0;
  }
}

@media (max-width: 768px) {
  .auth-split {
    position: relative; /* Đổi lại relative cho mobile */
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    padding: 1.5rem !important; /* Thêm padding cho mobile */
  }
  
  .auth-card {
    padding: 24px 20px 20px;
    position: relative; /* Relative trên mobile */
  }
  
  /* Cho phép cuộn trên mobile */
  html, body {
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .auth-split {
    padding: 1rem !important;
  }
  
  .auth-card {
    max-width: 100%;
    padding: 20px 16px 18px;
  }
}
