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

@property --electric-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: #e8edf4;
  overflow: hidden;
  position: relative;
  transition: background 0.35s ease;
}

.theme-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 50;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-icon {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

.login-page.theme-light .theme-toggle {
  color: #5a6578;
  background: #e8edf4;
  box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.45), -6px -6px 12px rgba(255, 255, 255, 0.95);
}

.login-page.theme-dark .theme-toggle {
  color: #e2e8f0;
  background: #161822;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.bg-circle {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

.bg1 {
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.65);
  top: 8%;
  left: 12%;
  box-shadow: inset -8px -8px 16px rgba(255, 255, 255, 0.9), inset 8px 8px 16px rgba(174, 184, 198, 0.35);
}

.bg2 {
  width: 200px;
  height: 200px;
  background: #e8edf4;
  bottom: 15%;
  right: 10%;
  box-shadow: 8px 8px 18px rgba(163, 177, 198, 0.45), -8px -8px 18px rgba(255, 255, 255, 0.85);
}

.bg3 {
  width: 120px;
  height: 120px;
  background: #eef2f8;
  top: 55%;
  left: 8%;
  box-shadow: 6px 6px 14px rgba(163, 177, 198, 0.35), -6px -6px 14px rgba(255, 255, 255, 0.9);
}

.login-scene {
  perspective: 1400px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.auth-card {
  position: relative;
  width: 100%;
  min-height: 540px;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.auth-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-face.back {
  transform: rotateY(180deg);
}

.embossed-panel {
  border-radius: 28px;
  padding: 36px 32px 28px;
  background: #e8edf4;
  box-shadow:
    14px 14px 28px rgba(163, 177, 198, 0.55),
    -14px -14px 28px rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.logo-circle {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: #e8edf4;
  box-shadow:
    6px 6px 12px rgba(163, 177, 198, 0.5),
    -6px -6px 12px rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.auth-head {
  text-align: center;
  margin-bottom: 22px;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  color: #3d4a5c;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: #7a8799;
  line-height: 1.45;
}

.alert {
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
}

.alert-error {
  background: #fce8e8;
  color: #c0392b;
  box-shadow: inset 2px 2px 6px rgba(192, 57, 43, 0.08);
}

.alert-success {
  background: #e8f8ef;
  color: #1e7e45;
  box-shadow: inset 2px 2px 6px rgba(30, 126, 69, 0.08);
}

.input-group {
  position: relative;
  margin-bottom: 18px;
  border-radius: 16px;
  padding: 2px;
  background: transparent;
}

.electric-border,
.electric-glow {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.electric-border {
  padding: 2px;
  background: conic-gradient(
    from var(--electric-angle),
    #4dabf7,
    #748ffc,
    #9775fa,
    #4dabf7
  );
  animation: electric-spin 2.8s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.electric-glow {
  inset: -2px;
  background: conic-gradient(
    from var(--electric-angle),
    #4dabf7,
    #748ffc,
    #9775fa,
    #4dabf7
  );
  filter: blur(10px);
  animation: electric-spin 2.8s linear infinite;
  z-index: 0;
}

@keyframes electric-spin {
  to {
    --electric-angle: 360deg;
  }
}

.input-group:focus-within .electric-border,
.input-group:focus-within .electric-glow {
  opacity: 1;
}

.input-inner {
  position: relative;
  z-index: 1;
  border-radius: 14px;
  background: #e8edf4;
  box-shadow:
    inset 5px 5px 10px rgba(163, 177, 198, 0.45),
    inset -5px -5px 10px rgba(255, 255, 255, 0.95);
  padding: 10px 14px 8px;
}

.input-inner input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: #3d4a5c;
  padding: 4px 28px 4px 0;
}

.input-inner label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8b97a8;
  margin-bottom: 2px;
}

.toggle-pw {
  position: absolute;
  right: 14px;
  bottom: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  opacity: 0.7;
  z-index: 2;
}

.toggle-pw:hover {
  opacity: 1;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 22px;
  flex-wrap: wrap;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-me input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: #748ffc;
  cursor: pointer;
}

.remember-me span {
  font-size: 0.82rem;
  color: #7a8799;
}

.link-muted {
  font-size: 0.82rem;
  color: #5c7cfa;
  text-decoration: none;
  font-weight: 500;
}

.link-muted:hover {
  text-decoration: underline;
}

.main-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a6578;
  cursor: pointer;
  background: #e8edf4;
  box-shadow:
    8px 8px 16px rgba(163, 177, 198, 0.5),
    -8px -8px 16px rgba(255, 255, 255, 0.95);
  transition: transform 0.15s, box-shadow 0.15s;
}

.main-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    10px 10px 20px rgba(163, 177, 198, 0.55),
    -10px -10px 20px rgba(255, 255, 255, 0.98);
}

.main-btn:active {
  transform: translateY(0);
  box-shadow:
    inset 4px 4px 10px rgba(163, 177, 198, 0.45),
    inset -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .embossed-panel {
    padding: 28px 22px 24px;
  }

  .auth-title {
    font-size: 1.45rem;
  }

  .auth-card {
    min-height: 520px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
  }

  .theme-toggle-icon {
    width: 20px;
    height: 20px;
  }
}

/* ——— Tema gelap ——— */
.login-page.theme-dark {
  background: #0b0d14;
}

.login-page.theme-dark::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99, 102, 241, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 85% 75%, rgba(236, 72, 153, 0.18), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.login-page.theme-dark .bg-circle {
  opacity: 0.12;
}

.login-page.theme-dark .embossed-panel {
  background: linear-gradient(145deg, #161822 0%, #12141c 48%, #0e1018 100%);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.04),
    inset -3px -3px 8px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-page.theme-dark .card-face.front .embossed-panel,
.login-page.theme-dark .card-face.back .embossed-panel {
  box-shadow:
    0 0 0 2px transparent,
    inset 2px 2px 4px rgba(255, 255, 255, 0.04),
    inset -3px -3px 8px rgba(0, 0, 0, 0.55),
    0 0 35px rgba(34, 211, 238, 0.08);
}

.login-page.theme-dark .logo-circle {
  width: 72px;
  height: 72px;
  padding: 3px;
  background: conic-gradient(from var(--electric-angle), #22d3ee, #6366f1, #ec4899, #22d3ee);
  animation: electric-spin 3.5s linear infinite;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.login-page.theme-dark .logo-circle img {
  border: 3px solid #12141c;
}

.login-page.theme-dark .auth-title {
  color: #f8fafc;
}

.login-page.theme-dark .auth-subtitle {
  color: #94a3b8;
}

.login-page.theme-dark .alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  box-shadow: none;
}

.login-page.theme-dark .alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #bbf7d0;
  box-shadow: none;
}

.login-page.theme-dark .input-inner {
  background: #0c0e16;
  box-shadow:
    inset 3px 3px 8px rgba(0, 0, 0, 0.65),
    inset -2px -2px 6px rgba(255, 255, 255, 0.03);
}

.login-page.theme-dark .input-inner input {
  color: #f1f5f9;
}

.login-page.theme-dark .input-inner label {
  color: #94a3b8;
}

.login-page.theme-dark .electric-border,
.login-page.theme-dark .electric-glow {
  background: conic-gradient(from var(--electric-angle), #22d3ee, #6366f1, #ec4899, #a855f7, #22d3ee);
}

.login-page.theme-dark .remember-me span {
  color: #94a3b8;
}

.login-page.theme-dark .remember-me input[type='checkbox'] {
  accent-color: #6366f1;
}

.login-page.theme-dark .link-muted {
  color: #818cf8;
}

.login-page.theme-dark .link-muted:hover {
  color: #a5b4fc;
}

.login-page.theme-dark .main-btn {
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-page.theme-dark .main-btn:hover {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.login-page.theme-dark .main-btn:active {
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
