/* =========================================================================
   HUT HJ - Register
   Wizard pendaftaran, dirancang mobile-first.
   ========================================================================= */

:root {
  --hj-primary: #009490;
  --hj-primary-dark: #046A67;
  --hj-primary-light: #E6F4F3;
  --hj-hero-from: #046A67;
  --hj-hero-to: #00B3AD;
  --hj-accent: #F5A524;
  --hj-accent-light: #FEF4E4;
  --hj-success: #5E9022;
  --hj-success-light: #E6F4F3;
  --hj-danger: #C92A3D;
  --hj-danger-light: #FDECEE;

  --hj-ink: #231F20;
  --hj-body: #4A5A62;
  --hj-muted: #7C8B92;
  --hj-line: #DCE6E5;
  --hj-surface: #FFFFFF;
  --hj-bg: #F3F7F7;

  --hj-radius: 14px;
  --hj-radius-sm: 10px;
  --hj-shadow: 0 1px 2px rgba(16, 32, 46, .05), 0 8px 24px rgba(16, 32, 46, .06);

  /* Tinggi action bar mobile, dipakai sebagai padding bawah konten */
  --hj-actionbar-h: 76px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--hj-font, 'Kalbe System', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  background: var(--hj-bg);
  color: var(--hj-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ============================ Header ============================ */

.hj-header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(260px 160px at 80% 20%, rgba(255,198,89,.35), transparent 64%),
    linear-gradient(135deg, var(--hj-hero-from) 0%, var(--hj-primary) 55%, var(--hj-hero-to) 100%);
  color: #fff;
  padding: 22px 20px 26px;
  text-align: center;
}
.hj-header::after {
  content: '';
  position: absolute;
  right: -8%; bottom: -48px;
  width: 58%; height: 90px;
  border-radius: 50% 50% 0 0;
  background: rgba(255,255,255,.11);
}
.hj-header > * { position: relative; z-index: 1; }

.hj-header__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hj-header__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.hj-header__tagline {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .85);
  max-width: 30ch;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .hj-header { padding: 34px 20px 38px; }
  .hj-header__title { font-size: 34px; }
  .hj-header__tagline { font-size: 15px; max-width: none; }
}

/* ============================ Shell ============================ */

.hj-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 14px 40px;
}

@media (min-width: 768px) {
  .hj-shell { padding: 0 20px 56px; }
}

.hj-card {
  background: var(--hj-surface);
  border-radius: var(--hj-radius);
  box-shadow: var(--hj-shadow);
  margin-top: -14px;
  overflow: hidden;
}

/* ==================== Progress (mobile + desktop) ==================== */

.hj-progress { padding: 16px 18px 0; }

.hj-progress__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hj-progress__step {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hj-muted);
}

.hj-progress__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--hj-ink);
  letter-spacing: -.01em;
}

.hj-progress__track {
  height: 6px;
  background: var(--hj-line);
  border-radius: 999px;
  overflow: hidden;
}

.hj-progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hj-primary), var(--hj-hero-to, #00B3AD));
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}

/* Titik langkah - tersembunyi di HP, tampil sebagai stepper di layar lebar.
   Judul langkah TIDAK pernah di-display:none seperti wizard lama; di HP
   informasi itu dipindahkan ke .hj-progress__name di atas. */
.hj-steps {
  display: none;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

@media (min-width: 768px) {
  .hj-progress { padding: 22px 26px 0; }
  .hj-steps {
    display: flex;
    gap: 6px;
  }
  .hj-steps__item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--hj-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--hj-muted);
    background: transparent;
    border: none;
    text-align: left;
    cursor: default;
    transition: background .2s, color .2s;
    min-width: 0;
  }
  .hj-steps__item[data-clickable="true"] { cursor: pointer; }
  .hj-steps__item[data-clickable="true"]:hover { background: var(--hj-primary-light); }
  .hj-steps__num {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--hj-line);
    color: var(--hj-body);
    transition: background .2s, color .2s;
  }
  .hj-steps__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hj-steps__item.is-current { color: var(--hj-primary-dark); background: var(--hj-primary-light); }
  .hj-steps__item.is-current .hj-steps__num { background: var(--hj-primary); color: #fff; }
  .hj-steps__item.is-done { color: var(--hj-success); }
  .hj-steps__item.is-done .hj-steps__num { background: var(--hj-success); color: #fff; }
}

/* ============================ Panels ============================ */

.hj-panels { padding: 20px 18px 4px; }

@media (min-width: 768px) {
  .hj-panels { padding: 26px 26px 6px; }
}

.hj-panel { display: none; }
.hj-panel.is-active { display: block; animation: hjFade .28s ease both; }

@keyframes hjFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hj-panel.is-active { animation: none; }
  .hj-progress__bar { transition: none; }
}

.hj-panel__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--hj-ink);
  letter-spacing: -.01em;
}

.hj-panel__desc {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--hj-muted);
}

/* ============================ Fields ============================ */

.hj-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .hj-grid--2 { grid-template-columns: 1fr 1fr; }
  .hj-grid--2 .hj-field--full { grid-column: 1 / -1; }
}

