/* ############################################################################
   STATISIN — auth.css v2 (Masuk & Daftar)
   Satu panel ber-sudut bulat di atas latar lavender; kanan ungu brand dengan
   plot + tabel APA. IBM Plex Sans/Mono — satu keluarga dengan halaman analisis.
   ############################################################################ */
:root {
  --ink: #231f2b; --ink-2: #4a4554; --muted: #6e687a;
  --canvas: #eeebf5; --paper: #ffffff;
  --line: #ddd8e8; --line-strong: #c4bdd4;
  --brand: #6b5b8d; --brand-ink: #4d4167; --brand-tint: #eeebf4; --brand-wash: #f7f5fa;
  --art: #5f4f84; --art-2: #6b5b8d;
  --danger: #b23b3b; --ok: #2f7d5b;
  --focus: 0 0 0 3px rgba(107, 91, 141, .28);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { font: 15px/1.55 var(--sans); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(107, 91, 141, .2); }
a { color: inherit; }
[hidden] { display: none !important; }

/* ── Kerangka ─────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-shell {
  width: 100%; max-width: 1140px; min-height: min(760px, calc(100vh - 56px));
  display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.08fr);
  background: var(--paper); border-radius: 24px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(52, 40, 84, .06), 0 32px 64px -28px rgba(52, 40, 84, .30);
}
.auth-form-col { display: flex; flex-direction: column; padding: 32px 56px 28px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 19px; letter-spacing: -.015em; border-radius: 8px; }
.brand img { width: 36px; height: 36px; display: block; }
.brand:focus-visible { outline: none; box-shadow: var(--focus); }

.lang-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--brand-wash); border: 1px solid var(--line); border-radius: 10px; }
.lang-switch button { border: 0; background: transparent; cursor: pointer; padding: 5px 10px; border-radius: 7px; font: 500 12px/1 var(--mono); color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--paper); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(52, 40, 84, .12); }
.lang-switch button:focus-visible { outline: none; box-shadow: var(--focus); }

.auth-body { margin: auto 0; padding: 40px 0 32px; width: 100%; max-width: 392px; }
.auth-title { font-size: 30px; line-height: 1.18; font-weight: 600; letter-spacing: -.022em; }
.auth-lede { margin: 10px 0 30px; color: var(--muted); max-width: 38ch; }

/* ── Formulir ─────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field > label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.control { position: relative; }
.control-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9b94ab; pointer-events: none; transition: color .15s ease; }
.input {
  width: 100%; height: 48px; padding: 0 14px 0 44px;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #aaa3b8; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.control:focus-within .control-icon { color: var(--brand); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(178, 59, 59, .18); }
.control--pw .input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #8a839a; cursor: pointer;
}
.pw-toggle:hover { background: var(--brand-tint); color: var(--brand-ink); }
.pw-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.pw-toggle svg { width: 19px; height: 19px; }

.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.field-head label { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.link-sm { font-size: 13px; color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; border-radius: 4px; }
.link-sm:hover { color: var(--brand); }
.link-sm:focus-visible { outline: none; box-shadow: var(--focus); }
.notice a { color: inherit; font-weight: 600; }
.hint { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.field-error { margin-top: 7px; font-size: 12.5px; color: var(--danger); }
.field-error:empty { display: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.meter span { height: 4px; border-radius: 2px; background: var(--line); transition: background-color .2s ease; }
.meter[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.meter[data-level="2"] span:nth-child(-n+2) { background: #c4862b; }
.meter[data-level="3"] span:nth-child(-n+3) { background: #6f8f3a; }
.meter[data-level="4"] span { background: var(--ok); }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meter-label { font: 500 12px var(--mono); color: var(--muted); min-width: 6ch; text-align: right; }

.btn-primary, .btn-secondary {
  width: 100%; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; font: 600 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn-primary { margin-top: 6px; border: 0; background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(52, 40, 84, .18), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-primary:focus-visible, .btn-secondary:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary[disabled] { opacity: .75; cursor: progress; }
.btn-secondary { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--brand-wash); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 16px; font-size: 13.5px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-terms { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-terms a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

.notice { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 22px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.notice svg { flex: 0 0 auto; margin-top: 2px; }
.notice--error { background: #fbf1f1; border-color: #efcfcf; color: #7d2626; }
.notice--ok { background: #eff7f2; border-color: #cbe5d6; color: #205a40; }
.notice--info { background: #f4f2f9; border-color: #ddd6ea; color: var(--brand-ink); }

.auth-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.auth-foot a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border-radius: 4px; }
.auth-foot a:hover { color: var(--brand-ink); }
.auth-foot a:focus-visible { outline: none; box-shadow: var(--focus); }

/* ── Panel ungu: plot + tabel APA ─────────────────────────────────────── */
.auth-art { position: relative; display: flex; align-items: center; background: var(--art); color: #fff; padding: 48px clamp(28px, 4.2vw, 60px); overflow: hidden; }
.auth-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .10), transparent 55%); pointer-events: none; }
.art-inner { position: relative; width: 100%; max-width: 540px; margin: 0 auto; }
.art-head { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.22; font-weight: 600; letter-spacing: -.02em; max-width: 26ch; margin-bottom: 26px; text-wrap: balance; }
.art-figure { position: relative; }
.art-plot-wrap { border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); padding: 14px 12px 48px 4px; }
.art-plot { width: 100%; height: auto; display: block; overflow: visible; }
.art-grid line { stroke: rgba(255, 255, 255, .10); stroke-width: 1; }
.art-band { fill: rgba(255, 255, 255, .14); }
.art-points circle { fill: #ffffff; fill-opacity: .78; }
.art-line { fill: none; stroke: #ffd98a; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: art-draw 1.1s cubic-bezier(.3, .7, .2, 1) .35s forwards; }
@keyframes art-draw { to { stroke-dashoffset: 0; } }
.art-ticks text { font: 11px var(--mono); fill: rgba(255, 255, 255, .62); }
.art-axis { font: 500 12px var(--sans); fill: rgba(255, 255, 255, .72); }
.art-card {
  position: relative; margin: -40px 0 0 auto; width: min(400px, 92%);
  background: #fff; color: var(--ink); border-radius: 14px; padding: 14px 16px 12px;
  box-shadow: 0 18px 40px -16px rgba(20, 12, 40, .45);
}
.art-card-title { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.art-card-title b { font-weight: 600; color: var(--ink); margin-right: 4px; }
.apa { width: 100%; border-collapse: collapse; font: 12.5px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.apa th, .apa td { padding: 5px 6px; text-align: right; white-space: nowrap; }
.apa th:first-child, .apa td:first-child { text-align: left; font-family: var(--sans); }
.apa thead th { font: italic 500 12.5px var(--sans); color: var(--ink-2); border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); }
.apa thead th:first-child { font-style: normal; }
.apa tbody tr:last-child td { border-bottom: 1.5px solid var(--ink); }
.apa-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
.apa-note i, .art-card i { font-style: italic; }
.nw { white-space: nowrap; }
.art-note { margin-top: 22px; font-size: 13.5px; color: rgba(255, 255, 255, .78); max-width: 48ch; }

/* ── Responsif & aksesibilitas ───────────────────────────────────────── */
@media (max-width: 1040px) { .auth-form-col { padding: 28px 40px 24px; } }
@media (max-width: 920px) {
  .auth { padding: 0; place-items: stretch; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 0; box-shadow: none; min-height: 100vh; max-width: none; }
  .auth-form-col { padding: 20px 22px 24px; }
  .auth-body { max-width: 440px; margin: 0 auto; padding-top: 40px; }
  .auth-art { display: none; }
}
@media (max-height: 760px) and (min-width: 921px) { .art-head { margin-bottom: 18px; } .art-note { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .art-line { animation: none; stroke-dashoffset: 0; }
  .input, .btn-primary, .btn-secondary, .meter span, .control-icon { transition: none; }
}

/* ── v13: tab, validasi langsung, Caps Lock, aturan sandi, pemuatan, seluler ─ */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 28px; background: var(--brand-wash); border: 1px solid var(--line); border-radius: 12px; }
.auth-tab { display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.auth-tab:hover { color: var(--brand-ink); }
.auth-tab.is-active { background: var(--paper); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(52, 40, 84, .14); }
.auth-tab:focus-visible { outline: none; box-shadow: var(--focus); }
.control.is-valid .input:not(:focus) { border-color: #a9d3bb; }
.control.is-valid::after { content: ''; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f7d5b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 16px; pointer-events: none; }
.control--pw.is-valid::after { right: 52px; }
.control.is-valid .input { padding-right: 40px; }
.control--pw.is-valid .input { padding-right: 76px; }
.caps-hint { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: #8a5a0f; }
.caps-hint::before { content: '⇪'; font-size: 14px; }
.email-suggest { color: var(--ink-2); }
.email-suggest .link-sm { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; }
.check-row { display: flex; align-items: center; gap: 9px; margin: -4px 0 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.pw-rules { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 7px; transition: color .15s ease; }
.pw-rules li::before { content: ''; flex: 0 0 14px; width: 14px; height: 14px; border: 1.5px solid var(--line-strong); border-radius: 50%; box-sizing: border-box; }
.pw-rules li.is-ok { color: #205a40; }
.pw-rules li.is-ok::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 10px; }
.user-hint.is-ok { color: var(--ok); font-weight: 600; }
.user-hint.is-bad { color: var(--danger); font-weight: 600; }
.user-hint:empty { display: none; }
.btn-primary.is-loading span::before { content: ''; display: inline-block; width: 15px; height: 15px; margin-right: 9px; vertical-align: -2px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.art-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 13px; color: rgba(255, 255, 255, .88); }
.art-trust li { display: inline-flex; align-items: center; gap: 7px; }
.art-trust svg { color: #ffd98a; flex: 0 0 auto; }
@media (max-width: 920px) {
  .auth-top { margin: -20px -22px 4px; padding: 16px 22px; background: var(--art); }
  .auth-top .brand { color: #fff; }
  .auth-top .brand img { background: #fff; border-radius: 50%; padding: 2px; }
  .auth-top .lang-switch { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
  .auth-top .lang-switch button { color: rgba(255, 255, 255, .82); }
  .auth-top .lang-switch button[aria-pressed="true"] { background: #fff; color: var(--brand-ink); }
  .auth-body { padding-top: 28px; }
  .pw-rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .btn-primary.is-loading span::before { animation: none; } .auth-tab, .pw-rules li { transition: none; } }
