/*
 * Design tokens copied from the real app (dentalshop-appfrontend):
 *   - fonts: Inter (body), Outfit (headings)  [src/app/globals.css]
 *   - colors: src/theme/colors.ts
 *   - cards: white, 20px radius, 30px padding, soft shadow
 *     (buyer listing page sidebar, src/app/buyer/listings/[id]/page.tsx)
 *   - buttons: pill (border-radius full), primary navy
 */
:root {
  --primary: #0b2f61;
  --primary-50: #e6e9ef;
  --secondary: #425b9b;
  --accent: #4bd2ff;
  --page-bg: #fafafa;
  --input-border: #e2e8f0;
  --separator: #e4e7ec;
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-tertiary: #666666;
  --grey-dark: #7887a0;
  --info-solid: #3a8edc;
  --info-bg: #e2eefb;
  --warning-solid: #ff8f00;
  --warning-bg: #fff2e2;
  --error: #ff4d4f;
  --card-shadow: 0px -10px 40px -7px #0000000a;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Outfit", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  /* leave room for the widget's DRAFT banner */
  padding-top: 22px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin: 0;
}

/* ---------- simplified app shell (placeholder for the real header) ---------- */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--separator);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.app-header .logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}
.app-header nav { display: flex; gap: 18px; }
.app-header nav span {
  color: var(--text-tertiary);
  font-size: 14px;
  cursor: default;
}
.app-header .avatar {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.shell-note {
  background: var(--info-bg);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  padding: 4px 10px;
}

/* ---------- prototype context switcher (not part of the app) ---------- */
.context-switcher {
  max-width: 1100px;
  margin: 18px auto 0;
  padding: 0 20px;
}
.context-switcher .label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.context-switcher .tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.context-tab {
  border: 1px solid var(--input-border);
  background: #ffffff;
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 7px 16px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
}
.context-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* ---------- page layout ---------- */
.page {
  max-width: 1100px;
  margin: 20px auto 60px;
  padding: 0 20px;
}
.two-col {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}
.main-col { flex: 1 1 auto; min-width: 0; }
.side-col { flex: 0 0 365px; max-width: 365px; }

.card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 30px;
}

/* fake listing content (placeholder blocks) */
.listing-title { font-size: 24px; margin-bottom: 4px; }
.listing-sub { color: var(--text-tertiary); font-size: 14px; margin-bottom: 16px; }
.listing-price {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}
.ph-img {
  border-radius: 10px;
  background: var(--primary-50);
  height: 220px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-dark);
  font-size: 13px;
}
.ph-line { height: 12px; border-radius: 6px; background: var(--separator); margin: 10px 0; }
.ph-line.w80 { width: 80%; }
.ph-line.w60 { width: 60%; }
.ph-line.w90 { width: 90%; }

.badge {
  display: inline-block;
  border-radius: 9999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge.confidential { background: var(--warning-bg); color: var(--warning-solid); }
.badge.public { background: var(--info-bg); color: var(--info-solid); }

/* ---------- calculator ---------- */
.calc-card h2 { font-size: 19px; margin-bottom: 2px; }
.calc-powered {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.calc-powered .bofa {
  color: #cc0000; /* placeholder only — real BofA brand assets pending */
  font-weight: 600;
}

.pending-note {
  background: var(--warning-bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.field .hint { font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.input-wrap { position: relative; }
.input-wrap .prefix, .input-wrap .suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}
.input-wrap .prefix { left: 12px; }
.input-wrap .suffix { right: 12px; }
.field input[type="text"], .field input[type="number"], .field select {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: #ffffff;
}
.field .has-prefix input { padding-left: 26px; }
.field .has-suffix input { padding-right: 30px; }
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.term-chips { display: flex; gap: 8px; margin-bottom: 6px; }
.term-chip {
  border: 1px solid var(--input-border);
  background: #ffffff;
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
}
.term-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.prefill-note {
  font-size: 12px;
  color: var(--info-solid);
  background: var(--info-bg);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
}

.calc-error {
  color: var(--error);
  font-size: 13px;
  margin: 8px 0;
  display: none;
}

.result-block {
  border-top: 1px solid var(--separator);
  margin-top: 16px;
  padding-top: 16px;
}
.result-monthly-label { font-size: 13px; color: var(--text-tertiary); }
.result-monthly {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.result-monthly small { font-size: 14px; color: var(--text-tertiary); font-weight: 400; }
.result-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.result-row .val { font-weight: 600; }
.basis-note { font-size: 11px; color: var(--text-tertiary); margin-top: 10px; }

.btn {
  font-family: var(--font-sans);
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
}
.btn-primary { background: var(--primary); color: #ffffff; width: 100%; margin-top: 14px; }
.btn-primary:hover { background: #123c77; }
.btn-primary:disabled { background: #808080; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  padding: 6px 0;
  font-weight: 400;
  text-decoration: underline;
}
.cta-unavailable {
  display: none;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--warning-bg);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
}

/* ---------- schedule table ---------- */
.schedule-card { margin-top: 30px; }
.schedule-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.schedule-head h3 { font-size: 17px; }
.view-toggle { display: flex; gap: 6px; }
.schedule-scroll { overflow-x: auto; margin-top: 14px; }
table.schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 520px;
}
table.schedule th {
  text-align: right;
  color: var(--text-tertiary);
  font-weight: 600;
  border-bottom: 1px solid var(--separator);
  padding: 8px 10px;
  white-space: nowrap;
}
table.schedule th:first-child, table.schedule td:first-child { text-align: left; }
table.schedule td {
  text-align: right;
  padding: 7px 10px;
  border-bottom: 1px solid var(--separator);
  color: var(--text-secondary);
  white-space: nowrap;
}
table.schedule tr:last-child td { border-bottom: none; }

/* ---------- dashboard context ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.dash-intro h1 { font-size: 26px; margin-bottom: 8px; }
.dash-intro p { color: var(--text-tertiary); font-size: 14px; }

/* ---------- confidential context ---------- */
.conf-banner {
  background: var(--warning-bg);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.conf-banner .dot {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 9999px; background: var(--warning-solid);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}

/* ---------- enviera mark ---------- */
.enviera-mark {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2147483646;
  background: #ffffff;
  border: 1px solid var(--separator);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text-tertiary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .two-col { flex-direction: column; }
  .side-col { flex: 1 1 auto; max-width: none; width: 100%; }
  .dash-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; border-radius: 14px; }
  .app-header nav { display: none; }
}
