/* Login affiliate - tema terang zamrud + emas, layout terbagi dua.
   Sengaja berbeda dari login admin (/console: tema gelap biru-ungu) agar mudah dibedakan. */
:root {
  --af-ink: #0b2723;
  --af-deep: #052e2b;
  --af-teal: #0f766e;
  --af-teal-2: #14b8a6;
  --af-gold: #f2c14e;
  --af-muted: #6b7f7b;
  --af-line: #d6e2df;
  --af-bg: #f6faf9;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }

body.af-login {
  min-height: 100vh;
  font-family: "Source Sans Pro", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #2c403c;
  background: var(--af-bg);
}

.af-split { display: flex; min-height: 100vh; }

/* ================= PANEL BRAND (kiri) ================= */
.af-brand {
  position: relative;
  flex: 0 0 46%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  color: #eafaf6;
  overflow: hidden;
  contain: paint;
  background: linear-gradient(140deg, #031f1d, #07433e, #0b6a60, #064a44);
  background-size: 300% 300%;
  animation: afGradient 16s ease infinite;
}
.af-brand::after { /* pola titik halus */
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.af-orb { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.af-orb.o1 { width: 320px; height: 320px; top: -90px; right: -80px; background: radial-gradient(circle, rgba(20, 184, 166, .65), transparent 70%); animation: afFloatA 13s ease-in-out infinite; }
.af-orb.o2 { width: 280px; height: 280px; bottom: 120px; left: -90px; background: radial-gradient(circle, rgba(242, 193, 78, .35), transparent 70%); animation: afFloatB 16s ease-in-out infinite; }

.af-logo {
  position: relative; z-index: 1;
  align-self: flex-start;
  height: 66px;
  padding: 8px 18px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .55);
  animation: afFadeDown .8s ease both;
}

.af-brand-copy { position: relative; z-index: 1; max-width: 420px; }
.af-pill {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid rgba(242, 193, 78, .6);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--af-gold);
  background: rgba(242, 193, 78, .08);
  animation: afFadeUp .8s ease .2s both;
}
.af-brand-copy h2 {
  margin: 16px 0 12px;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: 1.15;
  font-weight: 700;
  color: #fff;
  animation: afFadeUp .8s ease .3s both;
}
.af-brand-copy p { margin: 0; font-size: 1.02rem; line-height: 1.6; color: rgba(234, 250, 246, .78); animation: afFadeUp .8s ease .4s both; }

/* grafik animasi: batang naik-turun + garis tren */
.af-chart { position: relative; z-index: 1; width: 100%; max-width: 440px; height: 150px; margin-top: 24px; animation: afFadeUp .8s ease .5s both; }
.af-chart .bar { fill: rgba(255, 255, 255, .16); transform-box: fill-box; transform-origin: bottom; animation: afBar 4.6s ease-in-out infinite; }
.af-chart .bar.hi { fill: var(--af-gold); }
.af-chart .bar:nth-child(1) { animation-delay: 0s; }
.af-chart .bar:nth-child(2) { animation-delay: .3s; }
.af-chart .bar:nth-child(3) { animation-delay: .6s; }
.af-chart .bar:nth-child(4) { animation-delay: .9s; }
.af-chart .bar:nth-child(5) { animation-delay: 1.2s; }
.af-chart .bar:nth-child(6) { animation-delay: 1.5s; }
.af-chart .bar:nth-child(7) { animation-delay: 1.8s; }
.af-chart .trend { fill: none; stroke: var(--af-teal-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 620; stroke-dashoffset: 620; animation: afDraw 5s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(20, 184, 166, .8)); }
.af-chart .dot { fill: #fff; opacity: 0; animation: afDot 5s ease-in-out infinite; }

/* ================= PANEL FORM (kanan) ================= */
.af-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, .10), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(242, 193, 78, .12), transparent 40%),
    var(--af-bg);
}
.af-card { width: 100%; max-width: 390px; animation: afSlideIn .8s cubic-bezier(.2, .8, .2, 1) .15s both; }
.af-card.af-shake { animation: afShake .5s cubic-bezier(.36, .07, .19, .97) both; }

.af-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--af-teal);
  background: rgba(15, 118, 110, .09);
}
.af-badge i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--af-teal); font-size: .7rem; }
.af-title { margin: 14px 0 4px; font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 700; color: var(--af-ink); }
.af-sub { margin: 0 0 26px; color: var(--af-muted); font-size: .98rem; }

.af-field { margin-bottom: 18px; animation: afSlideIn .7s ease both; }
.af-field:nth-of-type(1) { animation-delay: .3s; }
.af-field:nth-of-type(2) { animation-delay: .4s; }
.af-captcha-group { animation: afSlideIn .7s ease .5s both; }
.af-submit { animation: afSlideIn .7s ease .6s both; }

