/* ─────────────────────────────────────────────────────────────────────────────
   LoanPress Public Stylesheet
   ───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --lp-blue:    #1e40af;
  --lp-blue-lt: #eff6ff;
  --lp-green:   #059669;
  --lp-red:     #dc2626;
  --lp-amber:   #d97706;
  --lp-border:  #e2e8f0;
  --lp-muted:   #64748b;
  --lp-text:    #0f172a;
  --lp-bg:      #f8fafc;
  --lp-radius:  12px;
  --lp-shadow:  0 2px 8px rgba(0,0,0,.07);
  --lp-shadow-lg:0 8px 32px rgba(0,0,0,.12);
}

.lp-pub * { box-sizing: border-box; }
.lp-pub { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--lp-text); max-width: 820px; margin: 0 auto; padding: 0 16px 40px; }

/* ── Step indicators ────────────────────────────────────────────────────────── */
.lp-steps { display: flex; align-items: center; margin-bottom: 28px; padding: 0 4px; }
.lp-steps__item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: default; flex-shrink: 0; }
.lp-steps__dot { width: 32px; height: 32px; border-radius: 50%; background: var(--lp-border); color: var(--lp-muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; transition: all .25s; }
.lp-steps__item span { font-size: 11px; color: var(--lp-muted); white-space: nowrap; }
.lp-steps__item--active .lp-steps__dot { background: var(--lp-blue); color: #fff; box-shadow: 0 0 0 4px var(--lp-blue-lt); }
.lp-steps__item--active span { color: var(--lp-blue); font-weight: 600; }
.lp-steps__item--done .lp-steps__dot { background: var(--lp-green); color: #fff; }
.lp-steps__line { flex: 1; height: 2px; background: var(--lp-border); margin: 0 6px; margin-bottom: 18px; }

/* ── Form card ──────────────────────────────────────────────────────────────── */
.lp-form-card { background: #fff; border-radius: var(--lp-radius); box-shadow: var(--lp-shadow-lg); border: 1px solid var(--lp-border); padding: 32px; }
.lp-form-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.lp-form-sub { font-size: 14px; color: var(--lp-muted); margin: 0 0 24px; }

/* ── Loan type grid ────────────────────────────────────────────────────────── */
.lp-loan-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 24px; }
.lp-type-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 16px 10px; border-radius: 10px; border: 2px solid var(--lp-border); background: var(--lp-bg); cursor: pointer; transition: all .2s; text-align: center; }
.lp-type-card:hover { border-color: var(--lp-blue); background: var(--lp-blue-lt); }
.lp-type-card--selected { border-color: var(--lp-blue); background: var(--lp-blue-lt); }
.lp-type-card input { display: none; }
.lp-type-card__icon { font-size: 26px; }
.lp-type-card__label { font-size: 12px; font-weight: 600; }
.lp-type-card__max { font-size: 10px; color: var(--lp-muted); }

/* ── Fields ─────────────────────────────────────────────────────────────────── */
.lp-field { margin-bottom: 16px; }
.lp-field label { font-size: 13px; font-weight: 600; color: var(--lp-muted); display: block; margin-bottom: 5px; }
.lp-field--full { grid-column: 1 / -1; }
.lp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .lp-grid-2 { grid-template-columns: 1fr; } .lp-steps__item span { display: none; } }

.lp-input-pub, .lp-select-pub, .lp-textarea {
  width: 100%; padding: 10px 14px; font-size: 14px; font-family: inherit;
  border: 1.5px solid var(--lp-border); border-radius: 9px; background: #fff; color: var(--lp-text);
  transition: border-color .15s, box-shadow .15s;
}
.lp-input-pub:focus, .lp-select-pub:focus, .lp-textarea:focus {
  outline: none; border-color: var(--lp-blue); box-shadow: 0 0 0 3px rgba(30,64,175,.1);
}
.lp-input-error { border-color: var(--lp-red) !important; }
.lp-textarea { resize: vertical; min-height: 70px; }

.lp-input-prefix { position: relative; }
.lp-input-prefix span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--lp-muted); font-size: 14px; font-weight: 600; pointer-events: none; }
.lp-input-prefix .lp-input-pub { padding-left: 36px; }

