:root {
  --primary: #1a6b3a;
  --accent: #c9a227;
  --bg: #f5f7f5;
  --surface: #ffffff;
  --text: #17231c;
  --muted: #667269;
  --line: #dfe6e1;
  --danger: #b42318;
  --danger-bg: #fff2f0;
  --success: #18794e;
  --success-bg: #edf9f2;
  --shadow: 0 18px 48px rgba(23, 35, 28, .08);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.55; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.letter-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.letter-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.letter-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.letter-brand img, .brand-mark { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; }
.brand-mark { display: grid; place-items: center; color: #fff; background: var(--primary); font-weight: 800; }
.letter-brand strong, .letter-brand small { display: block; }
.letter-brand strong { font-size: .98rem; }
.letter-brand small { margin-top: 2px; color: var(--muted); font-size: .76rem; }
.back-link { color: var(--primary); font-size: .86rem; font-weight: 700; text-decoration: none; }
.letter-main { padding: 38px 0 64px; }
.letter-hero { padding: 30px 32px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 94%, #0b2014), var(--primary)); border-radius: 20px; box-shadow: var(--shadow); }
.eyebrow { font-size: .73rem; letter-spacing: .13em; font-weight: 800; opacity: .8; }
.letter-hero h1 { margin: 8px 0 9px; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.12; }
.letter-hero p { max-width: 690px; margin: 0; color: rgba(255,255,255,.8); }
.security-note { display: flex; align-items: center; gap: 10px; padding: 13px 15px; min-width: 250px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 13px; }
.security-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; border-radius: 50%; background: rgba(255,255,255,.15); font-weight: 800; }
.security-note strong, .security-note small { display: block; }
.security-note strong { font-size: .83rem; }
.security-note small { margin-top: 2px; font-size: .7rem; color: rgba(255,255,255,.72); }
.letter-tabs { display: flex; gap: 8px; margin: 22px 0 14px; padding: 5px; width: fit-content; background: #e8ede9; border-radius: 12px; }
.tab-button { padding: 10px 17px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; }
.tab-button.active { color: #fff; background: var(--primary); box-shadow: 0 5px 14px rgba(0,0,0,.09); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.letter-card, .success-card { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 30px rgba(23,35,28,.04); }
.card-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 18px; }
.card-heading > div { display: flex; align-items: center; gap: 10px; }
.card-heading h2 { margin: 0; font-size: 1.04rem; }
.card-heading > small { color: var(--muted); font-size: .75rem; }
.step { width: 32px; height: 32px; display: grid; place-items: center; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, white); border-radius: 9px; font-size: .72rem; font-weight: 800; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.validate-row { display: flex; gap: 12px; align-items: end; }
.grow { flex: 1; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: .78rem; font-weight: 800; color: #354039; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d8e0da; border-radius: 10px; background: #fff; color: var(--text); padding: 11px 12px; outline: none; transition: .18s ease; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent); }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: .7rem; }
.optional { color: var(--muted); font-weight: 500; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); text-decoration: none; font-weight: 800; cursor: pointer; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.validate-button { min-width: 145px; margin-bottom: 16px; }
.submit-button { width: 100%; min-height: 50px; margin-top: 7px; }
.button.secondary { color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, white); }
.divider { height: 1px; margin: 10px 0 24px; background: var(--line); }
.validation-message { margin: 0 0 18px; padding: 11px 13px; border-radius: 9px; font-size: .78rem; }
.validation-message.info { color: #536158; background: #f0f3f1; }
.validation-message.success { color: var(--success); background: var(--success-bg); }
.validation-message.error { color: var(--danger); background: var(--danger-bg); }
.student-card { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; padding: 15px; border: 1px solid color-mix(in srgb, var(--primary) 25%, white); background: color-mix(in srgb, var(--primary) 5%, white); border-radius: 12px; }
.student-card small, .student-card strong { display: block; }
.student-card small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.student-card strong { margin-top: 4px; font-size: .87rem; }
.consent { display: flex; gap: 9px; align-items: flex-start; margin: 5px 0 12px; font-size: .78rem; color: #4f5d54; }
.consent input { margin-top: 3px; accent-color: var(--primary); }
.form-hint { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: .72rem; }
.alert { margin-bottom: 14px; padding: 12px 14px; border-radius: 10px; font-size: .82rem; }
.alert.error { color: var(--danger); background: var(--danger-bg); border: 1px solid #f4cac5; }
.success-card { display: flex; gap: 18px; align-items: flex-start; }
.success-mark { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 46px; color: #fff; background: var(--success); border-radius: 50%; font-weight: 900; }
.success-card h2 { margin: 0 0 5px; }
.success-card p { margin: 6px 0; }
.request-code { display: inline-block; margin: 5px 0 6px; padding: 9px 13px; border: 1px dashed var(--primary); border-radius: 9px; color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, white); font-weight: 900; letter-spacing: .06em; }
.muted { color: var(--muted); font-size: .8rem; }
.track-card { max-width: 820px; }
.track-form { align-items: end; }
.track-button { margin-bottom: 16px; }
.status-result { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; }
.status-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.status-top small { color: var(--muted); }
.status-top h3 { margin: 4px 0 0; }
.status-badge { padding: 6px 10px; border-radius: 99px; font-size: .72rem; font-weight: 800; }
.status-diterima { color: #425248; background: #eef1ef; }
.status-diproses { color: #875c00; background: #fff6d9; }
.status-selesai { color: var(--success); background: var(--success-bg); }
.status-ditolak { color: var(--danger); background: var(--danger-bg); }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 16px; }
.status-grid small, .status-grid strong { display: block; }
.status-grid small { color: var(--muted); font-size: .68rem; }
.status-grid strong { margin-top: 3px; font-size: .83rem; }
.admin-note { margin-top: 16px; padding: 13px 14px; border-left: 3px solid var(--accent); background: #faf9f4; border-radius: 8px; font-size: .8rem; }
.admin-note p { margin: 4px 0 0; }
.hidden, .hp-field { display: none !important; }

@media (max-width: 760px) {
  .letter-shell { width: min(100% - 22px, 1040px); }
  .header-inner { min-height: 66px; }
  .back-link { display: none; }
  .letter-main { padding-top: 18px; }
  .letter-hero { grid-template-columns: 1fr; padding: 24px 20px; border-radius: 15px; }
  .security-note { min-width: 0; }
  .letter-tabs { width: 100%; }
  .tab-button { flex: 1; padding-inline: 10px; }
  .letter-card, .success-card { padding: 20px 16px; border-radius: 14px; }
  .grid.two, .student-card, .status-grid { grid-template-columns: 1fr; }
  .validate-row { align-items: stretch; flex-direction: column; gap: 0; }
  .validate-button { width: 100%; margin-top: -4px; }
  .card-heading { align-items: flex-start; }
  .card-heading > small { display: none; }
  .success-card { flex-direction: column; }
}
