/* =====================================================================
   SEMURNI EMAS — GOLD BUYING MANAGEMENT SYSTEM
   Login Page Stylesheet
   ===================================================================== */

/* ============ 1. DESIGN TOKENS ============ */
:root {
  /* Backgrounds */
  --bg-950: #050505;
  --bg-900: #0b0b0b;
  --bg-850: #101010;
  --bg-800: #181818;
  --bg-glass: rgba(20, 20, 20, 0.75);

  /* Brand */
  --brand-red: #e2900a;
  --brand-orange: #ff7b00;
  --brand-gold: #ffd200;
  --brand-black: #0d0d0d;
  --brand-gray: #1d1d1d;

  --brand-gradient: linear-gradient(
    135deg,
    var(--brand-red) 0%,
    var(--brand-orange) 50%,
    var(--brand-gold) 100%
  );
  --brand-gradient-soft: linear-gradient(
    135deg,
    rgba(226, 144, 10, 0.16),
    rgba(255, 123, 0, 0.16),
    rgba(255, 210, 0, 0.16)
  );

  /* Text */
  --text-primary: #f5f5f5;
  --text-secondary: #9a9a9a;
  --text-muted: #6d6d6d;

  /* Elevation */
  --shadow-card:
    0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-btn: 0 10px 30px -8px rgba(255, 123, 0, 0.45);

  --radius-card: 28px;
  --radius-field: 16px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============ 2. RESET & BASE ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden; /* no scrollbar, ever */
}

body {
  margin: 0;
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg-950);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

a {
  text-decoration: none;
}
button {
  font-family: inherit;
}

::selection {
  background: rgba(255, 210, 0, 0.25);
  color: #fff;
}

/* Visible keyboard focus (accessibility floor) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Email & password inputs already show focus via .input-shell's own
   border-glow (see section 7), so the default outline above would
   double up and look messy — turn it off just for these fields. */
.field-control:focus-visible {
  outline: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ 3. BACKGROUND SCENE ============ */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(
    120% 90% at 50% -10%,
    var(--bg-850) 0%,
    var(--bg-900) 35%,
    var(--bg-950) 100%
  );
}

/* Floating ambient orbs — kept small & faint so black stays dominant */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.28;
  will-change: transform;
}

.orb-red {
  width: 30vw;
  height: 30vw;
  max-width: 420px;
  max-height: 420px;
  top: -12%;
  left: -10%;
  background: var(--brand-red);
  opacity: 0.12;
  animation: float-a 26s ease-in-out infinite;
}

.orb-orange {
  width: 24vw;
  height: 24vw;
  max-width: 340px;
  max-height: 340px;
  bottom: -14%;
  right: -8%;
  background: var(--brand-orange);
  opacity: 0.1;
  animation: float-b 32s ease-in-out infinite;
}

.orb-gold {
  width: 18vw;
  height: 18vw;
  max-width: 260px;
  max-height: 260px;
  top: 55%;
  left: 62%;
  background: var(--brand-gold);
  opacity: 0.07;
  animation: float-c 22s ease-in-out infinite;
}

@keyframes float-a {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(4vw, 5vh) scale(1.08);
  }
}
@keyframes float-b {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-5vw, -4vh) scale(1.06);
  }
}
@keyframes float-c {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-3vw, 4vh) scale(1.1);
  }
}

/* Subtle noise texture for premium tactility */
.noise-layer {
  position: absolute;
  inset: -10%;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* Edge vignette to keep focus centered */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    120% 100% at 50% 50%,
    transparent 35%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* Mouse-follow ambient glow */
.mouse-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 210, 0, 0.1) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  left: 50%;
  top: 40%;
  pointer-events: none;
  transition:
    left 0.25s var(--ease-out),
    top 0.25s var(--ease-out);
  z-index: 1;
}

