/* ============================================================
   SigapMedis — Form Pendaftaran Jemput Pasien
   Theme: Fresh Light · Teal + Sky Blue
   Font: Outfit (display) + Plus Jakarta Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  --teal-50:  #f0fdfb;
  --teal-100: #ccfbf4;
  --teal-200: #99f3e8;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;

  --sky-50:   #f0f9ff;
  --sky-100:  #e0f2fe;
  --sky-200:  #bae6fd;
  --sky-400:  #38bdf8;
  --sky-500:  #0ea5e9;
  --sky-600:  #0284c7;

  --mint:     #e8faf7;
  --white:    #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;

  --font-display: 'Outfit', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-xs:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-teal: 0 4px 20px rgba(20,184,166,0.22);
  --shadow-sky:  0 4px 20px rgba(14,165,233,0.18);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-700);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── BACKGROUND ── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.bg-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--teal-200), transparent 70%);
  top: -180px; left: -160px;
  animation: blobDrift1 18s ease-in-out infinite;
}

.bg-blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--sky-200), transparent 70%);
  top: 30%; right: -120px;
  animation: blobDrift2 22s ease-in-out infinite;
}

.bg-blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #d1fae5, transparent 70%);
  bottom: -100px; left: 30%;
  animation: blobDrift3 16s ease-in-out infinite;
}

@keyframes blobDrift1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%  { transform: translate(40px, 30px) scale(1.05); }
  66%  { transform: translate(-20px, 50px) scale(0.97); }
}
@keyframes blobDrift2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%  { transform: translate(-50px, -30px) scale(1.08); }
}
@keyframes blobDrift3 {
  0%,100% { transform: translate(0,0) scale(1); }
  40%  { transform: translate(30px, -40px) scale(1.04); }
}

/* ── LAYOUT ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 60px;
}

.form-container {
  width: 100%;
  max-width: 760px;
}

/* ── HEADER CARD ── */
.header-card {
  background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-500) 45%, var(--sky-500) 100%);
  border-radius: var(--radius-xl);
  padding: 36px 40px 32px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: var(--shadow-teal);
  animation: slideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.header-card::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  top: -80px; right: -60px;
}

.header-card::after {
  content: '';
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  bottom: -50px; right: 100px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.header-badge .dot {
  width: 7px; height: 7px;
  background: #86efac;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.3); }
}

.header-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.header-sub {
  font-size: 14px;
  opacity: 0.82;
  font-weight: 400;
  max-width: 400px;
}

.header-icon {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 72px;
  opacity: 0.18;
  user-select: none;
  pointer-events: none;
}

/* ── STEP INDICATOR ── */
.steps-bar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.steps-track {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--gray-200);
  transition: background 0.4s;
  z-index: 0;
}

.step-item.done:not(:last-child)::after,
.step-item.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--teal-400), var(--sky-400));
}

.step-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-400);
  position: relative;
  z-index: 1;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-item.active .step-circle {
  background: linear-gradient(135deg, var(--teal-500), var(--sky-500));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px rgba(20,184,166,0.4);
  transform: scale(1.12);
}

.step-item.done .step-circle {
  background: var(--teal-500);
  border-color: transparent;
  color: white;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  margin-top: 7px;
  color: var(--gray-400);
  text-align: center;
  transition: color 0.3s;
}

.step-item.active .step-label { color: var(--teal-600); }
.step-item.done .step-label   { color: var(--teal-500); }

/* ── FORM CARD ── */
.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-md);
  margin-bottom: 8px;
  animation: slideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.18s both;
}

/* ── SECTION TITLE ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--gray-100);
}

.section-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.icon-teal { background: var(--teal-50); }
.icon-sky  { background: var(--sky-50);  }
.icon-mint { background: #f0fdf4; }

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}

.section-desc {
  font-size: 12px;
  color: var(--gray-400);
  margin: 0;
}

/* ── FORM CONTROLS ── */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.label-required {
  color: #f43f5e;
  font-size: 11px;
}

.form-control, .form-select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-700);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all 0.25s;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--teal-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}

.form-control::placeholder { color: var(--gray-300); }

textarea.form-control { resize: vertical; min-height: 90px; }

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .form-control {
  padding-left: 42px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 15px;
  pointer-events: none;
  transition: color 0.25s;
}

.input-icon-wrap:focus-within .input-icon { color: var(--teal-500); }

/* ── JENIS SELECTOR (Radio Cards) ── */
.jenis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.jenis-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.jenis-card label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s;
  background: var(--gray-50);
}

.jenis-card label:hover {
  border-color: var(--teal-300);
  background: var(--teal-50);
}

.jenis-card input:checked + label {
  border-color: var(--teal-500);
  background: linear-gradient(135deg, var(--teal-50), var(--sky-50));
  box-shadow: 0 2px 12px rgba(20,184,166,0.15);
}

.jenis-emoji {
  font-size: 28px;
  line-height: 1;
}

.jenis-label-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  font-family: var(--font-display);
}

.jenis-label-text span {
  font-size: 11px;
  color: var(--gray-400);
}

