/* ============================================================================
   The Decorators Association - Pricing Benchmark Tool
   Editorial Design System | BRIEF.md Compliant
   ============================================================================ */

/* ============================================================================
   1. BASE STYLES (tokens come from tokens.css)
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   2. TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

p {
  color: var(--ink-3);
  margin-bottom: 16px;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
}

/* ============================================================================
   3. CONTAINER & LAYOUT
   ============================================================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}

.section {
  padding: 64px 0;
}

@media (max-width: 768px) {
  .section {
    padding: 48px 0;
  }
}

/* ============================================================================
   4. HERO SECTION
   ============================================================================ */

.pricing-hero {
  position: relative;
  background: var(--bone);
  padding: 48px 0;
  border-bottom: 1px solid var(--ink);
}

.pricing-hero .container {
  position: relative;
}

.pricing-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 16px;
}

.pricing-hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.pricing-hero .subtitle {
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .pricing-hero {
    padding: 32px 0;
  }

  .pricing-hero h1 {
    font-size: 36px;
  }
}

/* ============================================================================
   5. FILTER BAR / STICKY TOOLBAR
   ============================================================================ */

.filter-bar {
  position: sticky;
  top: 65px;
  z-index: 90;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  padding: 24px 0;
  margin-bottom: 0;
}

.filter-bar .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 1024px) {
  .filter-bar .container {
    flex-direction: row;
    align-items: center;
    gap: 48px;
  }
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .filter-bar {
    padding: 16px 0;
    top: 57px;
  }

  .filter-bar .container {
    gap: 16px;
  }

  .filter-section {
    gap: 12px;
  }

  .filter-label {
    display: none;
  }
}

/* ============================================================================
   5.1 METHOD TABS
   ============================================================================ */

.method-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--ink);
}

.method-tabs button {
  flex: 1;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-right: 1px solid var(--ink);
}

.method-tabs button:last-child {
  border-right: none;
}

.method-tabs button:hover {
  color: var(--ink);
  background: var(--bone-2);
}

.method-tabs button.active {
  background: var(--ink);
  color: var(--bone);
}

@media (max-width: 768px) {
  .method-tabs {
    width: 100%;
  }

  .method-tabs button {
    padding: 8px;
    font-size: 9px;
  }
}

/* ============================================================================
   5.2 QUANTITY TIER BUTTONS
   ============================================================================ */

.quantity-tiers {
  display: flex;
  gap: 0;
  align-items: center;
  border: 1px solid var(--ink);
}

.quantity-tiers button {
  flex: 1;
  padding: 8px 16px;
  border-right: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quantity-tiers button:last-child {
  border-right: none;
}

.quantity-tiers button:hover {
  color: var(--ink);
  background: var(--bone-2);
}

.quantity-tiers button.active {
  background: var(--ink);
  color: var(--bone);
}

@media (max-width: 768px) {
  .quantity-tiers {
    width: 100%;
    flex-wrap: wrap;
  }

  .quantity-tiers button {
    flex: 1 1 auto;
    min-width: calc(33.333% - 1px);
    padding: 8px;
    font-size: 9px;
    border-bottom: 1px solid var(--ink);
  }

  .quantity-tiers button:nth-child(3) {
    border-right: none;
  }

  .quantity-tiers button:nth-child(n+4) {
    border-bottom: none;
  }

  .quantity-tiers button:last-child {
    border-right: none;
  }
}

/* ============================================================================
   5.3 DROPDOWN SELECTS
   ============================================================================ */

.filter-select-group {
  display: flex;
  gap: 0;
  flex: 1;
  flex-wrap: wrap;
}

.filter-select {
  flex: 1;
  min-width: 150px;
  padding: 8px 16px;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%230E0E0C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 32px;
  margin-left: -1px;
}

.filter-select:first-child {
  margin-left: 0;
}

.filter-select:hover {
  background-color: var(--bone-2);
}

.filter-select:focus {
  outline: none;
  border-color: var(--red);
}

.filter-select option {
  background: var(--paper);
  color: var(--ink);
}

@media (max-width: 768px) {
  .filter-select-group {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .filter-select {
    width: 100%;
    min-width: unset;
    margin-left: 0;
    margin-top: -1px;
  }

  .filter-select:first-child {
    margin-top: 0;
  }
}

/* ============================================================================
   6. BENCHMARK DISPLAY
   ============================================================================ */

.benchmark-section {
  position: relative;
}

.benchmark-card {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 48px;
}

@media (max-width: 768px) {
  .benchmark-card {
    padding: 32px;
  }
}

@media (max-width: 480px) {
  .benchmark-card {
    padding: 24px;
  }
}

/* ============================================================================
   6.1 BENCHMARK VISUALIZATION BAR
   ============================================================================ */

.benchmark-visualization {
  margin: 48px 0;
}

.benchmark-chart-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 24px;
}

.benchmark-band {
  margin-bottom: 48px;
}

.benchmark-band-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.benchmark-band-label::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--ink);
}

/* Bar Track */
.bar-track {
  position: relative;
  height: 40px;
  background: var(--bone-2);
  overflow: hidden;
  border: 1px solid var(--ink);
}

/* Bar Fill */
.bar-fill {
  position: absolute;
  height: 100%;
  background: var(--ink);
  display: flex;
  align-items: center;
  transition: all 0.4s ease;
}

/* Tick Marks */
.bar-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
}

.tick {
  position: relative;
  flex: 1;
  border-right: 1px solid var(--rule);
}

.tick:last-child {
  border-right: none;
}

.tick-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.bar-prices {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  pointer-events: none;
}

.price-marker {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
}

.price-marker-value {
  font-size: 0.875rem;
  color: var(--bone);
}

