/* =====================================================
   KATALOG DESA BRILIAN 2026 - styles
   ===================================================== */

/* Landing dengan modal auto-open: redam background */
.katalog-body { overflow: hidden; }
.landing-card { opacity: 0.7; }

/* ============================================================
   MODAL POPUP VERIFIKASI (modal-verify)
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal.is-open { display: flex; }

.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 28, 51, 0.75);
  backdrop-filter: blur(2px);
}
.modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 26px 24px 20px;
  max-width: 440px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modal-pop .25s ease-out;
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header { text-align: center; margin-bottom: 18px; }
.modal-icon {
  font-size: 42px; margin-bottom: 8px;
  display: inline-block;
}
.modal-header h3 {
  margin: 0 0 6px; color: #003d7a; font-size: 22px;
}
.modal-sub { margin: 0; color: #4b5563; font-size: 14px; line-height: 1.5; }

.modal .form-group { margin-bottom: 14px; }
.modal .form-group label {
  display: block; font-size: 13px; color: #374151; font-weight: 600;
  margin-bottom: 6px;
}
.modal .form-group input[type="tel"] {
  width: 100%; padding: 12px 14px; font-size: 18px;
  border: 1.5px solid #d1d5db; border-radius: 10px;
  font-family: ui-monospace, monospace; letter-spacing: 3px;
  text-align: center;
  transition: border-color .15s;
}
.modal .form-group input[type="tel"]:focus {
  outline: none; border-color: #003d7a;
  box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.12);
}
.modal .hint { display: block; margin-top: 6px; font-size: 12px; color: #6b7280; }

.modal .msg {
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; margin: 10px 0;
  display: none;
}
.modal .msg.error {
  display: block; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5;
}
.modal .msg.ok {
  display: block; background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7;
}

.modal .form-actions {
  display: flex; gap: 10px; justify-content: space-between; align-items: center;
  margin-top: 12px;
}
.modal .btn-cancel {
  background: transparent; color: #6b7280; border: none;
  text-decoration: none; font-size: 13px; padding: 8px 4px;
}
.modal .btn-cancel:hover { color: #003d7a; }
.modal .btn-primary {
  background: #003d7a; color: #fff; border: none;
  padding: 11px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.modal .btn-primary:hover:not(:disabled) { background: #0057b8; }
.modal .btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

@media (max-width: 480px) {
  .modal-box { padding: 22px 18px 16px; }
  .modal-header h3 { font-size: 19px; }
}

/* ============================================================
   EDITOR (post-auth)
   ============================================================ */
