/**
 * AUTH FORMS - Responsive Styles
 * Dedicated CSS untuk halaman login, register, forgot password
 */

/* ==================== FIX BACKGROUND - NO OVERRIDE ==================== */
html,
body {
  /* Jangan override background dari style.css */
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--dark-primary); /* Ensure solid background persists */
}

/* Remove background::before yang bisa crash footer */

/* ==================== AUTH CONTAINER - FIXED ==================== */
.auth-container {
  min-height: calc(100vh - 500px); /* Reduced untuk kasih space footer */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 3rem 1rem;
  width: 100%;
  margin: 0 auto;
  position: relative; /* Important untuk z-index */
  z-index: 1; /* Di bawah navbar tapi di atas background */
}

.auth-container .row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0;
}

.auth-container .col,
.auth-container [class*="col-"] {
  display: flex;
  justify-content: center;
  padding: 0 15px;
}

/* ==================== AUTH CARD ==================== */
.auth-card {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 217, 255, 0.1);
  max-width: 450px;
  width: 100%;
  margin: 0 auto !important;
  position: relative;
  display: block;
  z-index: 2; /* Di atas auth-container */
}

/* ==================== FORM ELEMENTS ==================== */
.auth-card .form-control {
  height: 48px;
  background-color: rgba(15, 15, 35, 0.8);
  border: 2px solid rgba(0, 217, 255, 0.2);
  color: #ffffff;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  width: 100%;
}

.auth-card .form-control:focus {
  background-color: rgba(15, 15, 35, 0.9);
  border-color: #00d9ff;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
  outline: none;
}

.auth-card .form-control::placeholder {
  color: rgba(255, 252, 252, 0.6);
}

.auth-card .form-label {
  color: #ffffff;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  display: block;
}

/* ==================== FORM SPACING ==================== */
.auth-card .mb-3 {
  margin-bottom: 1.25rem !important;
}

.auth-card .mb-4 {
  margin-bottom: 1.5rem !important;
}

.auth-card .form-group {
  margin-bottom: 1.25rem;
}

/* ==================== PRIMARY BUTTON WITH GRADIENT GLOW ==================== */
.auth-card .btn-primary,
.auth-card .btn-aqua,
.auth-card button,
.auth-card input[type="submit"] {
  height: 48px;
  width: 100%;
  border: none;
  outline: none;
  color: #fff;
  background: var(--dark-primary, #0f0f23);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  position: relative;
  z-index: 0;
  overflow: hidden;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Animated Gradient Border (Always Visible) */
.auth-card .btn-primary::before,
.auth-card .btn-aqua::before,
.auth-card button::before,
.auth-card input[type="submit"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    270deg,
    #00d9ff,
    #00ffff,
    #00ff88,
    #00d9ff,
    #0088ff,
    #00d9ff
  );
  background-size: 400%;
  animation: borderMove 6s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: -1;
}

/* Glow Effect (Visible on Hover) */
.auth-card .btn-primary::after,
.auth-card .btn-aqua::after,
.auth-card button::after,
.auth-card input[type="submit"]::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  background: linear-gradient(
    45deg,
    #00d9ff,
    #00ffff,
    #00ff88,
    #00d9ff,
    #0088ff,
    #00d9ff,
    #00ffff,
    #00d9ff
  );
  background-size: 400%;
  z-index: -2;
  filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  border-radius: inherit;
  animation: glowing 8s linear infinite;
}

/* Hover State */
.auth-card .btn-primary:hover::after,
.auth-card .btn-aqua:hover::after,
.auth-card button:hover::after,
.auth-card input[type="submit"]:hover::after {
  opacity: 1;
}

.auth-card .btn-primary:hover,
.auth-card .btn-aqua:hover,
.auth-card button:hover,
.auth-card input[type="submit"]:hover {
  background: rgba(26, 26, 46, 0.8);
  transform: translateY(-2px);
}

.auth-card .btn-primary:active,
.auth-card .btn-aqua:active,
.auth-card button:active,
.auth-card input[type="submit"]:active {
  transform: translateY(0);
}

/* ==================== OAUTH DIVIDER ==================== */
.oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: rgba(160, 160, 160, 0.8);
  font-size: 0.85rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

.oauth-divider span {
  padding: 0 1rem;
}