/* input bergaya garis bawah */
.af-input {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  border-bottom: 2px solid var(--af-line);
  transition: border-color .25s ease;
}
.af-input::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--af-teal), var(--af-teal-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.af-input:focus-within::after { transform: scaleX(1); }
.af-input.is-invalid { border-bottom-color: #e0535a; }
.af-input.is-invalid::after { background: #e0535a; transform: scaleX(1); }
.af-input .af-ico { width: 34px; color: #9db1ad; transition: color .25s ease; text-align: left; }
.af-input:focus-within .af-ico { color: var(--af-teal); }
.af-input input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0; outline: 0;
  background: transparent;
  font-size: 1.02rem;
  font-family: inherit;
  color: var(--af-ink);
}
.af-input input::placeholder { color: #9db1ad; }
.af-input .af-eye { border: 0; background: transparent; width: 36px; height: 100%; color: #9db1ad; cursor: pointer; }
.af-input .af-eye:hover, .af-input .af-eye:focus { outline: none; color: var(--af-teal); }

/* captcha */
.af-captcha-row { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.af-captcha-box {
  position: relative;
  flex: 0 0 170px; width: 170px; max-width: 100%;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--af-line);
  background: #eef5f3;
}
.af-captcha-box img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; transition: opacity .25s ease; }
.af-captcha-box.is-loading img { opacity: .25; }
.af-captcha-msg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; align-items: center; justify-content: center; padding: 0 6px; font-size: .78rem; color: #c0392b; text-align: center; }
.af-captcha-box.is-error .af-captcha-msg { display: flex; }
.af-captcha-box.is-error img { visibility: hidden; }
.af-captcha-hint { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.3; color: var(--af-muted); }
.af-refresh {
  flex: 0 0 48px; width: 48px; height: 48px;
  border: 1px solid var(--af-line);
  border-radius: 50%;
  background: #fff;
  color: var(--af-teal);
  cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .15s ease, box-shadow .25s ease;
}
.af-refresh:hover { background: var(--af-teal); color: #fff; box-shadow: 0 8px 18px -8px rgba(15, 118, 110, .8); }
.af-refresh:active { transform: scale(.92); }
.af-refresh:focus { outline: none; box-shadow: 0 0 0 .2rem rgba(20, 184, 166, .25); }
.af-refresh.is-spinning i { animation: afSpin .6s linear; }
#af_captcha { letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
#af_captcha::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; }

.af-alert {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border-left: 4px solid #e0535a;
  font-size: .92rem;
  color: #8f1d24;
  background: #fdeff0;
  animation: afSlideIn .4s ease both;
}
.af-alert[hidden] { display: none; }

/* tombol bentuk pil + panah */
.af-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .6px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--af-teal), var(--af-teal-2));
  box-shadow: 0 14px 26px -12px rgba(15, 118, 110, .9);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  overflow: hidden;
}
.af-btn .af-btn-arrow { transition: transform .25s ease; }
.af-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 30px -14px rgba(15, 118, 110, .95); filter: brightness(1.05); }
.af-btn:hover:not(:disabled) .af-btn-arrow { transform: translateX(5px); }
.af-btn:active:not(:disabled) { transform: translateY(0); }
.af-btn:focus { outline: none; box-shadow: 0 0 0 .22rem rgba(20, 184, 166, .35), 0 14px 26px -12px rgba(15, 118, 110, .9); }
.af-btn:disabled { cursor: wait; opacity: .88; }
.af-btn .af-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: afSpin .7s linear infinite; }
.af-btn.is-loading .af-spinner { display: inline-block; }
.af-btn.is-loading .af-btn-arrow { display: none; }

.af-foot { margin: 22px 0 0; text-align: center; font-size: .82rem; color: #93a7a3; }

@keyframes afGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes afFloatA { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-60px, 60px); } }
@keyframes afFloatB { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(70px, -50px); } }
@keyframes afFadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes afFadeDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes afSlideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes afSpin { to { transform: rotate(360deg); } }
@keyframes afBar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes afDraw { 0% { stroke-dashoffset: 620; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -620; } }
@keyframes afDot { 0%, 50% { opacity: 0; } 60%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes afShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* ================= RESPONSIF ================= */
@media (max-width: 420px) { .af-captcha-hint { display: none; } }

@media (max-width: 880px) {
  .af-split { flex-direction: column; }
  .af-brand { flex: 0 0 auto; padding: 22px 22px 26px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
  .af-logo { height: 52px; padding: 6px 14px; }
  .af-brand-copy { max-width: none; flex: 1 1 200px; }
  .af-brand-copy h2 { font-size: 1.35rem; margin: 8px 0 0; }
  .af-brand-copy p, .af-chart { display: none; }
  .af-main { align-items: flex-start; padding: 28px 22px 40px; }
  .af-title { font-size: 1.7rem; }
}

/* hormati pengguna yang mematikan animasi di sistemnya */
@media (prefers-reduced-motion: reduce) {
  .af-brand, .af-orb, .af-logo, .af-pill, .af-brand-copy h2, .af-brand-copy p, .af-chart,
  .af-chart .bar, .af-chart .trend, .af-chart .dot, .af-card, .af-card.af-shake, .af-field,
  .af-captcha-group, .af-submit, .af-alert { animation: none !important; }
  .af-chart .trend { stroke-dashoffset: 0; }
  .af-chart .dot { opacity: 1; }
  .af-btn, .af-btn .af-btn-arrow, .af-input, .af-input::after, .af-refresh { transition: none !important; }
}
