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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  color: #1d1d1f;
  line-height: 1.47059;
  background-color: #ffffff;
  min-height: 100vh;
  width: 100%;
  font-size: 17px;
  letter-spacing: -0.021em;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.logo {
  max-width: 150px;
  height: auto;
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 {
  text-align: center;
  margin-bottom: 0.7rem;  
  color: #1d1d1f;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.028em;
}

.subtitle {
  text-align: center;
  color: #86868b;
  margin-bottom: 3rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.insurance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.insurance-card {
  background: white;
  padding: 1.8rem;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.42, 0, 0.58, 1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.1rem);
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgba(0,0,0,0.05);
}

.insurance-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.07);
}

.insurance-card.selected {
  border: 1px solid rgba(0, 113, 227, 0.4);
  background-color: rgba(0, 113, 227, 0.05);
}

.insurance-card.disabled {
  opacity: 0.35;
  pointer-events: none;
  background-color: #f5f5f7;
  cursor: not-allowed;
}

.products-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 1rem;
  gap: 0.7rem;
  flex: 1;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.4s cubic-bezier(0.42, 0, 0.58, 1), margin-top 0.3s cubic-bezier(0.42, 0, 0.58, 1);
  overflow: hidden;
  will-change: max-height, opacity;
}

.insurance-card.expanded {
  height: auto;
}

.insurance-card.expanded .products-container {
  max-height: 1000px; 
  opacity: 1;
  margin-top: 1.5rem;
}

.product-option {
  padding: 0.8rem;
  background-color: #f5f5f7;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.42, 0, 0.58, 1);
  font-size: 0.95rem;
  font-weight: 400;
}

.product-option:hover {
  background-color: #e8e8ed;
}

.product-option.selected {
  background-color: rgba(0, 113, 227, 0.1);
  color: #0070e0;
  font-weight: 500;
}

.product-option.disabled {
  opacity: 0.4;
  pointer-events: none;
  background-color: #f5f5f7;
  cursor: not-allowed;
}

.compare-button {
  display: block;
  margin: 3rem auto;
  padding: 0.85rem 2.2rem;
  background-color: #0070e0;
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.42, 0, 0.58, 1);
  width: fit-content;
  min-width: 220px;
  letter-spacing: -0.01em;
}

.compare-button:hover {
  background-color: #0060cc;
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.download-options {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.download-button {
  padding: 0.7rem 1.5rem;
  background-color: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.42, 0, 0.58, 1);
}

.download-button:hover {
  background-color: #e8e8ed;
  transform: translateY(-2px);
}

.results-container {
  background: white;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  margin: 3rem auto;
  display: none;
  max-width: 100%;
  width: 100%;
  border: 1px solid rgba(0,0,0,0.05);
}

.results-container.visible {
  display: block;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  table-layout: fixed;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparison-table th {
  background-color: #f5f5f7;
  font-weight: 500;
  color: #1d1d1f;
}

.comparison-table th:not(:first-child) {
  resize: horizontal;
  overflow: auto;
  min-width: 150px;
}

.comparison-table th:not(:first-child)::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
}

.comparison-table th:first-child {
  width: 220px;
  min-width: 150px;
  max-width: 300px;
}

.comparison-table tr:hover {
  background-color: rgba(0,0,0,0.02);
}

.comparison-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.42, 0, 0.58, 1);
  cursor: pointer;
}

.comparison-table td.selected-service {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  font-weight: 500;
  border-left: 2px solid #28a745;
}

.comparison-table td.selected-service:hover {
  background-color: rgba(40, 167, 69, 0.15);
}

.smart-select-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 0.7rem 1.5rem;
  background-color: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.42, 0, 0.58, 1);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.smart-select-button:hover {
  background-color: #e8e8ed;
  transform: translateY(-2px);
}

.smartselect-indicator {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.75rem;
  color: #86868b;
  font-style: italic;
  font-weight: 400;
  vertical-align: middle;
  letter-spacing: -0.01em;
  background-color: rgba(0,0,0,0.03);
  padding: 0 6px;
  border-radius: 8px;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal {
  background-color: white;
  border-radius: 18px;
  padding: 30px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1d1d1f;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #86868b;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: #1d1d1f;
}

.modal-content {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-button {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-button-primary {
  background-color: #0070e0;
  color: white;
  border: none;
}

.modal-button-primary:hover {
  background-color: #0060cc;
}

.modal-button-secondary {
  background-color: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid rgba(0,0,0,0.1);
}

.modal-button-secondary:hover {
  background-color: #e8e8ed;
}

.services-selection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.service-option {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background-color: #f5f5f7;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 8px;
}

.service-option:hover {
  background-color: #e8e8ed;
}

.service-option.selected {
  background-color: rgba(0, 113, 227, 0.1);
  color: #0070e0;
  font-weight: 500;
  border: 1px solid rgba(0, 113, 227, 0.3);
}

.service-option input[type="checkbox"] {
  margin-right: 10px;
}

.recommendation-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #28a745;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 1;
}

.find-matches-button {
  margin: 0 auto;
  display: block;
  min-width: 250px;
}

@media (max-width: 768px) {
  .insurance-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }
  
  .container {
    padding: 1.5rem 1rem;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .insurance-grid {
    grid-template-columns: 1fr;
    padding: 0;
  }

  body {
    padding: 0;
  }

  .container {
    padding: 1rem 0.8rem;
  }

  .compare-button {
    width: 100%;
  }
  
  .download-options {
    flex-direction: column;
    align-items: center;
  }
  
  .download-button {
    width: 100%;
    max-width: 250px;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}