/* ==================== OAUTH BUTTONS WITH GRADIENT GLOW ==================== */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.oauth-btn {
  height: 48px;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 1rem;
  position: relative;
  z-index: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Animated Border for OAuth Buttons */
.oauth-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    270deg,
    #00d9ff,
    #00ffff,
    #00ff88,
    #00d9ff,
    #0088ff,
    #00d9ff
  );
  background-size: 400%;
  animation: borderMove 6s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: -1;
}

/* Glow Effect for OAuth Buttons */
.oauth-btn::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  background: linear-gradient(
    45deg,
    #00d9ff,
    #00ffff,
    #00ff88,
    #00d9ff,
    #0088ff,
    #00d9ff,
    #00ffff,
    #00d9ff
  );
  background-size: 400%;
  z-index: -2;
  filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  border-radius: inherit;
  animation: glowing 8s linear infinite;
}

.oauth-btn:hover::after {
  opacity: 1;
}

.oauth-btn:hover {
  background: rgba(0, 217, 255, 0.05);
  transform: translateY(-2px);
}

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

.oauth-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ==================== LINKS ==================== */
.auth-card .text-aqua {
  color: #00d9ff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.auth-card .text-aqua:hover {
  color: #00b8d9;
  text-decoration: underline;
}

.forgot-password-link {
  display: block;
  text-align: right;
  margin-top: -8px;
  margin-bottom: 15px;
  font-size: 0.85rem;
}

