@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

/* ===================================================================
   DESIGN TOKENS — STTII Bali KTM Digital
   Palet terinspirasi dari dokumen akademik resmi & meterai lembaga:
   navy kewibawaan, parchment (kertas ijazah), brass (meterai emas),
   dan maroon (jubah akademik) sebagai aksen sekunder.
   =================================================================== */
:root {
  --navy: #1B2A4A;
  --navy-deep: #101B30;
  --parchment: #F6F1E3;
  --parchment-deep: #EDE5D0;
  --brass: #B8893D;
  --brass-light: #D6AE6C;
  --maroon: #6E2A33;
  --ink: #211D18;
  --ink-soft: #56503F;
  --line: #DCD2B8;
  --ok: #3D6B4C;
  --ok-bg: #E4EEE6;
  --warn: #A34424;
  --warn-bg: #F6E7DE;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --radius: 4px;
  --shadow-card: 0 1px 2px rgba(27,42,74,0.06), 0 8px 24px rgba(27,42,74,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; color: var(--navy-deep); }
p { line-height: 1.6; color: var(--ink-soft); }
code { font-family: var(--font-mono); background: var(--parchment-deep); padding: .1em .4em; border-radius: 3px; font-size: .9em; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Brand mark (seal motif) ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--brass-light), var(--brass) 62%, #8f6a2c 100%);
  color: var(--navy-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-family: var(--font-display); font-weight: 700;
  box-shadow: 0 0 0 3px var(--parchment), 0 0 0 4px var(--brass);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; color: var(--navy-deep); }
.brand-text small { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.brand-center { justify-content: center; margin-bottom: 18px; }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; object-fit: contain; background: #fff; box-shadow: 0 0 0 3px var(--parchment), 0 0 0 4px var(--brass); flex-shrink: 0; padding: 2px; }

/* ---------- Password field with show/hide toggle ---------- */
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 76px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--navy); font-size: .76rem; font-weight: 700;
  cursor: pointer; padding: 4px 8px;
}
.login-links { text-align: right; margin: 6px 0 0; }
.login-links a { font-size: .82rem; color: var(--navy); text-decoration: none; }
.login-links a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header { background: var(--parchment); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; }
.header-nav { display: flex; }
.header-nav a { text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--ink-soft); margin-left: 28px; }
.header-nav a:hover { color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-primary { background: var(--navy); color: var(--parchment); }
.btn-primary:hover { background: var(--navy-deep); box-shadow: 0 4px 14px rgba(27,42,74,.28); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: rgba(27,42,74,.06); }
.btn-danger { background: transparent; color: var(--maroon); border-color: var(--maroon); }
.btn-danger:hover { background: rgba(110,42,51,.08); }
.btn-small { padding: 7px 14px; font-size: .8rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 64px; overflow: hidden; position: relative; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-photo {
  position: absolute; inset: 0;
  background-image: url('../img/kampus-sttii.jpg');
  background-size: cover; background-position: center 30%;
  opacity: .16; filter: saturate(85%);
}
.hero-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--parchment) 0%, rgba(246,241,227,.78) 45%, var(--parchment) 100%);
}
#heroParticles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--brass); font-weight: 700; margin-bottom: 14px; }
.hero h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.18; letter-spacing: -.01em; max-width: 16ch; margin-bottom: 22px; }
.hero .lead { font-size: 1rem; max-width: 46ch; margin: 22px 0 10px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.hero-note { font-size: .82rem; color: var(--ink-soft); opacity: .85; }

/* Mini KTM mock inside hero */
.hero-card { display: flex; justify-content: center; }
.mini-ktm {
  width: 320px; aspect-ratio: 85.6 / 54;
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: 12px; color: var(--parchment);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; padding: 14px 16px;
  position: relative; transform: rotate(-4deg);
}
.mini-ktm::after {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(214,174,108,.35); border-radius: 7px; pointer-events: none;
}
.mini-ktm-head { display: flex; align-items: center; gap: 8px; }
.mini-logo { width: 22px; height: 22px; border-radius: 50%; background: #fff; flex-shrink: 0; object-fit: contain; padding: 1px; }
.mini-ktm-head span { font-family: var(--font-mono); font-size: .46rem; letter-spacing: .06em; opacity: .85; line-height: 1.2; }
.mini-ktm-body { display: flex; gap: 12px; margin-top: 12px; flex: 1; align-items: flex-start; }
.mini-photo { width: 44px; height: 54px; border-radius: 4px; background: rgba(246,241,227,.18); flex-shrink: 0; }
.mini-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; margin-top: 3px; }
.mini-name {
  display: inline-block; align-self: flex-start; background: var(--brass-light); color: var(--navy-deep);
  font-family: var(--font-body); font-weight: 700; font-size: .58rem; padding: 2px 8px; border-radius: 3px;
}
.mini-lines .line { display: block; height: 6px; border-radius: 3px; background: rgba(246,241,227,.28); }
.w80 { width: 80%; } .w70 { width: 70%; } .w60 { width: 60%; } .w50 { width: 50%; }
.mini-qr { width: 46px; height: 46px; background: var(--parchment); border-radius: 4px; padding: 4px; flex-shrink: 0; }
.mini-qr-grid {
  width: 100%; height: 100%; border-radius: 2px;
  background-image: repeating-linear-gradient(90deg, var(--navy-deep) 0 3px, transparent 3px 6px),
                     repeating-linear-gradient(0deg, var(--navy-deep) 0 3px, transparent 3px 6px);
  background-blend-mode: multiply; opacity: .85;
}
.mini-ktm-foot { margin-top: 10px; }
.mini-valid {
  display: inline-block; background: var(--brass-light); color: var(--navy-deep);
  font-family: var(--font-mono); font-weight: 700; font-size: .5rem; padding: 3px 8px; border-radius: 3px;
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 1.7rem; margin-bottom: 10px; }
.section-lead { max-width: 60ch; margin-bottom: 28px; }

.section-check { background: var(--parchment-deep); }
.check-form { display: flex; gap: 12px; max-width: 520px; flex-wrap: wrap; }
.check-form input[type=text] {
  flex: 1; min-width: 220px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); font-family: var(--font-mono); font-size: .95rem; background: #fff;
}
.check-result { margin-top: 22px; padding: 16px 20px; border-radius: var(--radius); max-width: 520px; }
.check-result-ok { background: var(--ok-bg); border: 1px solid rgba(61,107,76,.3); }
.check-result-error { background: var(--warn-bg); border: 1px solid rgba(163,68,36,.3); color: var(--warn); }

