/* Provider Directory & Marketplace Design System */
:root {
  --green-dark: #133e33;
  --green-medium: #1b5244;
  --green-light: #2e7865;
  --green-tint: #edf4f1;
  --cream: #f8f9f5;
  --sand: #eef2ec;
  --line: #d6ded9;
  --line-light: #e5ece8;
  --text-main: #133e33;
  --text-muted: #5b6b65;
  --terracotta: #e76a54;
  --gold: #f5c85b;
  --gold-bg: #fff9df;
  --gold-border: #eed588;
  --status-red: #9f3b32;
  --status-red-bg: #fbedeb;
  --status-yellow: #b58914;
  --status-yellow-bg: #fef8e7;
  --status-green: #236c5b;
  --status-green-bg: #eaf5f1;
  --status-blue: #335ca8;
  --status-blue-bg: #edf2fc;
}

body.provider-directory-page {
  background: var(--sand);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.provider-directory-page .topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--green-dark);
}

.brandmark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--green-dark);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  border-radius: 4px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 17px;
  line-height: 1.15;
  color: var(--green-dark);
  font-weight: 700;
}

.brand-copy small {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-utility {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 32px);
  margin-left: auto;
}

.header-utility a {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: none;
  padding: 0;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  color: var(--terracotta);
}

.header-utility a.nav-provider {
  color: var(--terracotta);
}

.header-utility a.nav-provider:hover {
  color: #c9503b;
  text-decoration: underline;
}

.header-utility a.nav-provider.active {
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.header-utility a.nav-sources {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: clamp(12px, 2vw, 36px);
}

@media (max-width: 900px) {
  .header-utility a {
    font-size: 13px;
  }
}

@media (max-width: 700px) {
  .header-utility {
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .header-utility a {
    display: inline-block !important;
  }
}

/* Page Hero */
.provider-route-page {
  min-height: calc(100vh - 68px);
  padding: 42px 0 86px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.provider-intro {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  font-weight: 700;
  margin-bottom: 6px;
}

.provider-intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 4.2vw, 48px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 6px 0 0;
  color: var(--green-dark);
}

.provider-intro p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* Tabs */
.provider-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(19, 62, 51, 0.03);
}

.provider-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.provider-tab:hover {
  background: var(--green-tint);
  color: var(--green-dark);
}

.provider-tab.active {
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 2px 6px rgba(19, 62, 51, 0.18);
}

.provider-tab .tab-icon {
  font-size: 17px;
}

/* Workspace Layout */
.provider-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: start;
}

.provider-directory {
  min-width: 0;
}

/* Filters */
.provider-filters {
  display: grid;
  grid-template-columns: 150px 1.4fr 1fr 1fr;
  gap: 12px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(19, 62, 51, 0.02);
}

.provider-filters-row2 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field select,
.field input {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.field select:focus,
.field input:focus {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 2px rgba(19, 62, 51, 0.12);
}

.field select:disabled,
.field input:disabled {
  background: #f4f6f4;
  color: #8c9893;
  cursor: not-allowed;
  border-style: dashed;
}

.check-filter-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.check-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.check-filter input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--green-dark);
  cursor: pointer;
}

.check-filter.disabled {
  color: #9aa8a2;
  cursor: not-allowed;
}

.check-filter.disabled input {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Data Notice */
.data-notice {
  margin: 18px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--gold);
  background: var(--gold-bg);
  border-radius: 0 10px 10px 0;
  color: #534516;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.data-notice-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.data-notice-count {
  font-size: 15px;
  font-weight: 750;
  color: var(--green-dark);
}

.data-notice ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.data-notice li {
  margin-bottom: 4px;
}

/* Provider Grid */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.provider-card {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 4px rgba(19, 62, 51, 0.02);
}

.provider-card:hover {
  border-color: #b5c7bd;
  box-shadow: 0 6px 16px rgba(19, 62, 51, 0.06);
}

.provider-card.selected-in-carelist {
  border-color: var(--green-dark);
  background: #fcfffd;
  box-shadow: 0 0 0 2px var(--green-dark);
}

.provider-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.coverage-badge {
  display: inline-block;
  padding: 4px 9px;
  background: var(--green-tint);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
}

.provider-card-top small {
  color: #798982;
  font-size: 11px;
}

.provider-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--green-dark);
}

.provider-practice {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #3b5048;
}

.provider-specialty {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--terracotta);
}

.provider-card address {
  margin: 0 0 12px;
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.provider-phone {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  font-size: 13px;
}

.provider-phone a {
  color: var(--green-dark);
  font-weight: 750;
  text-decoration: none;
}

.provider-phone a:hover {
  text-decoration: underline;
}

.provider-phone small {
  color: #8c9a94;
  font-size: 10px;
}

/* Pills */
.provider-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.provider-pill {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #edf0ee;
  color: #55635e;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.provider-pill.verified {
  background: var(--status-green-bg);
  color: var(--status-green);
}

.provider-pill.historical {
  background: var(--status-blue-bg);
  color: var(--status-blue);
}

.provider-pill.warning {
  background: var(--status-yellow-bg);
  color: var(--status-yellow);
}

.provider-pill.negative {
  background: var(--status-red-bg);
  color: var(--status-red);
}

.provider-pill.unknown {
  background: #f0f3f1;
  color: #72827c;
}

.provider-languages {
  margin: 0 0 16px;
  font-size: 12px;
  color: #6d7d77;
  padding: 8px 10px;
  background: #f7f9f7;
  border-radius: 6px;
  border: 1px dashed var(--line);
}

.provider-languages strong {
  color: var(--text-main);
}

/* Card Actions */
.provider-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-light);
}