/* ── Slider ─────────────────────────────────────────────────────────────────── */
.lp-amount-display { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lp-currency { font-size: 18px; font-weight: 700; color: var(--lp-blue); flex-shrink: 0; }
.lp-amount-num { font-size: 22px; font-weight: 700; border: none; outline: none; width: 100%; color: var(--lp-blue); font-family: inherit; background: none; }
.lp-slider { width: 100%; height: 6px; -webkit-appearance: none; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--lp-blue) var(--progress, 30%), var(--lp-border) var(--progress, 30%)); outline: none; cursor: pointer; }
.lp-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--lp-blue); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(30,64,175,.4); cursor: pointer; }
.lp-slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--lp-muted); margin-top: 4px; }

/* ── Calc preview ───────────────────────────────────────────────────────────── */
.lp-calc-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--lp-blue-lt); border: 1px solid #bfdbfe; border-radius: 10px; padding: 16px; margin: 20px 0 0; opacity: 0; transition: opacity .3s; }
.lp-calc-preview--loaded { opacity: 1; }
.lp-calc-preview__item { text-align: center; }
.lp-calc-preview__item span { font-size: 11px; color: var(--lp-muted); display: block; text-transform: uppercase; letter-spacing: .05em; }
.lp-calc-preview__item strong { font-size: 16px; font-weight: 700; color: var(--lp-blue); }

/* ── Step nav ───────────────────────────────────────────────────────────────── */
.lp-step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--lp-border); }

/* ── Buttons (public) ───────────────────────────────────────────────────────── */
.lp-btn-pub { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; font-size: 14px; font-weight: 600; font-family: inherit; border-radius: 9px; border: 1.5px solid transparent; cursor: pointer; transition: all .18s; text-decoration: none; line-height: 1.4; }
.lp-btn-pub--primary { background: var(--lp-blue);  color: #fff; border-color: var(--lp-blue);  } .lp-btn-pub--primary:hover  { background: #1d3aa3; color: #fff; }
.lp-btn-pub--outline  { background: #fff; color: var(--lp-blue); border-color: var(--lp-blue); } .lp-btn-pub--outline:hover  { background: var(--lp-blue-lt); }
.lp-btn-pub--ghost    { background: var(--lp-bg); color: var(--lp-muted); border-color: var(--lp-border); }

/* ── Section title ──────────────────────────────────────────────────────────── */
.lp-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--lp-muted); margin: 20px 0 10px; border-top: 1px solid var(--lp-border); padding-top: 16px; }
.lp-muted-text { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── Guarantor block ────────────────────────────────────────────────────────── */
.lp-guarantor-block { background: var(--lp-bg); border: 1px solid var(--lp-border); border-radius: 9px; padding: 16px; margin-bottom: 12px; }
.lp-guarantor-block__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; }
.lp-remove-guarantor { background: none; border: none; color: var(--lp-red); cursor: pointer; font-size: 16px; padding: 0; line-height: 1; }

/* ── Doc uploads ────────────────────────────────────────────────────────────── */
.lp-doc-upload { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--lp-border); flex-wrap: wrap; }
.lp-doc-upload:last-child { border-bottom: none; }
.lp-doc-upload__info { flex: 1; min-width: 180px; }
.lp-doc-upload__label { font-size: 13px; font-weight: 500; display: block; }
.lp-doc-upload__status { font-size: 11px; color: var(--lp-muted); }
.lp-upload-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 7px; border: 1.5px dashed var(--lp-border); background: var(--lp-bg); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--lp-blue); transition: all .15s; }
.lp-upload-btn:hover { border-color: var(--lp-blue); background: var(--lp-blue-lt); }
.lp-req { color: var(--lp-red); }
.lp-note { font-size: 12px; color: var(--lp-muted); margin-top: 12px; }