.hj-field { min-width: 0; margin-bottom: 16px; }
.hj-grid .hj-field { margin-bottom: 0; }

.hj-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--hj-ink);
  margin-bottom: 6px;
}

.hj-label__req { color: var(--hj-danger); }

.hj-hint {
  display: block;
  font-size: 12.5px;
  color: var(--hj-muted);
  margin-top: 6px;
}

.hj-input,
.hj-select {
  width: 100%;
  /* 16px mencegah iOS Safari melakukan auto-zoom saat field difokus. */
  font-size: 16px;
  font-family: inherit;
  color: var(--hj-ink);
  background: #fff;
  border: 1.5px solid var(--hj-line);
  border-radius: var(--hj-radius-sm);
  padding: 12px 14px;
  min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}

.hj-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%234A5A62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.hj-input:focus,
.hj-select:focus {
  outline: none;
  border-color: var(--hj-primary);
  box-shadow: 0 0 0 3px rgba(0, 148, 144, .16);
}

.hj-input[readonly],
.hj-input:disabled,
.hj-select:disabled {
  background: #f2f5f8;
  color: var(--hj-body);
  cursor: not-allowed;
}

.hj-input::placeholder { color: #a4b1bd; }

/* Status validasi */
.hj-field.is-invalid .hj-input,
.hj-field.is-invalid .hj-select { border-color: var(--hj-danger); }

.hj-error {
  display: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hj-danger);
  margin-top: 6px;
}

.hj-field.is-invalid .hj-error { display: block; }

/* ==================== Chips (pengganti select ukuran) ==================== */

.hj-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hj-chip { position: relative; }

.hj-chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.hj-chip span {
  display: block;
  /* 44px = target sentuh minimum yang nyaman di HP */
  min-width: 52px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--hj-line);
  border-radius: var(--hj-radius-sm);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--hj-body);
  text-align: center;
  line-height: 22px;
  transition: all .15s;
  user-select: none;
}

.hj-chip input:checked + span {
  border-color: var(--hj-primary);
  background: var(--hj-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 148, 144, .28);
}

.hj-chip input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(0, 148, 144, .24);
}

.hj-chips--wide .hj-chip span { min-width: 0; width: 100%; }
.hj-chips--wide .hj-chip { flex: 1 1 calc(50% - 4px); }

@media (min-width: 640px) {
  .hj-chips--wide .hj-chip { flex: 0 1 auto; }
  .hj-chips--wide .hj-chip span { padding: 10px 18px; }
}

/* ============================ Notice ============================ */