.jenis-card input:checked + label .jenis-label-text strong {
  color: var(--teal-700);
}

/* ── MAP AREA ── */
.map-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  position: relative;
  transition: border-color 0.25s;
}

.map-wrapper:focus-within { border-color: var(--teal-400); }

#map {
  height: 280px;
  width: 100%;
  background: var(--gray-100);
}

.map-placeholder {
  height: 280px;
  background: linear-gradient(135deg, var(--teal-50), var(--sky-50));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gray-400);
  cursor: pointer;
  transition: background 0.25s;
}

.map-placeholder:hover { background: linear-gradient(135deg, var(--teal-100), var(--sky-100)); }

.map-placeholder .map-icon { font-size: 40px; opacity: 0.5; }
.map-placeholder p { font-size: 13px; font-weight: 500; margin: 0; }
.map-placeholder small { font-size: 11px; opacity: 0.7; }

.map-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--sky-50);
  border-top: 1px solid var(--sky-100);
  font-size: 11px;
  color: var(--sky-600);
  font-weight: 500;
}

.map-coords {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.coord-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--teal-700);
  font-weight: 500;
}

.coord-pill input {
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--teal-700);
  font-family: var(--font-body);
  width: 100%;
  outline: none;
}

/* ── KONDISI BADGES ── */
.kondisi-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kondisi-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kondisi-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  transition: all 0.2s;
  background: var(--gray-50);
}

.kondisi-item label:hover { background: var(--gray-100); }

.kondisi-item.baik input:checked + label {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #16a34a;
}

.kondisi-item.sedang input:checked + label {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
}

.kondisi-item.buruk input:checked + label {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
}

/* ── FILE UPLOAD ── */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--gray-50);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--teal-400);
  background: var(--teal-50);
}

.upload-zone input[type="file"] { display: none; }

.upload-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }
.upload-zone p { font-size: 13px; color: var(--gray-500); margin: 0; font-weight: 500; }
.upload-zone small { font-size: 11px; color: var(--gray-400); }

.file-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--teal-50);
  border: 1.5px solid var(--teal-200);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 13px;
  color: var(--teal-700);
  font-weight: 500;
}

.file-preview.show { display: flex; }

/* ── FORM DIVIDER ── */
.form-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
  margin: 28px 0;
}

/* ── SUMMARY CARD ── */
.summary-card {
  background: linear-gradient(135deg, var(--teal-50), var(--sky-50));
  border: 1.5px solid var(--teal-100);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 8px;
}

.summary-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-700);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.summary-item {
  font-size: 12px;
}

.summary-item .s-label {
  color: var(--gray-400);
  font-weight: 500;
  margin-bottom: 2px;
}

.summary-item .s-value {
  color: var(--gray-700);
  font-weight: 600;
}

/* ── ACTION BUTTONS ── */
.action-bar {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px 40px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-500);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-back:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-700);
}

.btn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--teal-500), var(--sky-500));
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: var(--shadow-teal);
  position: relative;
  overflow: hidden;
}

.btn-next::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(20,184,166,0.35);
}

.btn-next:hover::before { background: rgba(255,255,255,0.08); }
.btn-next:active { transform: translateY(0); }

.btn-submit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: var(--shadow-teal);
  letter-spacing: 0.2px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(20,184,166,0.4);
}

.step-info {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ── INVALID STATE ── */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #f43f5e;
  background: #fff5f7;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(244,63,94,0.12);
}

.invalid-feedback {
  display: none;
  font-size: 11px;
  color: #f43f5e;
  margin-top: 4px;
  font-weight: 500;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
  display: block;
}

/* ── CHAR COUNTER ── */
.char-counter {
  font-size: 11px;
  color: var(--gray-400);
  text-align: right;
  margin-top: 4px;
}

/* ── TOOLTIP ── */
.form-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  transition: background 0.2s;
}

.form-tooltip:hover { background: var(--teal-100); color: var(--teal-600); }

/* ── SUCCESS STATE ── */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(240,253,251,0.95);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  animation: fadeIn 0.4s ease both;
}

.success-overlay.show { display: flex; }

.success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-500), var(--sky-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(20,184,166,0.35);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.success-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--teal-700);
  margin-bottom: 8px;
}

.success-sub {
  font-size: 14px;
  color: var(--gray-500);
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-code {
  background: var(--white);
  border: 1.5px solid var(--teal-200);
  border-radius: var(--radius-md);
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--teal-600);
  letter-spacing: 2px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

/* ── ANIMATIONS ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* Step panels */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn 0.3s ease both; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .page-wrapper { padding: 20px 12px 40px; }
  .header-card  { padding: 24px 22px 20px; border-radius: var(--radius-lg); }
  .header-title { font-size: 22px; }
  .header-icon  { display: none; }
  .form-card    { padding: 24px 18px; border-radius: var(--radius-lg); }
  .action-bar   { padding: 16px 18px; border-radius: var(--radius-lg); }
  .jenis-grid   { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .steps-bar    { padding: 16px 12px; }
  .step-label   { font-size: 9px; }
}
