/* Bridge to Pakistan — responsive + form UX */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

#root {
  min-width: 0;
  width: 100%;
}

.btp-page {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem 0.85rem 2rem;
}

@media (min-width: 640px) {
  .btp-page { padding: 1.25rem 1rem 2.5rem; }
}

.btp-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.btp-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btp-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.btp-nav-brand span {
  font-weight: 700;
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  background: linear-gradient(90deg, #047857, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btp-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}

@media (min-width: 900px) {
  .btp-nav-toggle { display: none; }
}

.btp-nav-links {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.btp-nav-links.open { display: flex; }

.btp-nav-links button,
.btp-nav-links .btp-chip {
  text-align: left;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
}

.btp-nav-links button:hover { background: #ecfdf5; color: #047857; }

.btp-nav-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e2e8f0;
  width: 100%;
}

.btp-nav-account button {
  width: auto !important;
}

@media (min-width: 900px) {
  .btp-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .btp-nav-top { flex: 1; }
  .btp-nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    padding: 0;
    margin: 0;
    border: 0;
    width: auto;
  }
  .btp-nav-links button,
  .btp-nav-links .btp-chip {
    width: auto;
    padding: 0.35rem 0.5rem;
  }
  .btp-nav-account {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
    width: auto;
  }
}

.btp-hero h1 {
  font-size: clamp(1.35rem, 5vw, 2.25rem);
  line-height: 1.25;
  word-break: break-word;
}

.btp-hero p {
  font-size: clamp(0.875rem, 2.8vw, 1rem);
}

.btp-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btp-search-row input {
  flex: 1 1 12rem;
  min-width: 0;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
}

.btp-card-section {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  padding: 1rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .btp-card-section { padding: 1.35rem; }
}

.btp-card-section input,
.btp-card-section select,
.btp-card-section textarea,
.btp-card-section button {
  max-width: 100%;
}

.btp-card-section label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.btp-card-section input[type="text"],
.btp-card-section input[type="email"],
.btp-card-section input[type="tel"],
.btp-card-section input[type="number"],
.btp-card-section input[type="search"],
.btp-card-section input[type="file"],
.btp-card-section select,
.btp-card-section textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 16px; /* prevent iOS zoom */
  background: #fff;
  color: #0f172a;
}

.btp-card-section input:focus,
.btp-card-section select:focus,
.btp-card-section textarea:focus {
  outline: 2px solid #34d399;
  outline-offset: 1px;
  border-color: #10b981;
}

.btp-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

@media (min-width: 640px) {
  .btp-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.btp-steps li {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  text-align: center;
}

.btp-steps li.active {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.btp-steps li.done {
  color: #065f46;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.btp-selected-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
}

.file-upload-label {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px dashed #94a3b8;
  border-radius: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  color: #334155;
  font-size: 0.875rem;
  cursor: pointer;
}

.file-upload-label.uploaded {
  border-style: solid;
  border-color: #34d399;
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
}

.file-upload-label:hover {
  border-color: #10b981;
  background: #f0fdf4;
}


.btp-modal-panel {
  width: calc(100% - 1.5rem);
  max-width: 42rem;
  margin: 0.75rem;
  max-height: min(85vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.btp-login-card {
  width: calc(100% - 1.5rem);
  max-width: 24rem;
  margin: 1rem;
  padding: 1.5rem !important;
}

.btp-product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .btp-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .btp-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.btp-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .btp-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.btp-submit-sticky {
  position: sticky;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 20;
}

@media (max-width: 639px) {
  .btp-hide-sm { display: none !important; }
}

/* Welcome toast — top right, auto-dismiss after 5s (alert style) */
.btp-welcome-user,
#btpWelcome.lfe-welcome-user,
.btp-welcome-toast {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  left: auto;
  z-index: 60;
  margin: 0;
  padding: 0.55rem 0.65rem 0.55rem 0.9rem;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid #a7f3d0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  max-width: min(22rem, calc(100vw - 1.5rem));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  animation: btp-welcome-in 0.25s ease-out;
}

.btp-welcome-text {
  flex: 1;
  min-width: 0;
}

.btp-welcome-dismiss {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: transparent;
  color: #047857;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 0.35rem;
  opacity: 0.7;
}
.btp-welcome-dismiss:hover {
  opacity: 1;
  background: #d1fae5;
}

@keyframes btp-welcome-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.btp-app-status-mount {
  margin: 0.75rem auto 0;
  max-width: 80rem;
  padding: 0;
}

/* Hide floating LFE auth chip — React header owns account UI */
#lfe-auth-bar.btp-auth-bar-hidden,
.btp-auth-bar-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Header account: name/email (opens profile) + Sign out */
.btp-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.btp-user-chip:hover {
  background: #d1fae5;
}

.btp-user-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.btp-user-chip-text strong {
  font-size: 0.8rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btp-user-chip-text small {
  font-size: 0.68rem;
  font-weight: 500;
  color: #059669;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btp-signout-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btp-signout-btn:hover {
  background: #fef2f2;
}

/* Application detail + bank chat under Application status */
.btp-app-detail-mount {
  margin: 0.85rem 0 0;
}

.btp-app-detail-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.btp-app-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .btp-app-detail-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.btp-app-detail-card,
.btp-app-chat-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 16rem;
}

.btp-app-detail-head,
.btp-app-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.btp-app-detail-head h3,
.btp-app-chat-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.btp-app-detail-close {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.btp-app-chat-status {
  font-size: 0.72rem;
  color: #64748b;
  text-align: right;
  max-width: 55%;
}

.btp-app-detail-body {
  padding: 0.85rem 1rem 1rem;
}

.btp-app-detail-dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.btp-app-detail-dl > div {
  display: grid;
  gap: 0.15rem;
}

.btp-app-detail-dl dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 600;
}

.btp-app-detail-dl dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.btp-app-detail-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
  font-weight: 700;
}

.btp-app-chat-messages {
  flex: 1;
  min-height: 11rem;
  max-height: 18rem;
  overflow: auto;
  padding: 0.75rem 1rem;
  background: #f8fafc;
}

.btp-app-chat-empty {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: #64748b;
}

.btp-chat-bubble {
  max-width: 90%;
  margin: 0.45rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
}

.btp-chat-bubble.you {
  margin-left: auto;
  background: #d1fae5;
  color: #064e3b;
}

.btp-chat-bubble.bank {
  margin-right: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.btp-chat-meta {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: 0.2rem;
}

.btp-app-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.btp-app-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.btp-app-chat-form button {
  border: none;
  border-radius: 0.55rem;
  padding: 0.55rem 0.9rem;
  background: #059669;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btp-app-chat-form button:disabled,
.btp-app-chat-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