.price-marker-label {
  font-size: 9px;
  color: rgba(242,238,232,0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Member Band (Phase 2) */
.benchmark-band.member-band {
  opacity: 0.5;
}

.benchmark-band.member-band .benchmark-band-label {
  color: var(--muted);
}

.benchmark-band.member-band .benchmark-band-label::before {
  background: var(--muted);
}

.benchmark-band.member-band .bar-fill {
  background: var(--muted);
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 8px;
}

@media (max-width: 768px) {
  .bar-track {
    height: 36px;
  }

  .tick-label {
    font-size: 9px;
    margin-top: 4px;
  }

  .price-marker-value {
    font-size: 0.8rem;
  }

  .price-marker-label {
    display: none;
  }
}

/* ============================================================================
   6.2 BENCHMARK CALLOUT
   ============================================================================ */

.benchmark-callout {
  margin-top: 48px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-left: 3px solid var(--ink);
}

.benchmark-callout p {
  color: var(--ink-3);
  margin: 0;
  line-height: 1.7;
}

.benchmark-callout strong {
  color: var(--ink);
  font-weight: 700;
}

.benchmark-callout code {
  font-family: var(--font-mono);
  background: var(--bone-2);
  padding: 2px 6px;
  color: var(--ink);
  font-size: 0.9em;
}

/* ============================================================================
   7. STATUS / DATA SOURCE BAR
   ============================================================================ */

.status-bar {
  background: var(--paper);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 24px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.status-bar .container {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 768px) {
  .status-bar {
    padding: 16px;
  }

  .status-bar .container {
    gap: 16px;
  }
}

/* ============================================================================
   8. SUBMIT / MEMBER CTA SECTION
   ============================================================================ */

.member-section {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 48px;
  text-align: center;
}

.member-section h2 {
  color: var(--ink);
  margin-bottom: 16px;
}

.member-section p {
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.member-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--red);
  color: var(--bone);
  border: 1px solid var(--red);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s;
  text-decoration: none;
}

.member-cta:hover {
  background: var(--ink);
  border-color: var(--ink);
  text-decoration: none;
}

.member-cta svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .member-section {
    padding: 32px 24px;
  }

  .member-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   9. FOOTER
   ============================================================================ */

.pricing-footer {
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.875rem;
}

.pricing-footer a {
  transition: color 0.15s;
}

.pricing-footer a:hover {
  color: var(--ink);
  text-decoration: none;
}

@media (max-width: 768px) {
  .pricing-footer .container {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
  .pricing-footer .container > div:last-child {
    text-align: left !important;
  }
  .pricing-footer .container > div:last-child > div:last-child {
    align-items: flex-start !important;
  }
}

/* ============================================================================
   10. ACCESSIBILITY & FOCUS STATES
   ============================================================================ */

button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  .filter-bar {
    border-bottom: 2px solid var(--ink);
  }

  .benchmark-card {
    border: 2px solid var(--ink);
  }

  button {
    border-width: 2px;
  }
}

/* ============================================================================
   11. UTILITY CLASSES
   ============================================================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.no-wrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-orange { color: var(--red); }
.text-cyan { color: var(--red); }
.text-gold { color: var(--red); }
.text-muted { color: var(--muted); }

/* ============================================================================
   12. PRINT STYLES
   ============================================================================ */

@media print {
  .filter-bar,
  .status-bar {
    display: none;
  }

  .benchmark-card {
    border: 1px solid #ccc;
    background: white;
    color: black;
  }

  .benchmark-visualization {
    break-inside: avoid;
  }
}

/* ============================================================================
   13. ANIMATIONS
   ============================================================================ */

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-slide-down { animation: slideInDown 0.4s ease-out; }
.animate-slide-up { animation: slideInUp 0.4s ease-out; }
.animate-fade-in { animation: fadeIn 0.2s ease-out; }

/* ============================================================================
   14. FILTER ROW LAYOUT
   ============================================================================ */

.filter-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

/* ============================================================================
   15. EMPTY / NO-DATA / LOADING STATES
   ============================================================================ */

.benchmark-empty,
.benchmark-no-data,
.benchmark-loading {
  text-align: center;
  padding: 64px 32px;
}

.benchmark-empty .empty-icon,
.benchmark-no-data .empty-icon {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 24px;
  color: var(--rule);
}

.benchmark-empty h3,
.benchmark-no-data h3 {
  color: var(--ink);
  margin-bottom: 8px;
}

.benchmark-empty p,
.benchmark-no-data p {
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto;
}

.benchmark-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--rule);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bar Price Labels */
.bar-price-labels {
  position: relative;
  height: 40px;
  margin-top: 4px;
}

.bar-price-label {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
}

.bar-price-label .price-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.bar-price-label .price-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.bar-price-label.label-lo .price-value { color: var(--muted); }
.bar-price-label.label-mid .price-value { color: var(--ink); }
.bar-price-label.label-hi .price-value { color: var(--red); }

/* Bar Scale */
.bar-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 4px;
}

.bar-scale span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* Source Tag */
.benchmark-source-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  margin-left: auto;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .benchmark-source-tag {
    display: none;
  }
}

/* Member Teaser */
.member-teaser {
  margin-top: 16px;
  padding: 16px;
  background: var(--bone-2);
  border: 1px solid var(--ink);
}

.member-teaser p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.member-teaser a {
  color: var(--red);
  font-weight: 500;
}

/* Lock Icon */
.lock-icon {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--rule);
}

/* Submit teaser */
.submit-teaser {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem !important;
  color: var(--muted) !important;
}

/* Mid marker line */
.bar-mid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bone);
  opacity: 0.5;
  z-index: 2;
}
