/* ══════════════════════════════════════════════════════════
   KLINPAL — CUSTOMER ORDER FLOW
   Mobile-first. Light theme. Clean & trustworthy.
══════════════════════════════════════════════════════════ */

:root {
  --teal:        #00c9a7;
  --teal-dark:   #00a88a;
  --navy:        #0d1b2a;
  --white:       #ffffff;
  --off-white:   #f7f9fc;
  --gray-50:     #f0f4f8;
  --gray-100:    #e2e8f0;
  --gray-300:    #c0cdd9;
  --gray-500:    #7a90a8;
  --gray-700:    #3d5166;
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --red:         #ef4444;
  --font-head:   'Inria Serif', serif;
  --font-body:   'Instrument Sans', sans-serif;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(13,27,42,0.08);
  --shadow-md:   0 8px 40px rgba(13,27,42,0.12);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--navy);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SCREENS ── */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { display: flex; align-items: center; }
.logo-img { height: 28px; width: auto; display: block; }
.back-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  padding: 6px 0;
}
.back-btn:hover { color: var(--navy); }

/* ── SCREEN BODY ── */
.screen-body {
  flex: 1;
  padding: 28px 20px 40px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.screen-head { display: flex; flex-direction: column; gap: 6px; }
.screen-title {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.screen-sub {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ── LANDING ── */
#s-landing {
  background: var(--white);
}
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 20px;
  gap: 16px;
}
.hero-visual {
  font-size: 80px;
  line-height: 1;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.hero-title {
  font-family: var(--font-head);
  font-size: 40px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero-title em {
  font-style: italic;
  color: var(--teal);
}
.hero-sub {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 280px;
  line-height: 1.6;
}
.bottom-cta {
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.trust-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.trust-pill {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  padding: 6px 14px;
}
.cta-note {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  min-height: 16px;
}

/* ── CHECKING ── */
#s-checking {
  background: var(--white);
  align-items: center;
  justify-content: center;
}
.checking-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-100);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.checking-text {
  font-size: 15px;
  color: var(--gray-500);
}

/* ── FORM FIELDS ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.field-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gray-300);
}
.field-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--navy);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.field-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.12);
}
.field-input.input-error { border-color: var(--red); }
.field-error {
  font-size: 12px;
  color: var(--red);
  display: none;
}

/* ── ADDRESS AUTOCOMPLETE ── */
.addr-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: none;
  overflow: hidden;
  margin-top: 4px;
}
.addr-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-50);
  transition: background 0.1s;
}
.addr-item:last-child { border-bottom: none; }
.addr-item:hover { background: var(--gray-50); }
.addr-item-main { display: block; font-size: 14px; font-weight: 500; color: var(--navy); }
.addr-item-sub  { display: block; font-size: 12px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-status { font-size: 12px; margin-top: 4px; }
.addr-status.ok      { color: var(--teal-dark); }
.addr-status.loading { color: var(--gray-500); }
.addr-status.err     { color: var(--red); }

/* ── BUTTONS ── */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0,201,167,0.25);
  -webkit-appearance: none;
}
.btn-primary:hover  { background: var(--teal-dark); box-shadow: 0 6px 20px rgba(0,201,167,0.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: var(--gray-100);
  color: var(--gray-300);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-green {
  background: var(--green);
  box-shadow: 0 4px 16px rgba(34,197,94,0.25);
}
.btn-green:hover {
  background: var(--green-dark);
  box-shadow: 0 6px 20px rgba(34,197,94,0.35);
}

/* ── WELCOME BANNER ── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(0,201,167,0.08), rgba(0,201,167,0.03));
  border: 1px solid rgba(0,201,167,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.welcome-banner p  { font-size: 13px; color: var(--gray-500); margin-bottom: 2px; }
.welcome-banner strong { font-family: var(--font-head); font-size: 17px; color: var(--navy); }

/* ── SERVICES LIST ── */
.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.service-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.service-card.has-items {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,201,167,0.1);
}
.service-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.service-check.checked {
  background: var(--teal);
  border-color: var(--teal);
}
.service-info { flex: 1; }
.service-name  { font-size: 14px; font-weight: 600; color: var(--navy); }
.service-price { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

/* ── QTY CONTROL ── */
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-50);
  border-radius: 6px;
  font-size: 16px;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.qty-btn:hover { background: var(--gray-100); }
.qty-input {
  width: 36px;
  text-align: center;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  outline: none;
  background: transparent;
  -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── ORDER FOOTER ── */
.order-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
  margin-top: 8px;
}
.subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.subtotal-label { font-size: 13px; color: var(--gray-500); }
.subtotal-value { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--navy); }

/* ── SUMMARY ── */
.review-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--teal-dark);
  background: rgba(0,201,167,0.1);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 4px;
}
.summary-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-50);
  font-size: 14px;
  color: var(--navy);
}
.summary-row:last-child { border-bottom: none; }
.summary-row.sub-row { color: var(--gray-500); font-size: 13px; }
.summary-row.total {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  background: var(--gray-50);
}
.order-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.order-id-label { font-size: 13px; color: var(--gray-500); }
.order-id-val { font-size: 13px; color: var(--navy); letter-spacing: 0.5px; }
.summary-note {
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.5;
}
.pay-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.pay-total {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -1px;
}

/* ── SUCCESS ── */
.success-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 28px;
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}
.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(34,197,94,0.3);
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.success-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
}
.success-body {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

/* ── RESPONSIVE ── */
@media (min-width: 520px) {
  .screen-body { padding: 36px 0 48px; }
  .bottom-cta  { padding: 28px 0 48px; }
  .hero        { padding: 60px 0 24px; }
}

/* ── CONFIRM ADDRESS SCREEN ── */
.confirm-address-card {
  background: var(--gray-50);
  border: 2px solid var(--teal);
  border-radius: 14px;
  padding: 20px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.confirm-address-icon {
  font-size: 22px;
  margin-bottom: 4px;
}
.confirm-address-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.confirm-address-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.btn-ghost {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1.5px solid var(--gray-300);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s;
}
.btn-ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}
