/**
 * Auth Pages CSS - 404 Style (Final Version)
 * TruyenQQ - Blue Theme
 * 
 * @package TruyenQQ
 * @version 4.2.0
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

/* =====================================================
   VARIABLES - BLUE THEME
===================================================== */
:root {
  --color-blue-primary: #4a9eff;
  --color-blue-light: #6db3ff;
  --color-blue-dark: #3182ce;
  --color-blue-gradient: linear-gradient(135deg, #4a9eff 0%, #6db3ff 100%);
  --color-blue-gradient-reverse: linear-gradient(
    135deg,
    #6db3ff 0%,
    #4a9eff 100%
  );

  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-input: #ffffff;

  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-light: #a0aec0;

  --border-color: #e2e8f0;
  --border-focus: #4a9eff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);

  --shadow-blue-sm: 0 2px 12px rgba(74, 158, 255, 0.2);
  --shadow-blue-md: 0 4px 20px rgba(74, 158, 255, 0.3);
  --shadow-blue-lg: 0 8px 32px rgba(74, 158, 255, 0.4);

  --color-success: #4caf50;
  --color-error: #ff5252;
  --color-warning: #ffa726;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.4s ease;
}

body.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --bg-input: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --border-color: #333333;
}

/* =====================================================
   PAGE CONTAINER - 100VH WITH VIDEO
===================================================== */
.auth-page-404 {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
  margin: 0 !important;
}

body.dark-mode .auth-page-404 {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

/* =====================================================
   VIDEO BACKGROUND
===================================================== */
.auth-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
  opacity: 1;
}

body.dark-mode .auth-video-bg {
  opacity: 0.9;
}

.auth-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 245, 245, 0.05);
  z-index: 1;
  pointer-events: none;
}

body.dark-mode .auth-video-overlay {
  background: rgba(15, 15, 15, 0.3);
}

/* =====================================================
   THEME TOGGLE BUTTON
===================================================== */
.theme-toggle-auth {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 100;
}

