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

/* =========================
   AUTH - PREMIUM, DYNAMIC & GLASSMORPHISM
   ========================= */
:root {
  --bg-color: #050505;
  --glass-bg: rgba(20, 20, 22, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --accent: #a855f7;
  --primary-hover: #4f46e5;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(255, 255, 255, 0.03);
  --radius: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body.auth-body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  /*min-height: 100vh;*/
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-x: hidden;
  /* Prevent horizontal scroll from shapes */
  overflow-y: auto;
  /* Allow vertical scroll */
  position: relative;
}

/* =========================
   MAIN CARD (GLASSMORPHISM)
   ========================= */
.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 36px 28px;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
  /* Kurangi bayangan agar tidak "mengambang" */
  position: relative;
  z-index: 10;
  margin: auto;
}

/* Entry Animation */
.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}

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

/* =========================
   BRAND & TYPOGRAPHY
   ========================= */
.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand .logo {
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.auth-brand .logo:hover {
  transform: none;
}

.auth-brand .logo img {
  height: 60px;
  width: auto;
  display: block;
}

.auth-brand h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* =========================
   FORM INPUTS
   ========================= */
.form-group {
  position: relative;
  margin-bottom: 16px;
}

.form-group input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group label {
  position: absolute;
  left: 14px;
  top: 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.25s ease;
  background: transparent;
  padding: 0 4px;
}

/* Floating Label Logic - Hide completely when focused or filled */
.form-group.filled label,
.form-group input:focus+label {
  opacity: 0;
  visibility: hidden;
}

/* Gradient line effect on focus */
.form-group::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
  border-radius: 0 0 12px 12px;
  opacity: 0;
}

.form-group.focused::after {
  width: calc(100% - 24px);
  /* Slightly indented */
  opacity: 1;
}

/* Password Toggle */
.password-group .toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.password-group .toggle-pass:hover {
  opacity: 1;
}

.password-group .toggle-pass::before,
.password-group .toggle-pass::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.password-group .toggle-pass::before {
  width: 14px;
  height: 9px;
  border: 1.5px solid #fff;
  border-radius: 50%;
}

.password-group .toggle-pass::after {
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
}

.password-group .toggle-pass.active::before {
  border-color: #fff;
}

.password-group .toggle-pass.active::after {
  width: 1.5px;
  height: 16px;
  background: #fff;
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* =========================
   BUTTONS
   ========================= */
.btn-primary {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  font-family: inherit;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  background-size: 200% auto;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(168, 85, 247, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 5px 15px -5px rgba(99, 102, 241, 0.4);
}

/* =========================
   DIVIDER & GOOGLE BTN
   ========================= */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span {
  padding: 0 14px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* =========================
   LINKS & MESSAGES
   ========================= */
.auth-link {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 16px;
}

.auth-link a {
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.message {
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Turnstile styling override if needed */
.cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  filter: contrast(0.95);
  /* Better blending in dark mode */
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 480px) {
  .auth-body {
    padding: 16px;
  }

  .auth-container {
    padding: 30px 20px;
    border-radius: 24px;
  }

  .auth-brand h2 {
    font-size: 1.5rem;
  }
}