/* ARIIN ID — gaya visual (navy · emas · perak, mengikuti brand ARIIN) */
:root {
  --navy-950: #050f29;
  --navy-900: #0a1a44;
  --navy-800: #0f2560;
  --navy-700: #163486;
  --blue-600: #1846c7;
  --blue-500: #2a5be8;
  --blue-100: #dbe5ff;
  --blue-50: #eef3ff;
  --gold-300: #ffe29a;
  --gold-400: #f5b841;
  --gold-500: #e3a23a;
  --gold-600: #c98a22;
  --ink: #0e1630;
  --ink-2: #2b3554;
  --muted: #5b6683;
  --line: #e3e8f2;
  --bg: #f3f5fa;
  --card: #ffffff;
  --ok: #0b8a5f;
  --ok-bg: #e5f6ef;
  --warn: #9a6512;
  --warn-bg: #fff4dc;
  --danger: #c62f2f;
  --danger-bg: #fdeaea;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(10 26 68 / 6%), 0 8px 24px rgb(10 26 68 / 8%);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--gold-400); font-weight: 800; }

/* ---------- Tombol & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font: 700 15px/1 var(--font); cursor: pointer; text-decoration: none !important;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(42 91 232 / 35%); outline-offset: 2px;
}
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(180deg, var(--blue-500), var(--blue-600)); color: #fff; box-shadow: 0 6px 16px rgb(24 70 199 / 28%); }
.btn-primary:hover { background: linear-gradient(180deg, #3566f0, #1a4bd3); }
.btn-gold { background: linear-gradient(180deg, var(--gold-300), var(--gold-400) 45%, var(--gold-500)); color: var(--navy-900); box-shadow: 0 6px 16px rgb(201 138 34 / 30%); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: #c6cfe2; background: #fafbfe; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: rgb(14 22 48 / 5%); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #f3c9c9; }
.btn-danger-ghost:hover { background: var(--danger-bg); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span, .field-label { font-weight: 700; font-size: 13.5px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; }
.field > span a { font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #d5dcea; border-radius: 12px;
  font: 500 15px var(--font); color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b9c4db; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgb(42 91 232 / 12%); outline: none; }
input[readonly] { background: #f6f8fc; color: var(--muted); }
select:disabled { background: #f6f8fc; color: #9aa3ba; }
.input-wrap { position: relative; }
.input-wrap .toggle-pw { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font: 600 12.5px var(--font); padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.input-wrap .toggle-pw:hover { color: var(--ink); background: #f1f4fa; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); margin: 4px 0 18px; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--blue-600); }
.hint { font-size: 12.5px; color: var(--muted); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: var(--danger-bg); color: #8f1f1f; border-color: #f5caca; }
.alert-ok { background: var(--ok-bg); color: #065f41; border-color: #bfe7d6; }
.alert-warn { background: var(--warn-bg); color: #7a4f0c; border-color: #f4dca6; }
.alert-info { background: var(--blue-50); color: #1c3a8a; border-color: var(--blue-100); }
.alert .alert-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.alert > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-sm svg { width: 15px; height: 15px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-muted { background: #eef1f7; color: var(--muted); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Layout autentikasi ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.brand-panel {
  position: relative; overflow: hidden; color: #fff; padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(900px 500px at 110% -10%, rgb(42 91 232 / 55%), transparent 60%),
    radial-gradient(700px 500px at -20% 110%, rgb(245 184 65 / 22%), transparent 60%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950));
}
.brand-panel::before {
  content: ""; position: absolute; inset: 0; background: url(/static/circuit.svg) repeat; opacity: .13;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.brand-panel > * { position: relative; }
.brand-copy h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.brand-copy h2 em { font-style: normal; background: linear-gradient(90deg, var(--gold-300), var(--gold-400)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-copy p { color: #c4d1f2; font-size: 16px; max-width: 460px; }
.app-chips { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; max-width: 420px; }
.app-chips li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 9%); backdrop-filter: blur(6px); }
.app-chips .chip-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.app-chips .chip-icon svg { width: 18px; height: 18px; }
.app-chips b { font-size: 14px; letter-spacing: .02em; display: block; }
.app-chips small { color: #9fb0d9; font-size: 12.5px; }
.brand-foot { display: flex; gap: 18px; flex-wrap: wrap; color: #9fb0d9; font-size: 12.5px; }
.brand-foot span { display: inline-flex; align-items: center; gap: 6px; }
.brand-foot svg { width: 15px; height: 15px; color: var(--gold-400); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.auth-card .sub b { color: var(--ink); }
.auth-card .switch { text-align: center; margin-top: 22px; color: var(--muted); font-size: 14px; }
.continue-to { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 22px; font-size: 13.5px; color: var(--muted); }
.continue-to .app-icon { width: 30px; height: 30px; border-radius: 8px; }
.continue-to b { color: var(--ink); }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #d5dcea; }
.btn-google:hover { background: #f8f9fc; border-color: #b9c4db; }
.btn-google svg { width: 20px; height: 20px; }
.legal { margin-top: 26px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Halaman kecil (pesan, consent, logout) ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background: radial-gradient(800px 400px at 50% -10%, rgb(42 91 232 / 12%), transparent 70%), var(--bg); }
.center-card { width: 100%; max-width: 460px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; border: 1px solid var(--line); }
.center-card .brand { margin-bottom: 22px; font-size: 18px; color: var(--navy-900); }
.center-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.center-card .lead { color: var(--muted); margin-bottom: 22px; }
.center-card .stack { display: grid; gap: 10px; margin-top: 22px; }

.consent-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 20px; }
.consent-head .app-icon { width: 56px; height: 56px; border-radius: 16px; }
.consent-head .app-icon svg { width: 28px; height: 28px; }
.consent-head .link-dots { color: #aab4cc; letter-spacing: 3px; font-weight: 800; }
.consent-head img { width: 56px; height: 56px; }
.consent-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); margin-bottom: 18px; font-size: 13.5px; }
.scope-list { list-style: none; margin: 0 0 18px; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.scope-list li { display: flex; gap: 12px; padding: 12px 14px; align-items: flex-start; }
.scope-list li + li { border-top: 1px solid var(--line); }
.scope-list .scope-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; flex-shrink: 0; }
.scope-list .scope-ic svg { width: 17px; height: 17px; }
.scope-list b { display: block; font-size: 14px; }
.scope-list small { color: var(--muted); font-size: 12.5px; }

/* ---------- Dasbor ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: rgb(10 26 68 / 96%); backdrop-filter: blur(10px); color: #fff; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 24px; }
.topbar nav { display: flex; gap: 4px; margin-left: 12px; }
.topbar nav a { color: #b8c6ea; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.topbar nav a:hover { color: #fff; background: rgb(255 255 255 / 8%); text-decoration: none; }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .who form { margin: 0; }
.topbar .btn-ghost { color: #b8c6ea; }
.topbar .btn-ghost:hover { color: #fff; background: rgb(255 255 255 / 10%); }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--navy-900); display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 36px; align-items: center; margin-bottom: 36px; }
.hero-side h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.hero-side > p { color: var(--muted); font-size: 15.5px; max-width: 520px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat small { color: var(--muted); font-size: 12px; font-weight: 600; display: block; }
.stat b { font-size: 20px; font-weight: 800; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Kartu ARIIN ID (perak metalik + panel sirkuit navy, seperti kartu anggota fisik) */
.id-card {
  position: relative; aspect-ratio: 1.586; border-radius: 22px; overflow: hidden; color: var(--navy-900);
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0%) 0 2px, rgb(255 255 255 / 18%) 2px 3px),
    linear-gradient(135deg, #f7f8fb 0%, #d5dbe6 30%, #f1f3f7 50%, #bfc7d6 78%, #e6e9ef 100%);
  box-shadow: 0 2px 0 rgb(255 255 255 / 60%) inset, 0 24px 48px rgb(10 26 68 / 28%), 0 4px 10px rgb(10 26 68 / 14%);
  padding: 6% 6.5%; display: flex; flex-direction: column; isolation: isolate;
}
/* Panel navy bersirkuit di sisi kanan, seperti kartu anggota fisik ARIIN */
.id-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(rgb(10 26 68 / 72%), rgb(10 26 68 / 72%)),
    url(/static/circuit.svg) center/200px repeat,
    linear-gradient(160deg, #163486, #0a1a44 60%, #050f29);
  clip-path: polygon(77% 0, 100% 0, 100% 100%, 65% 100%);
}
.id-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 40%) 42%, transparent 55%); z-index: -1; pointer-events: none; }
.id-card__top { display: flex; align-items: center; gap: 10px; }
.id-card__top img { width: 13%; max-width: 46px; }
.id-card__title b { display: block; font-size: clamp(15px, 2.4vw, 20px); font-weight: 800; letter-spacing: .04em; background: linear-gradient(180deg, #1846c7, #0a1a44); -webkit-background-clip: text; background-clip: text; color: transparent; }
.id-card__title small { display: block; font-size: clamp(9px, 1.3vw, 11px); color: #3b4a72; font-weight: 600; }
.id-card__status { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--gold-300); border: 1px solid rgb(255 226 154 / 50%); padding: 3px 9px; border-radius: 999px; background: rgb(10 26 68 / 50%); }
.id-card__chip { width: 15%; aspect-ratio: 1.3; margin-top: 7%; border-radius: 8px; background: linear-gradient(135deg, #8fd0ff, #2a7fd8 55%, #5bb2f5); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 45%), 0 2px 4px rgb(0 0 0 / 15%); position: relative; }
.id-card__chip::before { content: ""; position: absolute; inset: 22% 18%; border: 1.5px solid rgb(255 255 255 / 55%); border-radius: 4px; }
.id-card__number { margin-top: auto; font-size: clamp(18px, 3.6vw, 27px); font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: #2a3350; text-shadow: 0 1px 0 rgb(255 255 255 / 85%), 0 -1px 0 rgb(0 0 0 / 18%); white-space: nowrap; }
.id-card__bottom { display: flex; align-items: flex-end; gap: 22px; margin-top: 5%; }
.id-card__bottom small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; color: #55607e; }
.id-card__bottom b { font-size: clamp(12px, 2vw, 15px); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.id-card__bottom .avatar { margin-left: auto; width: 17%; height: auto; aspect-ratio: 1; max-width: 72px; border: 3px solid rgb(255 255 255 / 85%); font-size: clamp(14px, 2.6vw, 22px); box-shadow: 0 4px 12px rgb(0 0 0 / 25%); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 16px; }
.section-head h2 { font-size: 20px; font-weight: 800; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 36px; }
.app-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s, border-color .15s; }
.app-tile:hover { box-shadow: var(--shadow); border-color: #d3dbea; }
.app-tile header { display: flex; gap: 12px; align-items: center; }
.app-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.app-icon svg { width: 22px; height: 22px; }
.app-tile h3 { font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.app-tile .tagline { color: var(--muted); font-size: 13px; min-height: 40px; }
.app-tile .delegated { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; }
.app-tile .delegated code { color: var(--ink-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.app-tile footer { display: flex; gap: 8px; margin-top: auto; align-items: center; }
.app-tile footer form { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; scroll-margin-top: 84px; }
.panel h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.panel > p.muted { font-size: 13.5px; margin-bottom: 20px; }
.panel h3 { font-size: 14px; font-weight: 800; margin: 22px 0 12px; color: var(--ink-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.panel .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.list li + li { border-top: 1px solid var(--line); }
.list .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--ink-2); display: grid; place-items: center; flex-shrink: 0; }
.list .ic svg { width: 18px; height: 18px; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-size: 14px; }
.list .grow small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list form { margin: 0; }

.activity li .ic { background: var(--blue-50); color: var(--blue-600); }
.activity li.bad .ic { background: var(--danger-bg); color: var(--danger); }
.activity time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 16px 40px; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .brand-panel { padding: 22px 20px; gap: 0; }
  .brand-copy, .brand-foot { display: none; }
  .hero { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar nav { display: none; }
}
@media (max-width: 560px) {
  .container { padding: 20px 16px 48px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .topbar .who .name { display: none; }
  .auth-main { padding: 28px 16px; align-items: flex-start; }
  .center-card { padding: 24px 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: span 2; }
  .form-row { grid-template-columns: 1fr; }
  .alert { flex-wrap: wrap; }
  .alert .alert-actions { margin-left: 0; }
  .id-card { border-radius: 16px; }
}