/* ============ 4. STAGE (centering layout) ============ */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ============ 5. LOGIN CARD ============ */
.login-card {
  position: relative;
  width: 430px;
  max-width: 100%;
  border-radius: var(--radius-card);
  isolation: isolate;
}

/* Animated conic-gradient light border */
.card-border-glow {
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from 0deg,
    var(--brand-red),
    var(--brand-orange),
    var(--brand-gold),
    var(--brand-orange),
    var(--brand-red),
    var(--brand-orange),
    var(--brand-gold),
    var(--brand-red)
  );
  animation: spin-border 7s linear infinite;
  filter: blur(0.5px);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 0;
}

/* Soft halo glow around the whole card */
.login-card::after {
  content: "";
  position: absolute;
  inset: -40px;
  border-radius: 44px;
  background: radial-gradient(
    closest-side,
    rgba(255, 123, 0, 0.16),
    transparent 75%
  );
  z-index: -1;
  animation: pulse-halo 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes spin-border {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse-halo {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.card-inner {
  position: relative;
  z-index: 1;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px 34px 32px;
  overflow: hidden;
}

/* Light sweep reflection across glass */
.card-glass-reflection {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}
.card-glass-reflection::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -60%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 45%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.05) 55%,
    transparent 100%
  );
  transform: rotate(12deg);
  animation: light-sweep 8s ease-in-out infinite;
}
@keyframes light-sweep {
  0% {
    left: -60%;
  }
  45% {
    left: 130%;
  }
  100% {
    left: 130%;
  }
}

/* ============ 6. HEADER ============ */
.card-header {
  margin-bottom: 28px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
  margin-bottom: 14px;
}

.brand-logo {
  max-height: 84px;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(255, 123, 0, 0.35));
}

/* Fallback logo image (mirrors .brand-logo styling) if primary asset is unavailable */
.logo-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: "Poppins", sans-serif;
}
.logo-fallback-img {
  max-height: 84px;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(255, 123, 0, 0.35));
}

.system-tag {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-gold);
  opacity: 0.85;
  margin: 0 0 18px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.welcome-subtitle {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

/* ============ 7. FORM FIELDS ============ */
.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-field);
  transition:
    border-color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
}

.input-shell:focus-within {
  border-color: var(--brand-gold);
  background: rgba(255, 210, 0, 0.04);
  box-shadow:
    0 0 0 4px rgba(255, 210, 0, 0.1),
    0 0 22px rgba(255, 210, 0, 0.14);
}

.field-icon {
  color: var(--text-muted);
  font-size: 15px;
  margin-left: 16px;
  transition:
    color 0.25s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.input-shell:focus-within .field-icon {
  color: var(--brand-gold);
  transform: scale(1.08);
}

.field-control {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 400;
  padding: 14px 14px 14px 12px;
  font-family: inherit;
}

.field-control::placeholder {
  color: var(--text-muted);
}

.toggle-visibility {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0 16px;
  font-size: 15px;
  cursor: pointer;
  transition:
    color 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.toggle-visibility:hover {
  color: var(--brand-gold);
  transform: scale(1.12);
}

.field-error {
  min-height: 18px;
  font-size: 12px;
  color: var(--brand-red);
  margin-top: 6px;
  padding-left: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.2s var(--ease-out),
    transform 0.2s var(--ease-out);
}
.field-error.show {
  opacity: 1;
  transform: translateY(0);
}

.input-shell.is-invalid {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(226, 144, 10, 0.1);
}

/* ============ 8. META ROW (remember / forgot) ============ */
.field-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.remember-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.remember-check input {
  display: none;
}
.checkbox-visual {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s var(--ease-out);
}
.remember-check input:checked + .checkbox-visual {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #0d0d0d;
}
.remember-text {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.forgot-link {
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease-out);
}
.forgot-link:hover {
  color: var(--brand-gold);
}

/* ============ 9. LOGIN BUTTON ============ */
.btn-login {
  position: relative;
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 20px;
  background: linear-gradient(
    120deg,
    var(--brand-red) 0%,
    var(--brand-orange) 50%,
    var(--brand-gold) 100%
  );
  background-size: 200% 200%;
  color: #1a0d00;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-btn);
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    background-position 0.6s var(--ease-out);
  animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 40px -10px rgba(255, 123, 0, 0.6),
    0 0 30px rgba(255, 210, 0, 0.25);
}
.btn-login:active {
  transform: translateY(0);
}

.btn-login-label,
.btn-login-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #1a0d00;
}

.btn-login-spinner {
  display: none;
}

.btn-login.is-loading .btn-login-label {
  display: none;
}
.btn-login.is-loading .btn-login-spinner {
  display: inline-flex;
}
.btn-login.is-loading {
  cursor: not-allowed;
  opacity: 0.92;
}

/* Shine sweep on the button */
.btn-login::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-20deg);
  animation: shine-btn 3.5s ease-in-out infinite;
}
@keyframes shine-btn {
  0% {
    left: -75%;
  }
  35% {
    left: 130%;
  }
  100% {
    left: 130%;
  }
}

