/* ============================================
   File: public/profile-setup.css
   Deskripsi: Style Wizard Profil (Profile Setup) PWA
   Tanggal: 2026-10-24
   Revisi: 2026-10-24 (S-18c-2) — file baru
   Catatan: semua warna/ukuran lewat alias --ps-* di bawah, yang membaca token dari tokens.css
            dengan fallback. Bila nama token di tokens.css berbeda, cukup ubah blok alias ini.
   ============================================ */

#profile-setup-view {
  --ps-bg: var(--color-bg, #FFFFFF);
  --ps-surface: var(--color-surface, #F1F5F9);
  --ps-text: var(--color-text, #0F172A);
  --ps-muted: var(--color-text-muted, #64748B);
  --ps-border: var(--color-border, #E2E8F0);
  --ps-primary: var(--color-primary, #0066FF);
  --ps-danger: var(--color-danger, #DC2626);
  --ps-warn-bg: #FEF3C7;
  --ps-warn-text: #92400E;
  --ps-radius: var(--radius-md, 12px);
}

@media (prefers-color-scheme: dark) {
  #profile-setup-view {
    --ps-bg: var(--color-bg, #0A0F1A);
    --ps-surface: var(--color-surface, #131B2B);
    --ps-text: var(--color-text, #F1F5F9);
    --ps-muted: var(--color-text-muted, #94A3B8);
    --ps-border: var(--color-border, #243049);
    --ps-danger: var(--color-danger, #F87171);
    --ps-warn-bg: #3B2F0B;
    --ps-warn-text: #FCD34D;
  }
}

.profile-setup-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--ps-bg);
  color: var(--ps-text);
}
.profile-setup-view.ps-hidden,
.profile-setup-view .ps-hidden { display: none !important; }
.profile-setup-view [hidden] { display: none !important; }

/* Header */
.ps-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
}
.ps-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.ps-back:active { background: var(--ps-surface); }
.ps-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.ps-step { margin: 2px 0 0; font-size: 13px; color: var(--ps-muted); }

.ps-progress { height: 3px; background: var(--ps-border); }
.ps-progress span {
  display: block;
  height: 100%;
  width: 50%;
  background: var(--ps-primary);
  transition: width .25s ease;
}

/* Konten */
.ps-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ps-content { max-width: 480px; margin: 0 auto; padding: 16px; }
.ps-intro { margin: 0 0 16px; color: var(--ps-muted); font-size: 14px; line-height: 1.5; }
.ps-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50dvh;
  text-align: center;
}

.ps-field { margin-bottom: 18px; }
.ps-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.ps-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  background: var(--ps-surface);
  color: inherit;
  font: inherit;
  font-size: 16px; /* cegah zoom otomatis iOS */
}
.ps-input:focus { outline: 2px solid var(--ps-primary); outline-offset: 1px; }
.ps-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ps-muted); }
.ps-error { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ps-danger); }
.ps-error-global {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--ps-danger);
  border-radius: var(--ps-radius);
}

/* Gender */
.ps-radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ps-radio {
  padding: 12px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  background: var(--ps-surface);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ps-radio.is-active {
  border-color: var(--ps-primary);
  box-shadow: 0 0 0 1px var(--ps-primary) inset;
  color: var(--ps-primary);
}

/* Kota */
.ps-city-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  background: var(--ps-surface);
}
.ps-field .btn + .ps-error { margin-top: 8px; }
#ps-city-box .ps-hint { margin: 0 0 10px; }

/* Peringatan foto */
.ps-warn {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--ps-radius);
  background: var(--ps-warn-bg);
  color: var(--ps-warn-text);
  font-size: 14px;
  line-height: 1.45;
}
.ps-warn p { margin: 2px 0 0; }
.ps-warn-ic { font-size: 18px; line-height: 1.2; }

/* Foto */
.ps-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
}
.ps-counter { font-size: 13px; font-weight: 500; color: var(--ps-muted); }
.ps-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ps-photo-cell,
.ps-photo-empty {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--ps-radius);
  background: var(--ps-surface);
}
.ps-photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-photo-cell.is-main { box-shadow: 0 0 0 2px var(--ps-primary); }
.ps-photo-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--ps-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.ps-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.ps-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed var(--ps-border);
  color: var(--ps-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ps-photo-empty.is-main { border-color: var(--ps-primary); color: var(--ps-primary); }
.ps-photo-empty-icon { font-size: 24px; line-height: 1; }

/* Footer */
.ps-footer {
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  border-top: 1px solid var(--ps-border);
  background: var(--ps-bg);
}
.ps-footer > * { max-width: 480px; margin-left: auto; margin-right: auto; }
.ps-footer-note { margin: 0 auto 8px; font-size: 12.5px; text-align: center; color: var(--ps-muted); }
.ps-btn-block { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; }
.ps-btn-block[disabled] { opacity: .5; cursor: not-allowed; }

/* Loading */
.ps-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
}
.ps-loading-text { font-size: 14px; }
.ps-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ps-border);
  border-top-color: var(--ps-primary);
  border-radius: 50%;
  animation: ps-spin .8s linear infinite;
}
.ps-loading .ps-spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* Toast */
.ps-toast {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  z-index: 6;
  max-width: 85%;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.ps-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .ps-progress span, .ps-toast { transition: none; }
  .ps-spinner { animation-duration: 1.6s; }
}