/* ============================
   AUTH — PROFESSIONAL CLEAN UI
   MODERN | CLEAN | PROFESSIONAL
=============================*/

/* Warna utama dari ketentuan */
:root {
  --primary: #003DF6;
  /* HEX: #003DF6 */
  --primary-dark: #0028B3;
  --primary-light: #3369FF;
  --primary-transparent: rgba(0, 61, 246, 0.08);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg-light: #f9fafb;
  --card-bg: #ffffff;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  min-height: 100dvh;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
}

/* Glow efek subtle di background */
body::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 61, 246, 0.05) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  z-index: -1;
}

body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 61, 246, 0.03) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  z-index: -1;
}

/* ===== Card Container ===== */
.auth-container {
  width: 100%;
  max-width: 420px;
  z-index: 10;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid rgba(229, 231, 235, 0.8);
  padding-bottom: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  animation: cardFadeIn 0.5s ease-out;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Header ===== */
.auth-card-header {
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  text-align: center;
}

.auth-card-header h4 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

/* ===== Body ===== */
.auth-card-body {
  padding: 1.75rem 1.75rem 1.75rem;
}

/* ===== Form Elements ===== */
.auth-form-group {
  margin-bottom: 1.4rem;
}

.auth-form-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
  font-weight: 500;
}

.auth-input-with-icon {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form-control {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.auth-form-control::placeholder {
  color: #9ca3af;
}

.auth-form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-transparent);
  background: var(--card-bg);
}

.auth-form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== Buttons ===== */
.auth-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: 10px;
  border: none;
  font-size: 0.98rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  transition: all 0.25s ease;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #002099 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 61, 246, 0.15);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 5px 10px rgba(0, 61, 246, 0.1);
}

.auth-btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #0da271 100%);
}

.auth-btn-success:hover {
  background: linear-gradient(135deg, #0da271 0%, #0c8f65 100%);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.15);
}

.auth-btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.auth-btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.15);
}

/* Loading state */
.auth-btn-loading {
  pointer-events: none;
  opacity: 0.9;
}

.auth-btn-loading span {
  opacity: 0;
}

.auth-btn-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Links ===== */
.auth-links-container {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-link {
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== Alerts - Clean & Elegant ===== */
.auth-alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-alert i {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left-color: var(--success);
}

.auth-alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-left-color: var(--danger);
}

/* Fade-out untuk auto hide */
.fade-out {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* ===== Toggle Password ===== */
.password-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--primary);
}

/* ===== Error Feedback ===== */
.invalid-feedback {
  display: block;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.invalid-feedback i {
  font-size: 0.9rem;
}

/* Social login section (hidden karena tidak dipakai) */
.auth-social-buttons,
.auth-social-divider {
  display: none;
}

.auth-trust {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-trust i {
  color: #10b981;
}

/* ===== BRAND HEADER ===== */
.auth-brand {
  position: relative;
  z-index: 20;
  text-align: center;
  margin-bottom: 32px;
  animation: brandFade .6s ease;
}

.auth-brand-logo img {
  height: 64px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .08));
}

.auth-brand-text h1 {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.auth-brand-text p {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

@keyframes brandFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== CARD INTERACTION ===== */
.auth-card {
  transition: box-shadow .25s ease, transform .25s ease;
}

.auth-card.focused {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, .08),
    0 0 0 4px rgba(0, 61, 246, .08);
  transform: translateY(-2px);
}

/* ===== BACKGROUND REACTION ===== */
body::before {
  transition: all .6s ease;
}

body.typing::before {
  transform: scale(1.1);
  opacity: .9;
}

/* ===== LOGIN SUCCESS TRANSITION ===== */
.auth-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn .25s ease;
}

.success-box {
  text-align: center;
  animation: pop .35s ease;
}

.success-box i {
  font-size: 48px;
  color: #10b981;
  margin-bottom: 10px;
}

.success-box h5 {
  font-weight: 600;
  margin-bottom: 4px;
}

.success-box p {
  font-size: 14px;
  color: #6b7280;
}

@keyframes pop {
  from {
    transform: scale(.85);
    opacity: .5
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

/* ===== RESPONSIVE MOBILE (NO SCROLL) ===== */
@media (max-width: 480px) {

  html,
  body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  body {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: hidden;
    /* Mobile tidak bisa scroll */
  }

  .auth-card {
    border-radius: 14px;
    max-height: 90vh;
    /* Batasi tinggi card */
    overflow-y: auto;
    /* Yang di-scroll adalah card-nya, bukan body */
  }

  .auth-card-body,
  .auth-card-header {
    padding: 1.5rem 1.35rem;
  }

  .auth-btn {
    padding: 0.75rem;
  }

  /* Styling scrollbar di dalam card untuk mobile */
  .auth-card::-webkit-scrollbar {
    width: 4px;
  }

  .auth-card::-webkit-scrollbar-track {
    background: transparent;
  }

  .auth-card::-webkit-scrollbar-thumb {
    background: rgba(0, 61, 246, 0.2);
    border-radius: 20px;
  }

  .auth-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 61, 246, 0.2) transparent;
  }
}

/* Khusus regis

/* ============================
   REGISTER PAGE - SCROLL & SPACING
==============================*/
/* Hilangkan scroll dari html */
html {
  overflow-y: hidden !important;
}

/* Fix overflow dan scroll */
html:has(body form#registerForm) {
  height: auto !important;
  min-height: 100vh !important;
}

/* Body jadi satu-satunya scroll */
body:has(form#registerForm) {
  overflow-y: auto !important;
}

/* Body padding untuk spacing */
body:has(form#registerForm) {
  padding: 20px !important;
  display: block !important;
}

/* Container register */
body:has(form#registerForm) .auth-container {
  max-width: 480px;
  margin: 0 auto;
  height: auto !important;
}

/* Card register */
body:has(form#registerForm) .auth-card {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  margin-bottom: 16px !important;
}

/* Desktop centering */
@media (min-width: 769px) {
  body:has(form#registerForm) {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body:has(form#registerForm) {
    padding: 12px !important;
  }

  body:has(form#registerForm) .auth-card {
    margin-bottom: 10px !important;
    /* Jarak bawah 16px untuk mobile */
  }
}