.katalog-header .kh-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.katalog-header .kh-meta { margin: 4px 0; font-size: 14px; color: #4b5563; }

.btn-logout {
  background: #fff; color: #003d7a;
  border: 1px solid #003d7a;
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.btn-logout:hover { background: #003d7a; color: #fff; }

.progress-box { margin-top: 14px; }
.progress-label { font-size: 14px; margin-bottom: 6px; color: #374151; }
.progress-bar {
  background: #e5e7eb; height: 12px; border-radius: 6px; overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, #ffd700 0%, #f59e0b 100%);
  height: 100%; transition: width .3s ease;
}

.info-box {
  padding: 10px 14px; background: #eff6ff; border-radius: 8px;
  border-left: 4px solid #003d7a; font-size: 14px; color: #1e3a8a;
}

/* Section accordion */
.sections-list { display: flex; flex-direction: column; gap: 10px; }

.section-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid #d1d5db;
  transition: border-color .2s;
}
.section-card[open] { border-left-color: #003d7a; }

.section-card summary {
  cursor: pointer; list-style: none; padding: 14px 16px;
  user-select: none;
}
.section-card summary::-webkit-details-marker { display: none; }

.sec-summary { display: flex; align-items: center; gap: 12px; }
.sec-num {
  width: 32px; height: 32px; background: #003d7a; color: #fff;
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sec-title-wrap { flex: 1; min-width: 0; }
.sec-title { font-weight: 600; color: #0f1c33; font-size: 15px; line-height: 1.3; }
.sec-status { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.badge.ok   { background: #d1fae5; color: #065f46; }
.badge.warn { background: #fef3c7; color: #92400e; }

.sec-photo-count { font-size: 12px; color: #6b7280; }
.sec-chevron {
  font-size: 18px; color: #9ca3af; transition: transform .2s; flex-shrink: 0;
}
.section-card[open] .sec-chevron { transform: rotate(180deg); }

.sec-body { padding: 0 16px 16px; border-top: 1px solid #f3f4f6; padding-top: 14px; }
.sec-hint { color: #6b7280; font-size: 13.5px; margin: 0 0 14px; font-style: italic; }

.field-label {
  display: block; font-weight: 600; color: #0f1c33;
  font-size: 14px; margin-bottom: 6px;
}

/* Quill */
.quill-wrap { margin-bottom: 10px; }
.quill-editor { min-height: 180px; background: #fff; font-size: 15px; }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; border-color: #d1d5db; }
.ql-container.ql-snow { border-radius: 0 0 8px 8px; border-color: #d1d5db; }

.sec-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.save-status { font-size: 13px; color: #6b7280; }
.save-status.ok { color: #16a34a; }
.save-status.err { color: #dc2626; }

/* Buttons */
.btn-primary {
  background: #003d7a; color: #fff; border: none;
  padding: 10px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover:not(:disabled) { background: #0057b8; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed #93c5fd;
  border-radius: 10px;
  padding: 24px 14px;
  text-align: center;
  background: #f0f9ff;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 12px;
}
.dropzone:hover, .dropzone.is-hover { border-color: #003d7a; background: #e0f2fe; }
.dropzone.is-drag {
  border-color: #16a34a; background: #dcfce7;
  transform: scale(1.01);
}
.dropzone.is-uploading {
  border-color: #f59e0b; background: #fffbeb;
  cursor: wait;
  pointer-events: none;
}
.dropzone .dz-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.dropzone.is-uploading .dz-input { pointer-events: none; }
.dropzone .dz-msg { color: #1e3a8a; font-size: 14px; line-height: 1.5; pointer-events: none; }
.dropzone .dz-msg small { color: #6b7280; }

/* Loading state */
.dz-loading {
  display: none;
  flex-direction: column; align-items: center; gap: 10px;
  color: #92400e; font-size: 14px;
}
.dropzone.is-uploading .dz-msg { display: none; }
.dropzone.is-uploading .dz-loading { display: flex; }

.dz-spinner {
  width: 36px; height: 36px;
  border: 4px solid #fde68a;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: dz-spin 0.8s linear infinite;
}
@keyframes dz-spin { to { transform: rotate(360deg); } }

.dz-progress-text { font-weight: 600; }
.dz-progress-detail { font-size: 12px; color: #78350f; opacity: 0.85; }

/* Photo item: progress bar saat per-file upload (optional, kalau ingin granular per foto) */
.photo-item.is-uploading {
  opacity: 0.6; pointer-events: none;
}
.photo-item.is-uploading::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
}

/* Photo grid (di editor) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.photo-item {
  position: relative; background: #fff; border-radius: 8px;
  overflow: hidden; border: 1px solid #e5e7eb;
}
/* Container thumb: aspect ratio fixed, bg checker untuk highlight bahwa tidak di-crop */
.photo-item .photo-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.photo-item .photo-thumb img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;        /* TIDAK crop */
  display: block;
}
.photo-item .photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(220,38,38,0.92); color: #fff;
  border: none; cursor: pointer; font-size: 18px;
  line-height: 1; font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.photo-item .photo-del:hover { background: #dc2626; }
.photo-item .photo-caption-display {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; min-height: 32px;
  background: #fff; border-top: 1px solid #e5e7eb;
  font-size: 12px;
}
.photo-item .photo-caption-display .cap-text {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #1f2937;
}
.photo-item .photo-caption-display .cap-warn {
  flex: 1;
  color: #dc2626; font-weight: 600;
}
.photo-item .photo-caption-display .btn-edit-caption {
  flex-shrink: 0;
  background: #003d7a; color: #fff;
  border: none; padding: 4px 10px;
  border-radius: 5px; font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.photo-item .photo-caption-display .btn-edit-caption:hover { background: #0057b8; }

/* Photo item missing caption: border merah */
.photo-item.caption-missing {
  border: 2px solid #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.photo-item.caption-missing .photo-caption-display { background: #fef2f2; }

/* ============================================================
   MODAL CAPTION
   ============================================================ */
.caption-preview-wrap {
  background: #f3f4f6; border-radius: 8px; padding: 12px;
  margin-bottom: 16px; text-align: center;
}
#caption-photo-preview {
  max-width: 100%; max-height: 180px;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 6px; background: #fff;
}
.caption-figno {
  font-size: 13px; color: #003d7a; font-weight: 600;
  margin-top: 8px; font-family: Helvetica, Arial, sans-serif;
}

#modal-caption .form-group input[type="text"] {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1.5px solid #d1d5db; border-radius: 8px;
  text-align: left; letter-spacing: 0;
  font-family: inherit;
}
#modal-caption .form-group input[type="text"]:focus {
  outline: none; border-color: #003d7a;
  box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.12);
}

@media (max-width: 600px) {
  .sec-title { font-size: 14px; }
  .sec-num { width: 28px; height: 28px; font-size: 13px; }
  .katalog-header .kh-row { flex-direction: column; }
  .btn-logout { align-self: flex-end; }
}
