/* ============================================================
   assets/css/auth.css
   Design system khusus halaman auth (login & register).
   Tema: "charging energy" — merepresentasikan top-up/isi ulang.
   Tidak bergantung pada Bootstrap; file ini berdiri sendiri.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #120B26;
  --bg-deep-2: #1E1240;
  --accent-violet: #1D4ED8;
  --accent-violet-soft: #60A5FA;
  --accent-mint: #38BDF8;
  --surface: #FFFFFF;
  --surface-muted: #F6F5FB;
  --text-dark: #16121F;
  --text-muted: #6E6A85;
  --border-soft: #E7E5F3;
  --danger: #FF5A7A;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 30px 60px -25px rgba(18, 11, 38, 0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body.auth-body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: var(--surface-muted);
  min-height: 100vh;
}

.auth-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------------------------------------------------------
   PANEL KIRI — dark energy panel (desktop) / top band (mobile)
   --------------------------------------------------------- */
.auth-brand-panel {
  position: relative;
  flex: 0 0 44%;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(29, 78, 216, 0.35), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(56, 189, 248, 0.18), transparent 50%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-deep-2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 44px;
  color: #fff;
}

.auth-brand-panel::before {
  /* grid tekstur halus, kesan "sirkuit energi" */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 75%);
  pointer-events: none;
}

.auth-brand-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.auth-brand-top img { height: 30px; }

.auth-orb-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 26px;
  margin: auto 0;
}

/* --- Power Orb: elemen signature halaman ini --- */
.power-orb {
  position: relative;
  width: 168px;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.power-orb .core {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--accent-mint) 45%, var(--accent-violet) 100%);
  box-shadow:
    0 0 30px 6px rgba(56, 189, 248, 0.55),
    0 0 60px 20px rgba(29, 78, 216, 0.35);
  animation: orb-pulse 3.2s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.power-orb .core svg { width: 30px; height: 30px; color: var(--bg-deep); }

.power-orb .ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  animation: orb-spin 14s linear infinite;
}
.power-orb .ring.r1 { inset: 18px; border-color: rgba(157, 133, 255, 0.55); }
.power-orb .ring.r2 { inset: 0; animation-duration: 22s; animation-direction: reverse; }

.auth-orb-caption h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.auth-orb-caption p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.65);
  max-width: 280px;
}

.auth-feature-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-feature-list .item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  opacity: 0;
  animation: feature-in 0.6s ease forwards;
}
.auth-feature-list .item:nth-child(1) { animation-delay: 0.15s; }
.auth-feature-list .item:nth-child(2) { animation-delay: 0.3s; }
.auth-feature-list .item:nth-child(3) { animation-delay: 0.45s; }

.auth-feature-list .icon-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-feature-list .icon-dot svg { width: 15px; height: 15px; color: var(--accent-mint); }

/* Floating decorative icons drifting in background */
.auth-float-icon {
  position: absolute;
  z-index: 1;
  opacity: 0.5;
  color: rgba(255,255,255,0.5);
  animation: drift 7s ease-in-out infinite;
}
.auth-float-icon.f1 { top: 14%; right: 16%; width: 22px; animation-delay: 0s; }
.auth-float-icon.f2 { bottom: 22%; left: 10%; width: 18px; animation-delay: 1.4s; }
.auth-float-icon.f3 { top: 55%; right: 8%; width: 16px; animation-delay: 2.6s; }

/* ---------------------------------------------------------
   PANEL KANAN — form card
   --------------------------------------------------------- */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--surface-muted);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 34px;
  opacity: 0;
  transform: translateY(14px);
  animation: card-in 0.55s cubic-bezier(.2,.8,.2,1) forwards;
}

.auth-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.auth-card .sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 28px;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFF0F3;
  border: 1px solid #FFD3DD;
  color: #C31E42;
  font-size: 0.82rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  animation: shake 0.4s ease;
}
.auth-alert.success {
  background: #ECFDF6;
  border-color: #B7F3DC;
  color: #0E9F6E;
}

.field-group {
  position: relative;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(8px);
  animation: field-in 0.5s ease forwards;
}
.field-group:nth-of-type(1) { animation-delay: 0.08s; }
.field-group:nth-of-type(2) { animation-delay: 0.16s; }
.field-group:nth-of-type(3) { animation-delay: 0.24s; }
.field-group:nth-of-type(4) { animation-delay: 0.32s; }

.field-group .icon-slot {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color 0.2s ease;
  pointer-events: none;
}

.field-group input {
  width: 100%;
  padding: 16px 16px 8px 46px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-soft);
  background: var(--surface-muted);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  height: 56px;
}
.field-group input:focus {
  border-color: var(--accent-violet);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}
.field-group input:focus ~ .icon-slot { color: var(--accent-violet); }

.field-group label {
  position: absolute;
  left: 46px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.18s ease;
  background: transparent;
}

.field-group input:focus + label,
.field-group input:not(:placeholder-shown) + label {
  top: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-violet);
  transform: none;
}

.field-group .toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
}
.field-group .toggle-pw svg { width: 18px; height: 18px; }

.auth-links-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 20px;
}
.auth-links-row a {
  font-size: 0.82rem;
  color: var(--accent-violet);
  text-decoration: none;
  font-weight: 600;
}
.auth-links-row a:hover { text-decoration: underline; }

.btn-charge {
  position: relative;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(100deg, var(--accent-violet) 0%, #1E40AF 60%, var(--accent-violet) 100%);
  background-size: 220% 100%;
  overflow: hidden;
  transition: background-position 0.5s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 26px -12px rgba(29, 78, 216, 0.55);
}
.btn-charge:hover {
  background-position: 100% 0;
  transform: translateY(-1px);
  box-shadow: 0 18px 30px -12px rgba(29, 78, 216, 0.65);
}
.btn-charge:active { transform: translateY(0); }
.btn-charge::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  animation: shimmer 2.6s ease-in-out infinite;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.auth-switch {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}
.auth-switch a {
  color: var(--accent-violet);
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ---------------------------------------------------------
   ANIMATIONS
   --------------------------------------------------------- */
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px 6px rgba(56,189,248,0.55), 0 0 60px 20px rgba(29,78,216,0.35); }
  50% { transform: scale(1.08); box-shadow: 0 0 40px 10px rgba(56,189,248,0.7), 0 0 75px 26px rgba(29,78,216,0.45); }
}
@keyframes orb-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}
@keyframes feature-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes field-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { left: -60%; }
  100% { left: 130%; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .power-orb .core, .power-orb .ring, .auth-float-icon,
  .auth-feature-list .item, .auth-card, .field-group,
  .btn-charge::after, .auth-alert {
    animation: none !important;
  }
}

/* ---------------------------------------------------------
   RESPONSIVE — mobile: top band + overlapping card
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-brand-panel {
    flex: none;
    min-height: 0;
    padding: 28px 24px 70px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .auth-orb-wrap { margin: 18px 0; gap: 16px; }
  .power-orb { width: 120px; height: 120px; }
  .power-orb .core { width: 54px; height: 54px; }
  .power-orb .core svg { width: 22px; height: 22px; }
  .auth-orb-caption h1 { font-size: 1.25rem; }
  .auth-feature-list { display: none; }
  .auth-form-panel { margin-top: -46px; padding: 0 18px 32px; }
  .auth-card { border-radius: var(--radius-lg); padding: 32px 24px; }
}