/* ============ 10. DIVIDER ============ */
.divider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 20px;
}
.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.14),
    transparent
  );
}
.divider-text {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============ 11. SOCIAL BUTTONS ============ */
.social-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.btn-social:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.social-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-icon {
  font-size: 16px;
  transition: transform 0.2s var(--ease-out);
}
.btn-social:hover .social-icon {
  transform: scale(1.12);
}

.social-arrow {
  color: var(--text-muted);
  font-size: 14px;
  transition:
    transform 0.25s var(--ease-out),
    color 0.25s var(--ease-out);
}
.btn-social:hover .social-arrow {
  transform: translateX(3px);
  color: var(--brand-gold);
}

/* ============ 12. FOOTER ============ */
.card-footer {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}
.footer-text {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.footer-link {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  margin-left: 5px;
  position: relative;
  transition: color 0.25s var(--ease-out);
}
.footer-link:hover {
  color: var(--brand-gold);
}

/* ============ 13. TOAST ============ */
.toast {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 210, 0, 0.25);
  border-radius: 16px;
  box-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(255, 210, 0, 0.12);
  color: var(--text-primary);
  margin-top: 8px;
}
.toast-icon {
  color: #33d17a;
  margin-right: 8px;
  font-size: 15px;
}
.toast-body {
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 4px 2px;
}

/* Varian danger, dipakai saat login gagal (kredensial salah / akun nonaktif) */
.toast.toast-danger {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(239, 68, 68, 0.15);
}
.toast-icon.toast-icon-danger {
  color: #ef4444;
}

/* ============ 14. RESPONSIVE ============ */
@media (max-width: 480px) {
  .stage {
    padding: 16px;
  }
  .card-inner {
    padding: 32px 22px 26px;
  }
  .welcome-title {
    font-size: 24px;
  }
  .logo-wrap {
    height: 68px;
  }
  .brand-logo,
  .logo-fallback-img {
    max-height: 68px;
    max-width: 160px;
  }
  .orb-red,
  .orb-orange,
  .orb-gold {
    filter: blur(70px);
  }
}

@media (max-height: 700px) {
  .card-header {
    margin-bottom: 18px;
  }
  .logo-wrap {
    height: 56px;
    margin-bottom: 8px;
  }
  .brand-logo,
  .logo-fallback-img {
    max-height: 56px;
  }
  .welcome-title {
    font-size: 22px;
  }
  .field-group {
    margin-bottom: 12px;
  }
  .divider-row {
    margin: 16px 0 14px;
  }
  .social-stack {
    margin-bottom: 18px;
    gap: 8px;
  }
  .btn-social {
    padding: 10px 16px;
  }
  .card-inner {
    padding: 26px 30px 20px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .login-card {
    width: 420px;
  }
}