.alur-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.alur-list li { display: flex; flex-direction: column; gap: 10px; }
.alur-no {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--brass); color: var(--brass);
  font-family: var(--font-mono); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.alur-list h3 { font-size: 1.02rem; margin-bottom: 6px; }
.alur-list p { font-size: .88rem; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.info-card h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-family: var(--font-body); font-weight: 600; margin-bottom: 10px; }
.info-value { font-family: var(--font-display); font-size: 1.5rem; color: var(--navy); margin: 0 0 6px; }
.info-caption { font-size: .82rem; margin: 0; }

/* ---------- Kontak ---------- */
.section-kontak { background: var(--parchment-deep); }
.kontak-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.kontak-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.kontak-card h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brass); font-family: var(--font-body); font-weight: 700; margin-bottom: 10px; }
.kontak-value { font-family: var(--font-display); font-size: 1.15rem; color: var(--navy); margin: 0 0 8px; line-height: 1.3; }
.kontak-card .info-caption { margin-bottom: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: rgba(246,241,227,.8); padding: 28px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-inner strong { color: var(--parchment); }
.footer-inner p { margin: 2px 0 0; font-size: .85rem; color: rgba(246,241,227,.6); }
.footer-copyright { font-size: .8rem; color: rgba(246,241,227,.55); }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: 3px 10px; border-radius: 100px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-off { background: var(--warn-bg); color: var(--warn); }

/* ===================================================================
   KARTU KTM — dipakai bersama di beranda(mockup), halaman verifikasi,
   preview admin, dan cetak fisik
   =================================================================== */
.kartu-ktm {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 85.6 / 54;
  margin: 0 auto;
  container-type: inline-size;
  background-size: cover;
  background-position: center;
  background-color: #ccc;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,.06);
}
.k-foto { position: absolute; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.k-teks {
  position: absolute; font-family: var(--font-body); font-weight: 600; color: var(--ink);
  white-space: nowrap; line-height: 1.2;
}
.k-nim { font-family: var(--font-mono); font-weight: 500; }
.k-qr { position: absolute; background: #fff; padding: 2px; border-radius: 2px; }
.k-qr img, .k-qr canvas { width: 100% !important; height: 100% !important; }
.k-alamat { white-space: normal; line-height: 1.25; }
.k-highlight { padding: .15em .5em; border-radius: 3px; }

/* Live-preview overlay boxes on the template form */
.k-preview-box {
  display: flex; align-items: center; justify-content: center;
  background: rgba(27,42,74,.08); border: 1px dashed var(--navy);
  color: var(--navy); font-size: 9px; text-align: center; overflow: hidden;
  white-space: normal;
}

/* ---------- Login page ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-back { font-size: .85rem; color: var(--ink-soft); text-decoration: none; display: inline-block; margin-bottom: 16px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 36px 32px; box-shadow: var(--shadow-card); text-align: center; }
.login-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-sub { font-size: .86rem; margin-bottom: 22px; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: .82rem; font-weight: 600; margin-top: 10px; }
.login-form input {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem; font-family: var(--font-body);
}
.login-form .btn { margin-top: 20px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .86rem; margin-bottom: 16px; text-align: left; }
.alert-error { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(163,68,36,.25); }
.alert-info { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(61,107,76,.25); }
.alert-warn { background: #FCF2DD; color: #8A5A16; border: 1px solid rgba(184,137,61,.35); }

/* ---------- Verification page ---------- */
.verify-body { background: var(--parchment); min-height: 100vh; padding: 32px 20px 60px; }
.verify-wrap { max-width: 480px; margin: 0 auto; }
.verify-status { padding: 12px 16px; border-radius: var(--radius); font-weight: 600; font-size: .88rem; margin-bottom: 16px; text-align: center; }
.verify-status-ok { background: var(--ok-bg); color: var(--ok); }
.verify-status-warn { background: var(--warn-bg); color: var(--warn); }
.verify-card { background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 22px; box-shadow: var(--shadow-card); }
.verify-notfound h1 { font-size: 1.25rem; }
.verify-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: .88rem; }
.verify-table th, .verify-table td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.verify-table th { color: var(--ink-soft); font-weight: 600; width: 40%; }
.verify-footnote { font-size: .76rem; color: var(--ink-soft); margin-top: 16px; margin-bottom: 0; }

/* ---------- Print (cetak kartu) ---------- */
.cetak-frame { display: flex; justify-content: center; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 56px; text-align: left; }
  .alur-list { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .header-nav { display: none; }
}
@media (max-width: 520px) {
  .alur-list { grid-template-columns: 1fr; }
}
