/* =========================================================================
   CK Phone — Customer Apply Page
   ========================================================================= */

/* ---- Hero ---- */
.apply-hero {
  background: linear-gradient(135deg, #0D1B3D 0%, #1a3260 60%, #0f2a50 100%);
  padding: 60px 0 48px;
  text-align: center;
  color: #fff;
}
.apply-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin: 12px 0 10px; color: #fff; }
.apply-hero p { color: rgba(255,255,255,.75); font-size: 1rem; max-width: 500px; margin: 0 auto; }

/* ---- Wizard wrapper ---- */
.apply-body { padding: 40px 0 80px; background: var(--c-bg, #F2F4F7); }

/* ---- Step progress ---- */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}
.sp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.sp-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: calc(50% + 17px);
  width: calc(100% - 4px);
  height: 3px;
  background: var(--c-line, #e2e8f0);
  border-radius: 2px;
  transition: background .4s ease;
}
.sp-item.done::after { background: var(--c-mint, #22D3A5); }
.sp-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-line, #e2e8f0);
  color: var(--c-muted, #64748b);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  transition: background .3s, color .3s;
  position: relative; z-index: 1;
}
.sp-item.active .sp-num { background: var(--c-blue, #2563EB); color: #fff; }
.sp-item.done .sp-num { background: var(--c-mint, #22D3A5); color: #fff; }
.sp-label { font-size: .72rem; font-weight: 600; color: var(--c-muted, #64748b); white-space: nowrap; }
.sp-item.active .sp-label { color: var(--c-blue, #2563EB); }
.sp-item.done .sp-label { color: var(--c-mint, #22D3A5); }
.step-progress { gap: 40px; }

/* ---- Step card ---- */
.step-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 16px rgba(13,27,61,.07);
  padding: 36px;
  max-width: 680px;
  margin: 0 auto;
  display: none;
}
.step-card.is-active { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step-title {
  font-size: 1.15rem; font-weight: 700; color: var(--c-navy, #0D1B3D);
  margin: 0 0 6px;
}
.step-sub { font-size: .85rem; color: var(--c-muted, #64748b); margin: 0 0 24px; }

/* ---- Product select ---- */
.model-select {
  appearance: none;
  width: 100%;
  padding: 13px 42px 13px 16px;
  border: 1.5px solid var(--c-line, #e2e8f0);
  border-radius: 12px;
  font: inherit;
  font-weight: 500;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  color: var(--c-ink, #1e293b);
}
.model-select:focus { outline: 0; border-color: var(--c-blue, #2563EB); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }

/* ---- Option buttons ---- */
.opt-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.opt-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--c-line, #e2e8f0);
  border-radius: 30px;
  background: #fff;
  font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: var(--c-muted, #64748b);
}
.opt-btn:hover { border-color: var(--c-blue, #2563EB); color: var(--c-blue, #2563EB); }
.opt-btn.is-active { background: var(--c-blue, #2563EB); border-color: var(--c-blue, #2563EB); color: #fff; }

/* ---- Installment preview box ---- */
.inst-preview {
  background: linear-gradient(135deg, #f0f5ff 0%, #eef9f6 100%);
  border: 1.5px solid var(--c-line, #e2e8f0);
  border-radius: 16px;
  padding: 20px 24px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.inst-preview.is-hidden { display: none; }
.ip-row { display: flex; flex-direction: column; }
.ip-label { font-size: .72rem; font-weight: 600; color: var(--c-muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
.ip-val { font-size: 1.05rem; font-weight: 700; color: var(--c-navy, #0D1B3D); }
.ip-highlight {
  grid-column: 1 / -1;
  background: var(--c-blue, #2563EB);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.ip-highlight .ip-label { color: rgba(255,255,255,.75); }
.ip-highlight .ip-val { font-size: 1.5rem; color: #fff; }

/* ---- Form grid ---- */
.apply-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.apply-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .apply-grid { grid-template-columns: 1fr; } .apply-grid .full { grid-column: 1; } }

.apply-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .83rem; font-weight: 600; color: var(--c-navy, #0D1B3D); }
.apply-grid input, .apply-grid select, .apply-grid textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--c-line, #e2e8f0);
  border-radius: 10px;
  font: inherit; font-weight: 400;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.apply-grid input:focus, .apply-grid select:focus, .apply-grid textarea:focus {
  outline: 0;
  border-color: var(--c-blue, #2563EB);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.req { color: var(--c-danger, #ef4444); margin-left: 2px; }

/* ---- Summary (step 3) ---- */
.apply-summary {
  background: var(--c-bg, #F2F4F7);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.apply-summary h4 { font-size: .85rem; font-weight: 700; color: var(--c-muted, #64748b); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 14px; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--c-line, #e2e8f0); font-size: .88rem; }
.sum-row:last-child { border-bottom: none; }
.sum-row b { color: var(--c-navy, #0D1B3D); }
.sum-highlight { background: var(--c-blue, #2563EB); color: #fff; border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.sum-highlight span { font-size: .82rem; opacity: .8; }
.sum-highlight b { font-size: 1.3rem; }

/* ---- PDPA consent ---- */
.consent-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  font-size: .83rem;
  color: var(--c-ink, #1e293b);
  line-height: 1.6;
}
.consent-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin-top: 12px; font-size: .85rem; }
.consent-check input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; accent-color: var(--c-blue, #2563EB); }

/* ---- Navigation buttons ---- */
.step-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 28px; gap: 12px;
}
.step-nav .btn-back {
  background: none; border: 1.5px solid var(--c-line, #e2e8f0);
  color: var(--c-muted, #64748b);
  padding: 11px 24px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.step-nav .btn-back:hover { border-color: var(--c-navy, #0D1B3D); color: var(--c-navy, #0D1B3D); }
.step-nav .btn-next {
  flex: 1;
  background: var(--c-blue, #2563EB);
  color: #fff; border: none;
  padding: 13px 28px; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer;
  font-size: .95rem;
  transition: background .2s, opacity .2s;
}
.step-nav .btn-next:hover { background: #1d4ed8; }
.step-nav .btn-next:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Success screen ---- */
#applySuccess {
  display: none;
  text-align: center;
  padding: 48px 24px;
  max-width: 480px;
  margin: 0 auto;
}
#applySuccess.is-visible { display: block; animation: fadeUp .4s ease; }
.success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #22D3A5, #2563EB);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
}
#applySuccess h2 { color: var(--c-navy, #0D1B3D); margin: 0 0 10px; font-size: 1.5rem; }
#applySuccess p { color: var(--c-muted, #64748b); font-size: .9rem; line-height: 1.7; }
.ref-box {
  background: var(--c-bg, #F2F4F7);
  border-radius: 12px;
  padding: 14px 20px;
  margin: 20px 0;
  font-size: .82rem;
  color: var(--c-muted, #64748b);
}
.ref-box b { font-size: 1rem; color: var(--c-navy, #0D1B3D); }

/* ---- Error message ---- */
.apply-err { color: var(--c-danger, #ef4444); font-size: .83rem; margin-top: 8px; min-height: 20px; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .step-card { padding: 24px 18px; }
  .inst-preview { grid-template-columns: 1fr; }
  .step-progress { gap: 20px; }
  .sp-item:not(:last-child)::after { width: calc(100% + 4px); }
}
