* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  padding: 28px 16px 72px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

main {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[hidden] {
  display: none !important;
}

/* ── Header ── */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 4px;
}

.logo-lockup {
  height: 30px;
  width: auto;
  display: block;
}

.app-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

.time-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 9px 12px;
  flex-shrink: 0;
}

.time-chip-input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  width: 80px;
  cursor: pointer;
  padding: 0;
}

input[type=time]::-webkit-calendar-picker-indicator {
  filter: invert(0.55) brightness(1.2);
  cursor: pointer;
}

/* ── Progress bar ── */

#progress-section {
  padding: 0 4px;
}

.progress-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.progress-segment {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease;
}

.progress-segment.filled {
  background: #1db87b;
}

.step-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.38);
  font-weight: 600;
}

/* ── Back button ── */

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 2px 4px;
  width: fit-content;
}

.back-button span {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

/* ── Step cards ── */

.step-card {
  background: rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  padding: 24px 18px 20px;
  animation: scaleIn 0.3s ease;
}

.step-card-centered {
  padding: 36px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.step-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-icon-badge-lg {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.step-title {
  font-size: 23px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.step-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.32);
  font-weight: 600;
  margin: 4px 0 6px;
}

.step-subtitle-muted {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.38);
  font-weight: 500;
  margin-bottom: 36px;
}

.step-range-hint {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.38);
  font-weight: 500;
  margin-bottom: 36px;
}

/* ── Step 1: two sub-fields ── */

.field-row {
  display: flex;
  gap: 12px;
}

.step1-subfield {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 18px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.subfield-label {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.subfield-unit {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.28);
  margin-top: 4px;
  font-weight: 600;
}

.range-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.28);
  margin-top: 10px;
  text-align: center;
  line-height: 1.4;
}

/* ── Step inputs (shared, live-color) ── */

.step-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  padding: 0;
  width: 100%;
  min-width: 0;
  text-align: center;
  display: block;
  color: white;
}

.step-input-large {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1px;
}

.step-input-huge {
  font-size: 82px;
  font-weight: 800;
  letter-spacing: -3px;
}

.step-input.value-normal {
  color: #1db87b;
}

.step-input.value-abnormal {
  color: #f0a500;
}

.step-unit {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 700;
  margin-top: 6px;
}

input[type=number] {
  -moz-appearance: textfield;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Step 4: BAB stepper ── */

.step4-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bab-stepper {
  display: flex;
  align-items: center;
  gap: 28px;
}

.bab-stepper-btn {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid;
  padding: 0;
}

.bab-stepper-btn-minus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
}

.bab-stepper-btn-minus:active {
  background: rgba(255, 255, 255, 0.15);
}

.bab-stepper-btn-plus {
  background: rgba(29, 184, 123, 0.20);
  border-color: rgba(29, 184, 123, 0.38);
}

.bab-stepper-btn-plus:active {
  background: rgba(29, 184, 123, 0.32);
}

.bab-count {
  font-size: 72px;
  font-weight: 800;
  color: white;
  min-width: 72px;
  text-align: center;
  line-height: 1;
  letter-spacing: -3px;
}

.bab-kali-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  margin-top: 14px;
}

/* ── Kondisi BAB ── */

.kondisi-bab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 20px 16px;
  margin: 0;
  min-width: 0;
  animation: fadeUp 0.25s ease;
}

.kondisi-bab-label {
  display: block;
  padding: 0;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

.kondisi-options {
  display: flex;
  gap: 10px;
}

.kondisi-pill {
  flex: 1;
  min-height: 64px;
  padding: 14px 8px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  font-family: inherit;
}

.kondisi-pill[data-tone="green"].active {
  border-color: #1db87bcc;
  background: #1db87b28;
  color: white;
}

.kondisi-pill[data-tone="amber"].active {
  border-color: #f0a500cc;
  background: #f0a50028;
  color: white;
}

.kondisi-pill[data-tone="red"].active {
  border-color: #ff5555cc;
  background: #ff555528;
  color: white;
}

/* ── Error banner ── */

.error-banner {
  background: rgba(255, 60, 60, 0.10);
  border: 1px solid rgba(255, 60, 60, 0.32);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.2s ease;
}

.error-banner svg {
  flex-shrink: 0;
}

.error-banner span {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
}

/* ── Buttons ── */

.btn-selesai {
  width: 100%;
  height: 70px;
  border-radius: 22px;
  border: none;
  background: #1db87b;
  color: white;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(13, 110, 79, 0.50);
}

.btn-selesai:active {
  opacity: 0.82;
  transform: scale(0.99);
}

.btn-whatsapp {
  width: 100%;
  height: 70px;
  border-radius: 22px;
  background: #25D366;
  color: white;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.32);
  animation: fadeUp 0.55s ease;
}

.btn-whatsapp:active {
  opacity: 0.85;
  transform: scale(0.99);
}

.btn-ghost {
  width: 100%;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-ghost:active {
  opacity: 0.65;
}

/* ── Result screen ── */

#result-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  border-radius: 24px;
  padding: 28px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: scaleIn 0.4s ease;
}

.result-abnormal {
  align-items: flex-start;
}

.result-normal {
  background: rgba(29, 184, 123, 0.10);
  border: 1.5px solid rgba(29, 184, 123, 0.40);
}

.result-abnormal {
  background: rgba(240, 165, 0, 0.09);
  border: 1.5px solid rgba(240, 165, 0, 0.45);
}

.result-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-normal .result-icon {
  background: rgba(29, 184, 123, 0.22);
}

.result-abnormal .result-icon {
  background: rgba(240, 165, 0, 0.18);
}

.result-headline {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.result-normal .result-headline {
  color: #1db87b;
}

.result-abnormal .result-headline {
  color: #f0a500;
}

.result-subtext {
  font-size: 16px;
  font-weight: 500;
  margin-top: 4px;
}

.result-normal .result-subtext {
  color: rgba(255, 255, 255, 0.5);
}

.result-abnormal .result-subtext {
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.55;
  margin-top: 6px;
}

/* ── Summary card ── */

.summary-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.45s ease;
}

.summary-header {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.summary-value {
  font-size: 17px;
  color: white;
  font-weight: 700;
}

.summary-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