/* ── Review summary ─────────────────────────────────────────────────────────── */
.lp-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 600px) { .lp-review-grid { grid-template-columns: 1fr; } }
.lp-review-section { background: var(--lp-bg); border-radius: 9px; padding: 14px 16px; }
.lp-review-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-muted); margin: 0 0 10px; }
.lp-review-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.lp-review-dl dt { color: var(--lp-muted); }
.lp-review-dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ── Terms ──────────────────────────────────────────────────────────────────── */
.lp-terms { margin: 16px 0; }
.lp-checkbox-label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
.lp-checkbox-label input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--lp-blue); }

/* ── Error box ──────────────────────────────────────────────────────────────── */
.lp-error-box { background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d; border-radius: 8px; padding: 12px 16px; font-size: 13px; margin-bottom: 12px; }
.lp-step-error { color: var(--lp-red); font-size: 13px; text-align: center; }

/* ── Success screen ─────────────────────────────────────────────────────────── */
.lp-success-screen { text-align: center; padding: 32px 0; }
.lp-success-icon { font-size: 56px; margin-bottom: 16px; }
.lp-success-screen h2 { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.lp-success-screen p { color: var(--lp-muted); font-size: 15px; margin: 0 0 8px; }
.lp-app-no strong { color: var(--lp-blue); font-size: 18px; }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.lp-dash-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.lp-dash-header h2 { font-size: 20px; font-weight: 700; margin: 0; }

.lp-pub-empty { text-align: center; padding: 60px 20px; background: #fff; border-radius: var(--lp-radius); border: 1px solid var(--lp-border); }
.lp-pub-empty__icon { font-size: 48px; margin-bottom: 12px; }
.lp-pub-empty h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.lp-pub-empty p { color: var(--lp-muted); font-size: 14px; margin: 0; }

.lp-pub-loan-card { background: #fff; border-radius: var(--lp-radius); border: 1px solid var(--lp-border); padding: 24px; margin-bottom: 20px; box-shadow: var(--lp-shadow); }
.lp-pub-loan-card__head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.lp-pub-loan-card__no { font-size: 15px; font-weight: 700; }
.lp-pub-loan-card__type { font-size: 12px; color: var(--lp-muted); margin-top: 2px; }
.lp-pub-loan-card__amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.lp-pub-loan-card__amt-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--lp-muted); }
.lp-pub-loan-card__amt { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* Repay bar */
.lp-pub-repay-bar { margin-top: 8px; }
.lp-pub-repay-bar__labels { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.lp-pub-repay-bar__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--lp-muted); margin-top: 4px; }
.lp-pub-overdue-alert { background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d; border-radius: 7px; padding: 8px 12px; font-size: 12px; font-weight: 500; margin-top: 10px; }

.lp-progress { height: 8px; background: var(--lp-border); border-radius: 99px; overflow: hidden; }
.lp-progress__bar { height: 100%; background: linear-gradient(90deg, var(--lp-green), #34d399); border-radius: 99px; transition: width .5s; }

/* Schedule accordion */
.lp-pub-schedule { margin-top: 16px; border-top: 1px solid var(--lp-border); padding-top: 12px; }
.lp-pub-schedule summary { font-size: 13px; font-weight: 600; color: var(--lp-blue); cursor: pointer; list-style: none; }
.lp-pub-schedule summary::before { content: '▶ '; font-size: 10px; }
.lp-pub-schedule[open] summary::before { content: '▼ '; }
.lp-pub-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
.lp-pub-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--lp-muted); padding: 6px 8px; text-align: left; border-bottom: 2px solid var(--lp-border); }
.lp-pub-table td { padding: 7px 8px; border-bottom: 1px solid var(--lp-border); }
.lp-overdue-row { background: #fff5f5; }

/* ── Status badges ──────────────────────────────────────────────────────────── */
.lp-status { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.lp-status--pending     { background: #fef3c7; color: #92400e; }
.lp-status--under_review{ background: #dbeafe; color: #1e40af; }
.lp-status--approved    { background: #d1fae5; color: #065f46; }
.lp-status--disbursed   { background: #ede9fe; color: #5b21b6; }
.lp-status--active      { background: #dcfce7; color: #14532d; }
.lp-status--defaulted   { background: #fee2e2; color: #7f1d1d; }
.lp-status--closed      { background: #f1f5f9; color: #334155; }
.lp-status--rejected    { background: #fee2e2; color: #991b1b; }
.lp-status--draft       { background: #f1f5f9; color: #64748b; }
.lp-status--paid        { background: #d1fae5; color: #065f46; }
.lp-status--overdue     { background: #fee2e2; color: #7f1d1d; }
.lp-status--partial     { background: #fef3c7; color: #92400e; }

/* ── Login prompt ───────────────────────────────────────────────────────────── */
.lp-public-notice { background: var(--lp-blue-lt); border: 1px solid #bfdbfe; border-radius: 10px; padding: 24px; text-align: center; }
.lp-public-notice p { font-size: 15px; margin: 0 0 14px; }
.lp-public-btn { display: inline-block; background: var(--lp-blue); color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }

/* ── Public Discussion Thread ───────────────────────────────────────────────── */
.lp-pub-thread { margin-top: 16px; border-top: 1px solid var(--lp-border); padding-top: 14px; }
.lp-pub-thread summary { font-size: 13px; font-weight: 600; color: var(--lp-blue); cursor: pointer; list-style: none; }
.lp-pub-thread summary::before { content: '💬 '; }
.lp-pub-messages { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.lp-pub-msg { display: flex; gap: 8px; align-items: flex-start; }
.lp-pub-msg--mine { flex-direction: row-reverse; }
.lp-pub-msg__avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.lp-pub-msg__body { max-width: 70%; background: var(--lp-bg); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.lp-pub-msg--mine .lp-pub-msg__body { background: var(--lp-blue-lt); }
.lp-pub-msg__name { font-size: 10px; color: var(--lp-muted); margin-bottom: 3px; font-weight: 600; }
.lp-pub-msg__text { line-height: 1.5; }
.lp-pub-compose { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-pub-compose textarea { flex: 1; min-width: 200px; }

/* ── Appeal button ───────────────────────────────────────────────────────────── */
.lp-appeal-section { margin-top: 16px; border-top: 1px solid var(--lp-border); padding-top: 14px; }
.lp-appeal-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 9px; padding: 14px; }
.lp-appeal-box h4 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.lp-appeal-box p { font-size: 13px; color: var(--lp-muted); margin: 0 0 10px; }

/* ── Feature banner ─────────────────────────────────────────────────────────── */
.lp-apply-banner { border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.lp-apply-banner img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.lp-apply-banner--default { background: linear-gradient(135deg, #2e2545 0%, #1e40af 100%); padding: 40px 32px; border-radius: 12px; margin-bottom: 24px; }
.lp-apply-banner__text h2 { color: #fff; font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.lp-apply-banner__text p  { color: rgba(255,255,255,.75); font-size: 14px; margin: 0; }

/* ── Improved product cards (fix: show name not icon text) ──────────────────── */
.lp-loan-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.lp-type-card { display: flex; flex-direction: column; border-radius: 10px; border: 2px solid var(--lp-border); background: #fff; cursor: pointer; transition: all .2s; text-align: center; overflow: hidden; }
.lp-type-card:hover { border-color: var(--product-color, var(--lp-blue)); box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.lp-type-card--selected { border-color: var(--product-color, var(--lp-blue)); box-shadow: 0 0 0 3px rgba(46,37,69,.12); }
.lp-type-card input { display: none; }
.lp-type-card__header { padding: 14px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.lp-type-card__icon { font-size: 26px; line-height: 1; }
.lp-type-card__mode-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.25); color: #fff; padding: 2px 6px; border-radius: 99px; }
.lp-type-card__info { padding: 8px 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lp-type-card__label { font-size: 13px; font-weight: 700; color: var(--lp-text); line-height: 1.3; }
.lp-type-card__max { font-size: 11px; color: var(--lp-muted); }
.lp-type-card__desc { font-size: 10px; color: var(--lp-muted); margin-top: 2px; }

/* ── Selected product bar ───────────────────────────────────────────────────── */
.lp-selected-product-bar { display: flex; align-items: center; gap: 10px; background: var(--lp-blue-lt); border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 16px; margin-bottom: 16px; font-size: 13px; }
.lp-selected-product-label { color: var(--lp-muted); }
.lp-selected-product-bar strong { font-weight: 700; }

/* ── Payday info box ────────────────────────────────────────────────────────── */
.lp-payday-info { margin-top: 4px; }

/* ── Section divider in form ───────────────────────────────────────────────── */
.lp-section-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--lp-muted); padding: 10px 0 0; border-top: 1px solid var(--lp-border); margin-top: 8px; }

/* ── Applying-for pill on each step ────────────────────────────────────────── */
.lp-applying-for-pill { display: inline-flex; align-items: center; gap: 6px; background: #f0fdf4; border: 1px solid #86efac; border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 600; color: #166534; margin-bottom: 16px; }
.lp-applying-for-pill:empty { display: none; }

/* LoanPress UI refresh */
.lp-pub {
  --lp-blue: #0f6b5f;
  --lp-blue-lt: #eef7f4;
  --lp-green: #168465;
  --lp-red: #b42318;
  --lp-amber: #b7791f;
  --lp-border: #d7ded9;
  --lp-muted: #5d6b66;
  --lp-text: #16211e;
  --lp-bg: #f6f8f6;
  --lp-radius: 8px;
  --lp-shadow: 0 1px 2px rgba(16, 24, 20, .06);
  --lp-shadow-lg: 0 18px 48px rgba(16, 24, 20, .10);
  max-width: 960px;
  letter-spacing: 0;
}

.lp-form-card,
.lp-pub-loan-card,
.lp-pub-empty,
.lp-public-notice {
  border-color: #d9e2dc;
  box-shadow: var(--lp-shadow);
}

.lp-form-card { padding: clamp(22px, 4vw, 40px); }
.lp-form-title,
.lp-dash-header h2,
.lp-success-screen h2 {
  color: #12201c;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.15;
}

.lp-form-sub,
.lp-note,
.lp-public-notice p {
  color: #52615c;
  line-height: 1.55;
}

.lp-steps { gap: 8px; margin-bottom: 22px; }
.lp-steps__dot {
  width: 34px;
  height: 34px;
  border: 1px solid #d7ded9;
  background: #fff;
  color: #60706a;
}
.lp-steps__item--active .lp-steps__dot {
  background: #0f6b5f;
  box-shadow: 0 0 0 4px #e4f2ee;
}
.lp-steps__line { background: #d7ded9; }

.lp-type-card {
  align-items: stretch;
  padding: 0;
  border: 1px solid #d7ded9;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 20, .04);
}
.lp-type-card:hover,
.lp-type-card--selected {
  border-color: #0f6b5f;
  background: #fbfdfc;
  box-shadow: 0 10px 28px rgba(15, 107, 95, .12);
  transform: translateY(-1px);
}
.lp-type-card__header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}
.lp-type-card__info {
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: left;
}
.lp-type-card__label { color: #16211e; font-size: 14px; }

.lp-input-pub,
.lp-select-pub,
.lp-textarea,
.lp-phone-wrap {
  border-color: #cfd8d2 !important;
  border-radius: 8px !important;
  min-height: 42px;
}
.lp-input-pub:focus,
.lp-select-pub:focus,
.lp-textarea:focus,
.lp-phone-wrap:focus-within {
  border-color: #0f6b5f !important;
  box-shadow: 0 0 0 4px rgba(15, 107, 95, .12) !important;
}

.lp-btn-pub {
  border-radius: 8px;
  min-height: 40px;
  font-weight: 650;
}
.lp-btn-pub--primary,
.lp-public-btn {
  background: #0f6b5f;
  border-color: #0f6b5f;
  color: #fff;
}
.lp-btn-pub--primary:hover,
.lp-public-btn:hover {
  background: #0b554c;
  border-color: #0b554c;
}
.lp-btn-pub--outline {
  color: #0f6b5f;
  border-color: #8db9ad;
}

.lp-calc-preview,
.lp-review-section,
.lp-guarantor-block {
  background: #f3f7f5;
  border-color: #d7e3dd;
}
.lp-doc-upload { padding: 16px 0; }
.lp-upload-btn {
  border-style: solid;
  border-color: #bfd0c8;
  background: #fff;
  color: #0f6b5f;
}
.lp-status {
  border-radius: 999px;
  letter-spacing: .02em;
}

/* Borrower account dashboard refresh */
.lp-dash {
  --lp-accent: #0f6b5f;
  --lp-ink: #111827;
  --lp-subtle: #647067;
  --lp-line: #dfe7e2;
  --lp-panel: #ffffff;
  --lp-canvas: #f7f9f7;
  max-width: 1120px;
  padding: 24px 16px 48px;
  color: var(--lp-ink);
}

.lp-dash-topbar {
  padding: 16px 18px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(16, 24, 20, .06);
}

.lp-dash-topbar__logo {
  width: 40px;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--lp-line);
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.lp-dash-topbar__company {
  color: var(--lp-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.lp-dash-topbar__greeting {
  color: var(--lp-subtle);
  font-size: 13px;
  font-weight: 650;
}

.lp-dash-kpi-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.lp-dash-kpi {
  min-height: 126px;
  align-items: flex-start;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(16, 24, 20, .06);
}

.lp-dash-kpi__icon {
  width: 44px;
  height: 44px;
  border: 1px solid #d8e5df;
  border-radius: 9px;
  background: #f4faf7 !important;
  color: var(--lp-accent) !important;
}

.lp-dash-kpi__icon .dashicons {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.lp-dash-kpi__val {
  color: var(--lp-ink);
  font-size: 24px;
  font-weight: 850;
}

.lp-dash-kpi__label {
  margin-top: 7px;
  color: var(--lp-subtle);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.lp-dash-alert {
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.lp-dash-alert--warn {
  border-color: #ead9b7;
  color: #8a5714;
}

.lp-dash-alert--info {
  border-color: #cddbf9;
  color: #2459bc;
}

.lp-dash-tabs {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #edf3f0;
}

.lp-dash-tab {
  min-height: 38px;
  border-radius: 7px;
  color: #53615c;
  letter-spacing: 0;
}

.lp-dash-tab .dashicons {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.lp-dash-tab--active {
  background: #fff;
  color: var(--lp-accent);
  box-shadow: 0 8px 22px rgba(16, 24, 20, .08);
}

.lp-dash .lp-pub-loan-card,
.lp-dash .lp-pub-empty {
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(16, 24, 20, .06);
}

.lp-dash .lp-pub-empty__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e5df;
  border-radius: 10px;
  background: #f4faf7;
  color: var(--lp-accent);
  font-size: 0;
}

.lp-dash .lp-pub-empty__icon .dashicons {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.lp-dash .lp-status,
.lp-dash .lp-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #e1e5ee;
  border-radius: 999px;
  background: #fff;
  color: #424a5f;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lp-dash .lp-status--draft,
.lp-dash .lp-status--closed {
  border-color: #dfe3ec;
  color: #657086;
}

.lp-dash .lp-status--pending,
.lp-dash .lp-status--partial,
.lp-dash .lp-status--submitted {
  border-color: #ead9b7;
  color: #a86a16;
}

.lp-dash .lp-status--under_review {
  border-color: #cddbf9;
  color: #2563eb;
}

.lp-dash .lp-status--approved,
.lp-dash .lp-status--active,
.lp-dash .lp-status--paid {
  border-color: #cbe9db;
  color: #0f8f61;
}

.lp-dash .lp-status--disbursed,
.lp-dash .lp-status--signed,
.lp-dash .lp-status--agreement_issued,
.lp-dash .lp-status--awaiting_signature {
  border-color: #d8e5df;
  color: var(--lp-accent);
}

.lp-dash .lp-status--defaulted,
.lp-dash .lp-status--rejected,
.lp-dash .lp-status--overdue {
  border-color: #f2c9ce;
  color: #d92d3a;
}

.lp-dash .lp-bank-box {
  border-color: #d8e5df;
  border-radius: 8px;
  background: #f8fbf9;
}

.lp-dash .lp-bank-box__title {
  color: var(--lp-ink);
}

.lp-dash .lp-bank-instr {
  background: #eef7f4;
  color: #245d53;
}

.lp-dash .lp-appeal-box {
  border-color: #ead9b7;
  border-radius: 8px;
  background: #fffaf0;
}

.lp-dash .lp-profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 760px) {
  .lp-dash-kpi-row {
    grid-template-columns: 1fr 1fr;
  }

  .lp-dash-topbar,
  .lp-dash-topbar__user {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .lp-pub { padding-inline: 12px; }
  .lp-form-card { padding: 20px 16px; }
  .lp-step-nav {
    gap: 10px;
    align-items: stretch;
  }
  .lp-step-nav .lp-btn-pub {
    justify-content: center;
    flex: 1;
  }
}

/* Borrower dashboard final layout guard */
.lp-pub.lp-dash {
  --lp-accent: #123f37;
  --lp-accent-hover: #0d302a;
  --lp-ink: #111816;
  --lp-subtle: #66736f;
  --lp-line: #dde5e0;
  --lp-canvas: #f6f8f6;
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
  margin: 32px auto 56px;
  padding: 24px;
  border: 1px solid var(--lp-line);
  border-radius: 10px;
  background: var(--lp-canvas);
  box-shadow: 0 0 0 100vmax var(--lp-canvas);
  clip-path: inset(0 -100vmax);
}

.lp-dash-topbar,
.lp-dash-topbar__brand,
.lp-dash-topbar__user,
.lp-dash-kpi,
.lp-dash-alert,
.lp-dash-tab,
.lp-pub-loan-card__head,
.lp-pub-repay-bar__labels,
.lp-pub-repay-bar__meta {
  display: flex;
}

.lp-dash-topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.lp-dash-topbar__brand,
.lp-dash-topbar__user,
.lp-dash-tab {
  align-items: center;
}

.lp-dash-topbar__brand {
  gap: 12px;
  min-width: 0;
}

.lp-dash-topbar__user {
  gap: 12px;
  flex-wrap: wrap;
}

.lp-dash-topbar__logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.lp-dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.lp-dash-kpi {
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 16px;
}

.lp-dash-kpi__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.lp-dash-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.lp-dash-tab {
  justify-content: center;
  gap: 7px;
  flex: 1 0 auto;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.lp-dash .lp-pub-loan-card {
  padding: 20px;
  margin-bottom: 14px;
  background: #fff;
}

.lp-pub-loan-card__head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.lp-dash .lp-pub-loan-card__no {
  color: var(--lp-ink);
  font-size: 14px;
  font-weight: 800;
}

.lp-dash .lp-pub-loan-card__type {
  color: var(--lp-subtle);
  font-size: 12px;
}

.lp-dash .lp-pub-loan-card__amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 4px;
  padding-top: 14px;
  border-top: 1px solid #edf1ee;
}

.lp-dash .lp-pub-loan-card__amt-label {
  color: #7a8581;
  font-size: 10px;
  font-weight: 800;
}

.lp-dash .lp-pub-loan-card__amt {
  color: var(--lp-ink);
  font-size: 14px;
  font-weight: 800;
}

.lp-dash .lp-btn-pub--primary,
.lp-dash .lp-btn-pub--outline,
.lp-dash .lp-btn-pub--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 7px;
}

.lp-dash .lp-btn-pub--primary {
  background: var(--lp-accent);
  border-color: var(--lp-accent);
}

.lp-dash .lp-btn-pub--primary:hover {
  background: var(--lp-accent-hover);
  border-color: var(--lp-accent-hover);
}

.lp-dash .lp-status {
  white-space: nowrap;
}

.lp-dash-alert {
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.lp-dash-panel {
  animation: lp-dash-in .16s ease-out;
}

@keyframes lp-dash-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .lp-dash-kpi-row,
  .lp-dash .lp-pub-loan-card__amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lp-pub.lp-dash {
    width: min(100%, calc(100vw - 24px));
    margin-top: 16px;
    padding: 14px;
  }

  .lp-dash-topbar,
  .lp-pub-loan-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .lp-dash-kpi-row,
  .lp-dash .lp-pub-loan-card__amounts {
    grid-template-columns: 1fr;
  }
}
