* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #0b0b0b;
  --ink-soft: #2a2a2a;
  --muted: #78716c;
  --line: #e5e1d8;
  --accent: #d8f34a;
  --accent-deep: #b6d92e;
  --danger: #e5484d;
  --border: 2px solid var(--ink);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background grid halus */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(11,11,11,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,11,11,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

body > * { position: relative; z-index: 1; }

/* ---------- LAYOUT ---------- */
.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* ---------- ASIDE ---------- */
.auth-aside {
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: var(--border);
  position: relative;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border: var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.2s ease;
}

.logo:hover .logo-mark { transform: rotate(-8deg); }
.logo-mark svg { width: 16px; height: 16px; }

.aside-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px 0;
}

.aside-content h1 {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.aside-content h1 .mark {
  display: inline-block;
  background: var(--accent);
  padding: 2px 12px 5px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1deg);
  margin-top: 6px;
}

.aside-content p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 420px;
}

.aside-foot {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- ASIDE ART (animasi) ---------- */
.aside-art {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 1;
  align-self: center;
  isolation: isolate;
}

/* Ring putus-putus berputar di belakang */
.ring-orbit {
  position: absolute;
  inset: -16px;
  border: 2px dashed rgba(11, 11, 11, 0.18);
  border-radius: 50%;
  animation: spin 26s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Wrapper yang berputar — bola jadi orbit sempurna di ukuran apa pun */
.orbit-wrap {
  position: absolute;
  inset: 0;
  z-index: 6;
  animation: spin 9s linear infinite;
  pointer-events: none;
  will-change: transform;
}

/* Bola utama */
.bouncer {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.95), transparent 55%),
    var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  animation: ball-spin 9s linear infinite;
  will-change: transform;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes ball-spin {
  to { transform: rotate(-720deg); }
}

/* Kartu geometris */
.art-card {
  position: absolute;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
}

.art-card--1 {
  width: 58%; height: 58%;
  top: 0; left: 0;
  background: var(--accent);
  border-radius: var(--radius-lg);
}
.art-card--1 .inner-shape {
  width: 42%; aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.art-card--2 {
  width: 46%; height: 46%;
  bottom: 0; right: 0;
  background: var(--ink);
  border-radius: var(--radius-lg);
}
.art-card--2 .inner-dot {
  width: 34%; aspect-ratio: 1;
  background: var(--accent);
  border-radius: 50%;
}

.art-card--3 {
  width: 30%; height: 30%;
  bottom: 14%; left: 6%;
  background: var(--surface);
  border-radius: 50%;
}
.art-card--3 .inner-cross {
  width: 40%; height: 40%;
  position: relative;
}
.art-card--3 .inner-cross::before,
.art-card--3 .inner-cross::after {
  content: ''; position: absolute; background: var(--ink); border-radius: 2px;
}
.art-card--3 .inner-cross::before {
  top: 50%; left: 0; width: 100%; height: 2.5px; transform: translateY(-50%);
}
.art-card--3 .inner-cross::after {
  left: 50%; top: 0; width: 2.5px; height: 100%; transform: translateX(-50%);
}

.art-card--4 {
  width: 22%; height: 22%;
  top: 4%; right: 8%;
  border-radius: var(--radius-sm);
}
.art-card--4 .inner-square {
  width: 40%; aspect-ratio: 1;
  background: var(--ink);
  border-radius: 3px;
}

/* Hormati preferensi reduce-motion */
@media (prefers-reduced-motion: reduce) {
  .ring-orbit,
  .orbit-wrap,
  .bouncer {
    animation: none;
  }
  .bouncer { top: 50%; margin-top: -19px; }
}

/* ---------- MAIN / FORM ---------- */
.auth-main {
  padding: 40px 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-card .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  padding: 5px 12px;
  margin-bottom: 18px;
  box-shadow: 2px 2px 0 var(--ink);
}

.auth-card h2 {
  font-size: 1.75rem;
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

.auth-card .sub {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ---------- FORM ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Input */
.input {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* cegah iOS auto-zoom saat fokus */
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  outline: none;
  transition: box-shadow 0.15s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
}

.input::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .input:hover { background: #fffef7; }
}

.input:focus {
  background: #fffef7;
  box-shadow: 3px 3px 0 var(--accent);
}

.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 3px 3px 0 var(--danger);
}

/* ---------- PASSWORD WRAPPER + TOGGLE ---------- */
.input-wrap {
  position: relative;
  display: block;
}

.input-wrap .input {
  padding-right: 58px;
}

.toggle-pass {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);

  /* Touch target memadai */
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;

  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.15s ease,
              background 0.2s ease;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Hover hanya bila perangkat punya kursor presisi */
@media (hover: hover) and (pointer: fine) {
  .toggle-pass:hover { background: var(--accent); }
}

.toggle-pass:active {
  transform: translateY(-50%) translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
  background: var(--accent-deep);
}

.toggle-pass:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-pass svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: block;
}

.toggle-pass .icon-eye-off { display: none; }
.toggle-pass.is-visible .icon-eye { display: none; }
.toggle-pass.is-visible .icon-eye-off { display: block; }

/* ---------- ALERTS ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 20px;
  box-shadow: 2px 2px 0 var(--ink);
}

.alert--error {
  background: #ffe9ea;
  color: #8a1418;
  border-color: var(--danger);
  box-shadow: 2px 2px 0 var(--danger);
}

.alert--success {
  background: #eaffc5;
  color: #2c4a00;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---------- BUTTON ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  padding: 14px 24px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
  background: var(--accent-deep);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn svg { width: 15px; height: 15px; }

.btn--ghost { background: var(--surface); }
.btn--ghost:hover { background: var(--bg); }

/* ---------- SWITCH LINK ---------- */
.switch {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1.5px dashed var(--line);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.switch a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
  margin-left: 4px;
}

.switch a:hover { border-bottom-color: var(--ink); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    padding: 20px 24px;
    border-right: none;
    border-bottom: var(--border);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  /* Sembunyikan teks & animasi di mobile — form jadi fokus utama */
  .aside-content,
  .aside-foot {
    display: none;
  }

  .auth-main {
    padding: 32px 24px 56px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 22px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .auth-card h2 { font-size: 1.5rem; }

  .input-wrap .input {
    padding-right: 62px;
  }

  .toggle-pass {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    right: 6px;
  }
}

/* Landscape pendek di mobile */
@media (max-height: 520px) and (max-width: 900px) {
  .auth-main { padding: 20px 24px 40px; }
  .auth-card { padding: 24px 22px; }
}