/* ==================== HEADER ==================== */
.auth-card .text-center h2 {
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

.auth-card .text-center p {
  color: rgba(160, 160, 160, 0.9);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-card .text-center .fa-gamepad {
  color: #00d9ff;
  text-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ==================== FOOTER STYLING FOR AUTH PAGES ==================== */
/* CRITICAL: Override konflik dengan aturan global row/col */
.footer {
  background-color: var(--dark-secondary, #1a1a2e) !important;
  padding: 2.5rem 0 1.5rem !important;
  margin-top: auto !important;
  border-top: 2px solid rgba(0, 217, 255, 0.2) !important;
  position: relative !important;
  z-index: 10 !important;
  width: 100% !important;
}

.footer * {
  box-sizing: border-box !important;
}

.footer .container {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  display: block !important;
}

/* CRITICAL FIX: Override aturan global .row untuk footer */
.footer .row {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: -15px !important;
  margin-right: -15px !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

/* CRITICAL FIX: Override aturan global .col untuk footer */
.footer .row > [class*="col-"] {
  padding-left: 15px !important;
  padding-right: 15px !important;
  margin-bottom: 1.5rem !important;
  display: block !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

.footer ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
}

.footer ul li {
  margin-bottom: 0.5rem !important;
  padding: 0 !important;
}

.footer ul li:last-child {
  margin-bottom: 0 !important;
}

/* UKURAN LOGO + TEKS DIPERKECIL */
.footer-brand {
  color: #00d9ff !important;
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.8) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.5rem !important;
  display: block !important;
  line-height: 1.3 !important;
}

/* H6 DITARIK KE ATAS AGAR SEJAJAR DENGAN LIST */
.footer h6 {
  color: #00d9ff !important;
  margin-bottom: 0.5rem !important;
  margin-top: 0 !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  line-height: 1.3 !important;
}

.footer a {
  color: #a0a0a0 !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  display: inline-block !important;
  font-size: 0.85rem !important;
}

.footer a:hover {
  color: #00d9ff !important;
  padding-left: 5px !important;
  text-decoration: none !important;
}

.footer p {
  color: #a0a0a0 !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.6 !important;
  font-size: 0.85rem !important;
}

.footer .text-center {
  width: 100% !important;
  color: #a0a0a0 !important;
  font-size: 0.85rem !important;
  margin-top: 1rem !important;
  padding-top: 1rem !important;
  border-top: 1px solid rgba(0, 217, 255, 0.2) !important;
  text-align: center !important;
}

.footer .text-center p {
  margin-bottom: 0 !important;
}

/* ==================== RESPONSIVE ==================== */
/* Tablet */
@media (max-width: 768px) {
  .auth-container {
    padding: 2rem 1rem;
    min-height: calc(100vh - 450px);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .auth-container .row {
    justify-content: center !important;
    margin: 0 !important;
  }

  .auth-container [class*="col-"] {
    max-width: 100%;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
  }

  .auth-card {
    padding: 2rem 1.5rem;
    max-width: 500px;
    width: 100%;
    margin: 0 auto !important;
  }

  /* Footer responsive untuk tablet */
  .footer {
    padding: 2rem 0 1.5rem !important;
  }

  .footer .row {
    justify-content: flex-start !important;
  }

  .footer .row > [class*="col-"] {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .auth-container {
    min-height: auto;
    padding: 1.5rem 1rem;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .auth-container .row {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
  }

  .auth-container [class*="col-"] {
    padding: 0 10px !important;
    display: flex;
    justify-content: center;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
    margin: 0 auto !important;
    max-width: 100%;
    width: calc(100% - 20px);
  }

  .auth-card .form-control,
  .auth-card .btn-primary,
  .auth-card .btn-aqua,
  .oauth-btn {
    height: 45px;
    font-size: 0.9rem;
  }

  .auth-card .text-center h2 {
    font-size: 1.5rem;
  }

  .auth-card .text-center .fa-gamepad {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
  }

  .auth-card .mb-3 {
    margin-bottom: 1rem !important;
  }

  .oauth-divider {
    margin: 1.25rem 0;
  }

  /* Footer responsive untuk mobile */
  .footer {
    padding: 1.5rem 0 1rem !important;
  }

  .footer .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .footer .row {
    flex-direction: column !important;
  }

  .footer .row > [class*="col-"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 1.25rem !important;
  }

  .footer .row > [class*="col-"]:last-child {
    margin-bottom: 0 !important;
  }

  .footer-brand {
    font-size: 1rem !important;
    margin-bottom: 0.4rem !important;
  }

  .footer h6 {
    font-size: 0.9rem !important;
    margin-bottom: 0.4rem !important;
  }

  .footer ul li {
    margin-bottom: 0.4rem !important;
  }

  .footer a {
    font-size: 0.8rem !important;
  }

  .footer p {
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
  }

  .footer .text-center {
    margin-top: 1rem !important;
    padding-top: 0.75rem !important;
    font-size: 0.75rem !important;
  }
}

/* Extra Small Mobile */
@media (max-width: 400px) {
  .auth-card {
    padding: 1.5rem 1rem;
    margin: 0 auto !important;
    width: calc(100% - 10px);
  }

  .oauth-btn {
    font-size: 0.85rem;
    gap: 0.5rem;
    height: 42px;
  }

  .oauth-btn img {
    width: 18px;
    height: 18px;
  }

  .auth-card .form-control {
    font-size: 0.875rem;
    height: 42px;
  }

  .auth-card .form-label {
    font-size: 0.875rem;
  }

  /* Footer responsive untuk extra small mobile */
  .footer {
    padding: 1.25rem 0 0.75rem !important;
  }

  .footer .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .footer-brand {
    font-size: 0.95rem !important;
  }

  .footer h6 {
    font-size: 0.85rem !important;
  }

  .footer a,
  .footer p {
    font-size: 0.75rem !important;
  }

  .footer ul li {
    margin-bottom: 0.35rem !important;
  }

  .footer .text-center {
    font-size: 0.7rem !important;
  }
}

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

@keyframes borderMove {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 400% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes glowing {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 400% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.auth-card {
  animation: fadeInUp 0.5s ease-out;
}

/* ==================== ALERT MESSAGES ==================== */
.auth-card .alert {
  border-radius: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  width: 100%;
}

/* ==================== TEXT ALIGNMENT ==================== */
.auth-card .text-center {
  text-align: center;
}

/* ==================== FIX CENTER ALIGNMENT - HANYA UNTUK AUTH CONTAINER ==================== */
/* PENTING: Jangan apply ke footer! */
.auth-container .row,
.auth-card .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: flex;
  justify-content: center;
}

.auth-container .col,
.auth-container .col-md-6,
.auth-container .col-lg-5,
.auth-container [class*="col-"],
.auth-card .col,
.auth-card .col-md-6,
.auth-card .col-lg-5,
.auth-card [class*="col-"] {
  padding-left: 15px;
  padding-right: 15px;
  display: flex;
  justify-content: center;
}

/* Force center untuk container auth ONLY */
.auth-container .container,
.auth-card .container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto !important;
  margin-left: auto !important;
  display: block;
}

.auth-container .container-fluid,
.auth-card .container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto !important;
  margin-left: auto !important;
}

/* ==================== PREVENT WHITE FLASH ==================== */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Jangan override html/body background - biarkan style.css yang handle */

/* Prevent overscroll bounce */
body {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

/* ==================== SMOOTH SCROLLING ==================== */
html {
  scroll-behavior: smooth;
}