.theme-toggle-button {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(74, 158, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

body.dark-mode .theme-toggle-button {
  background: rgba(26, 26, 26, 0.9);
  border-color: rgba(74, 158, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-toggle-button:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.3);
  border-color: var(--color-blue-primary);
}

.theme-toggle-button i {
  font-size: 22px;
  transition: all 0.3s ease;
  position: absolute;
}

.theme-toggle-button .dark-icon {
  color: #ffa726;
  opacity: 1;
}

.theme-toggle-button .light-icon {
  color: #4a9eff;
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

body.dark-mode .theme-toggle-button .dark-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

body.dark-mode .theme-toggle-button .light-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* =====================================================
   BACK TO HOME BUTTON - TEXT STYLE
===================================================== */
.back-to-home {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
}

.back-to-home a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(74, 158, 255, 0.3);
  border-radius: 50px;
  color: var(--color-blue-primary);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
}

body.dark-mode .back-to-home a {
  background: rgba(26, 26, 26, 0.9);
  border-color: rgba(74, 158, 255, 0.4);
  color: var(--color-blue-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-home a:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
  background: var(--color-blue-gradient);
  color: #fff;
  border-color: transparent;
}

.back-to-home a i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.back-to-home a:hover i {
  transform: translateX(-3px);
}

.back-to-home a span {
  font-family: "Inter", sans-serif;
  letter-spacing: 0.3px;
}

/* =====================================================
   CONTAINER - TRANSPARENT BACKGROUND
===================================================== */
.auth-container-404 {
  max-width: 550px;
  width: 100%;
  position: relative;
  z-index: 3;
  animation: fadeInUp 0.8s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 100px rgba(74, 158, 255, 0.15);
  overflow: hidden;
}

body.dark-mode .auth-container-404 {
  background: rgba(26, 26, 26, 0.1);
  border-color: rgba(74, 158, 255, 0.25);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(74, 158, 255, 0.25);
}

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

/* =====================================================
   FORM WRAPPER - CENTERED & COMPACT
===================================================== */
.auth-form-wrapper-center {
  width: 100%;
  padding: 35px 40px;
  position: relative;
  z-index: 2;
}

/* =====================================================
   HEADER - COMPACT
===================================================== */
.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-header h2 i {
  color: var(--color-blue-primary);
  font-size: 22px;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.auth-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* =====================================================
   FORM ELEMENTS - COMPACT SPACING
===================================================== */
.auth-form {
  margin-top: 15px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group label i {
  color: var(--color-blue-primary);
  font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all var(--transition-base);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-blue-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 45px !important;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  transition: color var(--transition-fast);
  font-size: 15px;
}

.toggle-password:hover {
  color: var(--color-blue-primary);
}

/* =====================================================
   CHECKBOX & INLINE ELEMENTS
===================================================== */
.form-group-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-blue-primary);
  border-radius: 4px;
}

.checkbox-label a {
  color: var(--color-blue-primary);
  text-decoration: underline;
}

.link-text {
  font-size: 13px;
  color: var(--color-blue-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.link-text:hover {
  color: var(--color-blue-dark);
  text-decoration: underline;
}

/* =====================================================
   RECAPTCHA - COMPACT
===================================================== */
.recaptcha-container {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.g-recaptcha {
  display: inline-block;
}

/* =====================================================
   BUTTONS - COMPACT
===================================================== */
.btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--color-blue-gradient);
  color: #fff;
  box-shadow: var(--shadow-blue-md);
}

.btn-primary:hover {
  background: var(--color-blue-gradient-reverse);
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue-lg);
}

.btn-outline {
  background: transparent;
  color: var(--color-blue-primary);
  border: 2px solid var(--color-blue-primary);
}

.btn-outline:hover {
  background: var(--color-blue-primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =====================================================
   DIVIDER - COMPACT
===================================================== */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

/* =====================================================
   SOCIAL LOGIN - COMPACT
===================================================== */
.social-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.btn-social {
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-social i {
  font-size: 15px;
}

.btn-google {
  border-color: #ea4335;
  color: #ea4335;
}

.btn-google:hover {
  background: #ea4335;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

.btn-facebook {
  border-color: #1877f2;
  color: #1877f2;
}

.btn-facebook:hover {
  background: #1877f2;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

/* =====================================================
   FORM MESSAGES - COMPACT
===================================================== */
.form-message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: none;
  animation: slideDown 0.3s ease;
  border-left: 3px solid transparent;
}

.form-message.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-message.success {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
  border-left-color: var(--color-success);
}

body.dark-mode .form-message.success {
  color: #81c784;
}

.form-message.error {
  background: rgba(255, 82, 82, 0.15);
  color: #c62828;
  border-left-color: var(--color-error);
}

body.dark-mode .form-message.error {
  color: #ff8a80;
}

.form-message i {
  font-size: 14px;
}

/* =====================================================
   FOOTER - COMPACT
===================================================== */
.auth-footer {
  text-align: center;
  padding: 14px 0 0;
  border-top: 1px solid var(--border-color);
  margin-top: 18px;
}

.auth-footer p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--color-blue-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--color-blue-dark);
  text-decoration: underline;
}

/* =====================================================
   PASSWORD STRENGTH - COMPACT
===================================================== */
.password-strength {
  margin-top: 6px;
}

.strength-bar {
  height: 3px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.strength-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  transition: all var(--transition-base);
  border-radius: 2px;
}

.strength-bar.weak::before {
  width: 33%;
  background: #f44336;
}

.strength-bar.medium::before {
  width: 66%;
  background: #ffa726;
}

.strength-bar.strong::before {
  width: 100%;
  background: #4caf50;
}

.strength-text {
  font-size: 11px;
  margin-top: 4px;
  display: block;
  font-weight: 600;
}

.strength-text.weak {
  color: #f44336;
}
.strength-text.medium {
  color: #ffa726;
}
.strength-text.strong {
  color: #4caf50;
}

/* =====================================================
   OTP SECTIONS - COMPACT
===================================================== */
.auth-step {
  display: none;
}

.auth-step.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.otp-info {
  text-align: center;
  padding: 16px;
  background: rgba(74, 158, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.otp-info i {
  font-size: 40px;
  color: var(--color-blue-primary);
  margin-bottom: 10px;
  display: block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.otp-info p {
  margin: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.otp-info strong {
  font-size: 14px;
  color: var(--color-blue-primary);
  display: block;
  margin-top: 6px;
}

.otp-resend {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 12px;
}

.otp-resend p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 6px 0;
}

.otp-resend a {
  color: var(--color-blue-primary);
  font-weight: 600;
  text-decoration: none;
}

.otp-resend a:hover {
  text-decoration: underline;
}

.otp-timer {
  color: var(--color-warning) !important;
  font-weight: 600;
}

/* =====================================================
   LOADING ANIMATION
===================================================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fa-spinner.fa-spin {
  animation: spin 0.8s linear infinite;
}

/* =====================================================
   RESPONSIVE - TABLET (≤1024px)
===================================================== */
@media (max-width: 1024px) {
  .auth-container-404 {
    max-width: 500px;
  }

  .auth-form-wrapper-center {
    padding: 30px 35px;
  }

  .theme-toggle-auth {
    top: 20px;
    right: 20px;
  }

  .theme-toggle-button {
    width: 46px;
    height: 46px;
  }

  .theme-toggle-button i {
    font-size: 20px;
  }

  .back-to-home {
    bottom: 20px;
    right: 20px;
  }

  .back-to-home a {
    padding: 11px 20px;
    font-size: 14px;
  }

  .back-to-home a i {
    font-size: 16px;
  }
}

/* =====================================================
   RESPONSIVE - MOBILE (≤768px)
===================================================== */
@media (max-width: 768px) {
  .auth-page-404 {
    padding: 15px;
  }

  .auth-container-404 {
    max-width: 100%;
  }

  .auth-form-wrapper-center {
    padding: 30px 25px;
  }

  .auth-header h2 {
    font-size: 24px;
  }

  .auth-header h2 i {
    font-size: 20px;
  }

  .form-group input {
    font-size: 15px;
    padding: 12px 14px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .recaptcha-container {
    justify-content: center;
  }

  .g-recaptcha {
    transform: scale(0.95);
    transform-origin: center center;
  }

  .theme-toggle-auth {
    top: 16px;
    right: 16px;
  }

  .theme-toggle-button {
    width: 44px;
    height: 44px;
  }

  .theme-toggle-button i {
    font-size: 18px;
  }

  .back-to-home {
    bottom: 16px;
    right: 16px;
  }

  .back-to-home a {
    padding: 10px 18px;
    font-size: 13px;
  }

  .back-to-home a i {
    font-size: 15px;
  }

  .social-login {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .auth-video-bg {
    opacity: 0.9;
  }

  body.dark-mode .auth-video-bg {
    opacity: 0.8;
  }
}

/* =====================================================
   RESPONSIVE - SMALL MOBILE (≤480px)
===================================================== */
@media (max-width: 480px) {
  .auth-page-404 {
    padding: 10px;
  }

  .auth-container-404 {
    border-radius: 16px;
  }

  .auth-form-wrapper-center {
    padding: 25px 20px;
  }

  .auth-header h2 {
    font-size: 22px;
  }

  .theme-toggle-auth {
    top: 12px;
    right: 12px;
  }

  .theme-toggle-button {
    width: 40px;
    height: 40px;
  }

  .theme-toggle-button i {
    font-size: 16px;
  }

  .back-to-home {
    bottom: 12px;
    right: 12px;
  }

  .back-to-home a {
    padding: 9px 16px;
    font-size: 12px;
    gap: 6px;
  }

  .back-to-home a i {
    font-size: 14px;
  }

  .form-group-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .g-recaptcha {
    transform: scale(0.85);
  }
}

@media (max-width: 380px) {
  .g-recaptcha {
    transform: scale(0.77);
  }

  .back-to-home a span {
    display: none;
  }

  .back-to-home a {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
}

/* =====================================================
   LANDSCAPE MOBILE FIX
===================================================== */
@media (max-height: 700px) and (orientation: landscape) {
  .auth-page-404 {
    height: auto;
    min-height: 100vh;
    padding: 30px 20px;
  }

  .auth-form-wrapper-center {
    padding: 25px 30px;
  }

  .auth-header h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .auth-header p {
    font-size: 12px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .otp-info {
    padding: 12px;
  }

  .otp-info i {
    font-size: 32px;
  }

  .theme-toggle-auth {
    top: 16px;
    right: 16px;
  }

  .back-to-home {
    bottom: 16px;
    right: 16px;
  }
}

/* =====================================================
   ACCESSIBILITY
===================================================== */
.btn:focus,
input:focus,
.toggle-password:focus,
.theme-toggle-button:focus {
  outline: 2px solid var(--color-blue-primary);
  outline-offset: 2px;
}

/* =====================================================
   PRINT STYLES
===================================================== */
@media print {
  .auth-page-404,
  .back-to-home,
  .theme-toggle-auth {
    display: none;
  }
}