.hj-notice {
  border-radius: var(--hj-radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 18px 0;
}

.hj-notice p:last-child { margin-bottom: 0; }
.hj-notice p:first-child { margin-top: 0; }

.hj-notice--warn { background: var(--hj-accent-light); border: 1px solid #f3d9a8; color: #7a4d05; }
.hj-notice--info { background: var(--hj-primary-light); border: 1px solid #B6DEDC; color: var(--hj-primary-dark); }
.hj-notice--ok   { background: var(--hj-success-light); border: 1px solid #B6DEDC; color: var(--hj-primary-dark); }

.hj-notice__title {
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}

.hj-notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ============================ NIK lookup ============================ */

.hj-lookup { display: flex; gap: 8px; align-items: stretch; }
.hj-lookup .hj-input { flex: 1; min-width: 0; }

.hj-lookup__btn {
  flex: 0 0 auto;
  padding: 0 18px;
  min-height: 48px;
  border: none;
  border-radius: var(--hj-radius-sm);
  background: var(--hj-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.hj-lookup__btn:hover:not(:disabled) { background: var(--hj-primary-dark); }
.hj-lookup__btn:disabled { opacity: .6; cursor: wait; }

/* Kartu identitas hasil pencarian NIK */
.hj-identity {
  display: none;
  border: 1.5px solid #B6DEDC;
  background: var(--hj-success-light);
  border-radius: var(--hj-radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
}

.hj-identity.is-visible { display: block; }

.hj-identity__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--hj-ink);
  margin-bottom: 2px;
}

.hj-identity__meta { font-size: 13px; color: var(--hj-primary-dark); }

.hj-identity__reset {
  background: none;
  border: none;
  padding: 6px 0 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--hj-primary);
  text-decoration: underline;
  cursor: pointer;
}

/* ============================ Tiket tambahan ============================ */

.hj-ticket {
  border: 1.5px solid var(--hj-line);
  border-radius: var(--hj-radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  background: #fbfcfd;
}

.hj-ticket__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hj-ticket__title { font-size: 14px; font-weight: 800; color: var(--hj-ink); }

.hj-ticket__remove {
  background: none;
  border: none;
  color: var(--hj-danger);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 6px;
}

.hj-ticket__remove:hover { background: var(--hj-danger-light); }

.hj-btn-add {
  width: 100%;
  min-height: 48px;
  border: 1.5px dashed var(--hj-primary);
  background: var(--hj-primary-light);
  color: var(--hj-primary-dark);
  border-radius: var(--hj-radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.hj-btn-add:hover:not(:disabled) { background: #D3EBEA; }
.hj-btn-add:disabled { opacity: .5; cursor: not-allowed; border-style: solid; }

.hj-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--hj-accent-light);
  border: 1px solid #f3d9a8;
  border-radius: var(--hj-radius-sm);
  margin-top: 14px;
}

.hj-total__label { font-size: 13.5px; font-weight: 700; color: #7a4d05; }
.hj-total__value { font-size: 19px; font-weight: 800; color: #7a4d05; white-space: nowrap; }

/* ============================ Panduan ukuran ============================ */

.hj-sizeguide {
  border: 1px solid var(--hj-line);
  border-radius: var(--hj-radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.hj-sizeguide__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  background: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--hj-primary-dark);
  cursor: pointer;
  text-align: left;
}

.hj-sizeguide__toggle::after {
  content: '';
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s;
}

.hj-sizeguide.is-open .hj-sizeguide__toggle::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.hj-sizeguide__body { display: none; padding: 0 12px 12px; }
.hj-sizeguide.is-open .hj-sizeguide__body { display: block; }

.hj-sizeguide__body img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
  cursor: zoom-in;
}

/* Lightbox agar tabel ukuran terbaca di layar kecil */
.hj-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(6, 18, 28, .92);
  padding: 20px;
  overflow: auto;
  text-align: center;
}

.hj-lightbox.is-open { display: block; }
.hj-lightbox img { max-width: 100%; border-radius: 8px; margin-top: 44px; }

.hj-lightbox__close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* ============================ Review ============================ */

.hj-review__group { margin-bottom: 14px; }

.hj-review__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f7f9fb;
  border: 1px solid var(--hj-line);
  border-bottom: none;
  border-radius: var(--hj-radius-sm) var(--hj-radius-sm) 0 0;
}

.hj-review__title { font-size: 14px; font-weight: 800; color: var(--hj-ink); }

.hj-review__edit {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--hj-primary);
  cursor: pointer;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 6px;
}

.hj-review__edit:hover { background: var(--hj-primary-light); }

.hj-review__list {
  margin: 0;
  border: 1px solid var(--hj-line);
  border-radius: 0 0 var(--hj-radius-sm) var(--hj-radius-sm);
  overflow: hidden;
}

.hj-review__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 11px 14px;
  border-top: 1px solid #eef2f6;
  font-size: 14px;
}

.hj-review__list > .hj-review__row:first-child { border-top: none; }

@media (min-width: 560px) {
  .hj-review__row { grid-template-columns: 190px 1fr; gap: 14px; align-items: baseline; }
}

.hj-review__key { color: var(--hj-muted); font-size: 13px; }
.hj-review__val { color: var(--hj-ink); font-weight: 600; word-break: break-word; }
.hj-review__val.is-empty { color: var(--hj-danger); font-weight: 700; }

/* ============================ Action bar ============================ */

.hj-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hj-line);
}

@media (min-width: 768px) {
  .hj-actions {
    position: static;
    justify-content: flex-end;
    padding: 18px 26px 26px;
    background: transparent;
    backdrop-filter: none;
  }
}

.hj-btn {
  flex: 1;
  min-height: 50px;
  padding: 0 20px;
  border: none;
  border-radius: var(--hj-radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

@media (min-width: 768px) {
  .hj-btn { flex: 0 0 auto; min-width: 140px; }
}

.hj-btn--primary { background: var(--hj-primary); color: #fff; }
.hj-btn--primary:hover:not(:disabled) { background: var(--hj-primary-dark); }

.hj-btn--submit { background: var(--hj-success); color: #fff; }
.hj-btn--submit:hover:not(:disabled) { background: var(--hj-primary-dark); }

.hj-btn--ghost {
  background: #fff;
  color: var(--hj-body);
  border: 1.5px solid var(--hj-line);
}

.hj-btn--ghost:hover:not(:disabled) { background: #f2f5f8; }
.hj-btn:disabled { opacity: .55; cursor: not-allowed; }
.hj-btn[hidden] { display: none; }

/* ============================ Draft banner ============================ */

.hj-draft {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  margin-bottom: 16px;
  background: var(--hj-accent-light);
  border: 1px solid #f3d9a8;
  border-radius: var(--hj-radius-sm);
  font-size: 13.5px;
  color: #7a4d05;
}

.hj-draft.is-visible { display: flex; }
.hj-draft__text { flex: 1 1 200px; }

.hj-draft__btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}

.hj-draft__btn--yes { background: var(--hj-accent); color: #3d2600; }
.hj-draft__btn--no  { background: transparent; color: #7a4d05; text-decoration: underline; }

/* ============================ Spinner ============================ */

.hj-spin {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hjSpin .7s linear infinite;
  vertical-align: -2px;
}

@keyframes hjSpin { to { transform: rotate(360deg); } }

/* ============================ Footer ============================ */

.hj-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--hj-muted);
  padding: 20px 16px 0;
}

.hj-foot a { color: var(--hj-primary); font-weight: 600; }

/* Utilitas */
[hidden] { display: none !important; }
.hj-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