.add-care-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.add-care-button:hover {
  background: var(--green-medium);
  box-shadow: 0 2px 6px rgba(19, 62, 51, 0.2);
}

.add-care-button.in-cart {
  background: #e6f2ed;
  color: var(--green-dark);
  border-color: var(--green-light);
}

.provider-actions a.source-link {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.provider-actions a.source-link:hover {
  text-decoration: underline;
}

/* Care List Sidebar */
.care-list {
  position: sticky;
  top: 88px;
  padding: 24px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(19, 62, 51, 0.15);
}

.care-list h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
  margin: 6px 0 18px;
  letter-spacing: -0.02em;
}

.care-list .eyebrow {
  color: var(--gold);
}

.care-list-section {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.care-list-section label,
.care-list-section small.section-title {
  display: block;
  color: #b7d1c8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.care-list-section select {
  width: 100%;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.care-list-section select option {
  background: #133e33;
  color: #fff;
}

.selected-provider-box {
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.selected-provider-box strong {
  display: block;
  font-size: 14px;
  color: #fff;
  margin-bottom: 2px;
}

.selected-provider-box p {
  margin: 0;
  font-size: 12px;
  color: #cbe0d9;
  line-height: 1.4;
}

.selected-provider-box button.clear-provider {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #ffd982;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

/* PCP Toggle Alert */
.pcp-option-box {
  margin-top: 10px;
  padding: 10px;
  background: rgba(245, 200, 91, 0.12);
  border: 1px solid rgba(245, 200, 91, 0.35);
  border-radius: 8px;
}

.pcp-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe6a3;
  cursor: pointer;
}

.pcp-checkbox-label input {
  margin-top: 2px;
  accent-color: var(--gold);
}

.pcp-disclaimer {
  font-size: 11px;
  line-height: 1.45;
  color: #f7ebd0;
  margin: 6px 0 0 22px;
}

/* Services Care List */
.care-services-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.care-services-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.care-services-list li button {
  border: 0;
  background: transparent;
  color: #ffd982;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.add-service-box {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.add-service-box input {
  flex: 1;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.add-service-box input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.add-service-box button {
  height: 36px;
  padding: 0 12px;
  background: var(--gold);
  color: #133e33;
  font-weight: 800;
  font-size: 12px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.quick-service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.quick-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #e3ede9;
  border-radius: 4px;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.care-list-disclaimer {
  color: #b7d1c8;
  font-size: 11px;
  line-height: 1.5;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.primary-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold);
  color: #133e33;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 18px;
  transition: all 0.15s ease;
}

.primary-button:hover:not(:disabled) {
  background: #f7d477;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.55;
  box-shadow: none;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 62, 51, 0.65);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-window {
  background: #fff;
  border-radius: 18px;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--green-dark);
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.modal-body {
  padding: 26px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
}

.modal-summary-box {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.modal-summary-box dl {
  margin: 0;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 14px;
  font-size: 13px;
}

.modal-summary-box dt {
  color: var(--text-muted);
  font-weight: 700;
}

.modal-summary-box dd {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
}

.security-boundary-box {
  padding: 14px 16px;
  background: #fff4eb;
  border-left: 4px solid var(--terracotta);
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
  font-size: 13px;
  color: #733224;
}

.security-boundary-box strong {
  display: block;
  margin-bottom: 4px;
  color: #8c392f;
}

.demo-patient-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.demo-patient-form .field.full-width {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  background: #edf0ee;
  color: var(--green-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondary-button:hover {
  background: #e2e7e4;
}

/* Confirmation View */
.confirmation-view {
  text-align: center;
  padding: 16px 0;
}

.confirmation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--status-green-bg);
  color: var(--status-green);
  font-size: 26px;
  margin-bottom: 14px;
}

.confirmation-view h3 {
  font-family: Georgia, serif;
  font-size: 26px;
  color: var(--green-dark);
  margin: 0 0 8px;
}

.reference-number-box {
  display: inline-block;
  padding: 10px 20px;
  background: var(--green-dark);
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 8px;
  margin: 12px 0 16px;
}

/* Empty state */
.empty-directory {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.empty-directory strong {
  font-size: 17px;
  color: var(--green-dark);
}

.empty-directory p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 6px 0 0;
}

/* Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 960px) {
  .provider-intro {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .provider-workspace {
    grid-template-columns: 1fr;
  }
  .provider-filters {
    grid-template-columns: 1fr 1fr;
  }
  .provider-filters-row2 {
    grid-template-columns: 1fr 1fr;
  }
  .care-list {
    position: static;
  }
}

@media (max-width: 640px) {
  .provider-route-page {
    padding-top: 24px;
  }
  .provider-intro h1 {
    font-size: 34px;
  }
  .provider-tabs {
    grid-template-columns: 1fr;
  }
  .provider-filters,
  .provider-filters-row2,
  .provider-grid,
  .demo-patient-form {
    grid-template-columns: 1fr;
  }
  .modal-summary-box dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
